From 2f9011c8f677b4fe936efd92130d68fa92c924dc Mon Sep 17 00:00:00 2001 From: sstefdev Date: Mon, 3 Feb 2025 12:15:45 +0100 Subject: [PATCH 01/19] fix: updated lit signature logic --- package-lock.json | 8 +- .../src/lib/view-requests.svelte | 63 ++++++++---- .../src/lib/single-invoice.svelte | 95 ++++--------------- 3 files changed, 67 insertions(+), 99 deletions(-) diff --git a/package-lock.json b/package-lock.json index b59aa53a..ccf55eec 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11651,7 +11651,7 @@ }, "packages/create-invoice-form": { "name": "@requestnetwork/create-invoice-form", - "version": "0.12.2", + "version": "0.12.3", "license": "MIT", "dependencies": { "@requestnetwork/data-format": "0.19.8", @@ -11671,7 +11671,7 @@ }, "packages/invoice-dashboard": { "name": "@requestnetwork/invoice-dashboard", - "version": "0.14.0", + "version": "0.15.0", "license": "MIT", "dependencies": { "@requestnetwork/payment-detection": "0.52.0", @@ -11706,7 +11706,7 @@ }, "packages/payment-widget": { "name": "@requestnetwork/payment-widget", - "version": "0.3.8", + "version": "0.3.9", "license": "MIT", "dependencies": { "@requestnetwork/payment-processor": "0.55.0", @@ -11735,7 +11735,7 @@ }, "packages/single-invoice": { "name": "@requestnetwork/single-invoice", - "version": "0.1.1", + "version": "0.1.2", "license": "MIT", "dependencies": { "@requestnetwork/payment-detection": "0.52.0", diff --git a/packages/invoice-dashboard/src/lib/view-requests.svelte b/packages/invoice-dashboard/src/lib/view-requests.svelte index ee4bf824..3d159037 100644 --- a/packages/invoice-dashboard/src/lib/view-requests.svelte +++ b/packages/invoice-dashboard/src/lib/view-requests.svelte @@ -194,18 +194,30 @@ currencyManager = await initializeCurrencyManager(); }); - const getRequestsQueryKey = (address: string, currentPage: number) => ["requestsData", address, currentPage]; + const getRequestsQueryKey = (address: string, currentPage: number) => [ + "requestsData", + address, + currentPage, + ]; - const fetchRequests = async (address: string, page: number, pageSize: number) => { + const fetchRequests = async ( + address: string, + page: number, + pageSize: number + ) => { if (!address || !requestNetwork) return null; try { - const requestsData = await requestNetwork.fromIdentity({ - type: Types.Identity.TYPE.ETHEREUM_ADDRESS, - value: address, - }, undefined, { - page: page, - pageSize: pageSize, - }); + const requestsData = await requestNetwork.fromIdentity( + { + type: Types.Identity.TYPE.ETHEREUM_ADDRESS, + value: address, + }, + undefined, + { + page: page, + pageSize: pageSize, + } + ); return requestsData; } catch (error) { console.error("Failed to fetch requests:", error); @@ -222,12 +234,14 @@ try { const data = await queryClient.fetchQuery({ queryKey: getRequestsQueryKey(account.address, currentPage), - queryFn: () => fetchRequests(account.address, currentPage, itemsPerPage) + queryFn: () => + fetchRequests(account.address, currentPage, itemsPerPage), }); if (data) { - requests = data.requests?.map((request) => request.getData()) - .sort((a, b) => b.timestamp - a.timestamp); + requests = data.requests + ?.map((request) => request.getData()) + .sort((a, b) => b.timestamp - a.timestamp); hasMoreRequests = data?.meta?.pagination?.hasMore || false; } else { requests = []; @@ -237,7 +251,8 @@ if (hasMoreRequests) { queryClient.prefetchQuery({ queryKey: getRequestsQueryKey(account.address, currentPage + 1), - queryFn: () => fetchRequests(account.address, currentPage + 1, itemsPerPage) + queryFn: () => + fetchRequests(account.address, currentPage + 1, itemsPerPage), }); } @@ -492,24 +507,36 @@ return; loading = true; - const previousNetworks = [...selectedNetworks]; // Store current selection + const previousNetworks = [...selectedNetworks]; try { if (sliderValue === "on") { if (localStorage?.getItem("isDecryptionEnabled") === "false") { - queryClient.invalidateQueries() - } + queryClient.invalidateQueries(); + } try { const signer = await getEthersSigner(wagmiConfig); if (signer && currentAccount?.address) { loadSessionSignatures = localStorage?.getItem("lit-wallet-sig") === null; - await cipherProvider?.getSessionSignatures( + const signatures = await cipherProvider?.getSessionSignatures( signer, currentAccount.address, window.location.host, "Sign in to Lit Protocol through Request Network" ); + + // Save both signatures + localStorage?.setItem( + "lit-wallet-sig", + JSON.stringify({ + address: currentAccount.address, + timestamp: Date.now(), + sig: signatures.walletSig, + }) + ); + localStorage?.setItem("lit-session-key", signatures.sessionKey); + cipherProvider?.enableDecryption(true); localStorage?.setItem("isDecryptionEnabled", JSON.stringify(true)); } @@ -522,7 +549,7 @@ } } else { if (localStorage?.getItem("isDecryptionEnabled") === "true") { - queryClient.invalidateQueries() + queryClient.invalidateQueries(); } cipherProvider?.enableDecryption(false); localStorage?.setItem("isDecryptionEnabled", JSON.stringify(false)); diff --git a/packages/single-invoice/src/lib/single-invoice.svelte b/packages/single-invoice/src/lib/single-invoice.svelte index 03691211..8e37cf27 100644 --- a/packages/single-invoice/src/lib/single-invoice.svelte +++ b/packages/single-invoice/src/lib/single-invoice.svelte @@ -252,79 +252,26 @@ }; const ensureDecryption = async () => { - if (!isDecryptionEnabled || !cipherProvider || !account?.address) { - return false; - } - - try { - // First check if the request is actually encrypted - const encrypted = await isRequestEncrypted(requestId); - if (!encrypted) { - console.log("Request is not encrypted, skipping decryption setup"); - return true; - } - - console.log("Request is encrypted, setting up decryption"); - const signer = await getEthersSigner(wagmiConfig); - if (!signer) return false; - - // Check if we have a valid session first - const hasExistingSession = - localStorage.getItem("lit-wallet-sig") === "true"; - - if (hasExistingSession) { - // Try to use existing session - try { - cipherProvider.enableDecryption(true); - // Test if current session works with a request fetch - const testRequest = await requestNetwork?.fromRequestId(requestId); - - // Only consider the session valid if we can actually decrypt the request - if (testRequest?.getData()) { - console.log("Using existing Lit Protocol session"); - return true; - } - } catch (error) { - // If we get a decryption error, we need a new session - if ( - String(error).includes("Decryption is not available") || - String(error).includes("Failed to decrypt") || - String(error).includes("LitNodeClient is not ready") - ) { - console.log("Existing session invalid, clearing..."); - localStorage.removeItem("lit-wallet-sig"); - } else { - // If it's some other error, keep the session - console.log("Error fetching request, but keeping session:", error); - return true; - } - } - } + if (!account?.address || !cipherProvider) return; - // If we get here, we need a new session - console.log("Getting new Lit Protocol session"); - loadSessionSignatures = true; + const walletSig = localStorage.getItem("lit-wallet-sig"); + const sessionKey = localStorage.getItem("lit-session-key"); + const isEnabled = localStorage.getItem("isDecryptionEnabled") === "true"; + if (walletSig && sessionKey && isEnabled) { try { - await cipherProvider.getSessionSignatures( - signer, - account.address, - window.location.host, - "Sign in to Lit Protocol through Request Network" - ); - - localStorage.setItem("lit-wallet-sig", "true"); + // Use existing signatures cipherProvider.enableDecryption(true); - return true; } catch (error) { - console.error("Failed to get new session signatures:", error); - return false; - } finally { - loadSessionSignatures = false; + console.error( + "Failed to enable decryption with existing signatures:", + error + ); + // Clear invalid signatures + localStorage.removeItem("lit-wallet-sig"); + localStorage.removeItem("lit-session-key"); + localStorage.setItem("isDecryptionEnabled", "false"); } - } catch (error) { - console.error("Failed to ensure decryption:", error); - return false; } }; @@ -471,22 +418,14 @@ let unwatchAccount: WatchAccountReturnType | undefined; const handleWalletConnection = async () => { - account = getAccount(wagmiConfig); + if (!account?.address) return; - // Reset decryption state - if (cipherProvider) { - cipherProvider.disconnectWallet(); - localStorage.removeItem("lit-wallet-sig"); - } + account = getAccount(wagmiConfig); - // Only attempt decryption setup if needed if (isDecryptionEnabled && requestId) { const isEncrypted = await isRequestEncrypted(requestId); if (isEncrypted) { await ensureDecryption(); - } else { - // For non-encrypted requests, just disable decryption - cipherProvider?.enableDecryption(false); } } @@ -508,6 +447,8 @@ if (cipherProvider) { cipherProvider.disconnectWallet(); localStorage.removeItem("lit-wallet-sig"); + localStorage.removeItem("lit-session-key"); + localStorage.setItem("isDecryptionEnabled", "false"); } }; From 3b817f06711b70d5c065318a2ddfcc6501edfc07 Mon Sep 17 00:00:00 2001 From: sstefdev Date: Tue, 18 Feb 2025 16:37:32 +0100 Subject: [PATCH 02/19] fix: issue with lit-wallet-sig --- .../src/lib/view-requests.svelte | 102 +++++++++++++----- .../src/lib/single-invoice.svelte | 87 ++++++++++++++- 2 files changed, 160 insertions(+), 29 deletions(-) diff --git a/packages/invoice-dashboard/src/lib/view-requests.svelte b/packages/invoice-dashboard/src/lib/view-requests.svelte index bd88f6aa..0e8736c6 100644 --- a/packages/invoice-dashboard/src/lib/view-requests.svelte +++ b/packages/invoice-dashboard/src/lib/view-requests.svelte @@ -136,6 +136,9 @@ { value: "pending", checked: false }, ]; + let litSessionInitialized = false; + let initializationAttempted = false; + const handleWalletConnection = async () => { account = getAccount(wagmiConfig); await loadRequests(sliderValueForDecryption, account, requestNetwork); @@ -149,29 +152,36 @@ cipherProvider = undefined; }; - const handleWalletChange = ( + const handleWalletChange = async ( account: GetAccountReturnType, previousAccount: GetAccountReturnType ) => { if (account?.address !== previousAccount?.address) { - handleWalletDisconnection(); - handleWalletConnection(); - } else if (account?.address) { - handleWalletConnection(); - } else { - handleWalletDisconnection(); + clearLitStorage(); + litSessionInitialized = false; + initializationAttempted = false; + if (account?.address) { + await initializeLitSession(account); + } } }; - onMount(() => { + onMount(async () => { + try { + currencyManager = await initializeCurrencyManager(); + if (account?.address) { + await initializeLitSession(account); + } + } catch (error) { + console.error("Failed to initialize:", error); + } + unwatchAccount = watchAccount(wagmiConfig, { onChange( account: GetAccountReturnType, previousAccount: GetAccountReturnType ) { - tick().then(() => { - handleWalletChange(account, previousAccount); - }); + handleWalletChange(account, previousAccount); }, }); }); @@ -190,9 +200,57 @@ $: isRequestPayed, getOneRequest(activeRequest); - onMount(async () => { - currencyManager = await initializeCurrencyManager(); - }); + const initializeLitSession = async ( + currentAccount: GetAccountReturnType | undefined + ) => { + if (!currentAccount?.address || !cipherProvider || initializationAttempted) + return; + + initializationAttempted = true; + + try { + const storedSig = localStorage?.getItem("lit-wallet-sig"); + const sessionKey = localStorage?.getItem("lit-session-key"); + + if (storedSig && sessionKey) { + const parsedSig = JSON.parse(storedSig); + + if ( + parsedSig.address?.toLowerCase() === + currentAccount.address?.toLowerCase() + ) { + try { + // Use the stored session key and signature to restore the session + await cipherProvider.enableDecryption(true); + sliderValueForDecryption = "on"; + litSessionInitialized = true; + localStorage.setItem("isDecryptionEnabled", "true"); + await getRequests(currentAccount, requestNetwork); + return true; + } catch (error) { + console.error("Failed to restore Lit session:", error); + clearLitStorage(); + } + } else { + clearLitStorage(); + } + } + } catch (error) { + console.error("Failed to initialize Lit session:", error); + clearLitStorage(); + } + return false; + }; + + const clearLitStorage = () => { + localStorage?.removeItem("lit-wallet-sig"); + localStorage?.removeItem("lit-session-key"); + localStorage?.setItem("isDecryptionEnabled", "false"); + sliderValueForDecryption = "off"; + if (cipherProvider) { + cipherProvider.enableDecryption(false); + } + }; const getRequestsQueryKey = (address: string, currentPage: number) => [ "requestsData", @@ -508,7 +566,7 @@ return; loading = true; - const previousNetworks = [...selectedNetworks]; + const previousNetworks = [...selectedNetworks]; // Store current selection try { if (sliderValue === "on") { @@ -520,24 +578,12 @@ if (signer && currentAccount?.address) { loadSessionSignatures = localStorage?.getItem("lit-wallet-sig") === null; - const signatures = await cipherProvider?.getSessionSignatures( + await cipherProvider?.getSessionSignatures( signer, currentAccount.address, window.location.host, "Sign in to Lit Protocol through Request Network" ); - - // Save both signatures - localStorage?.setItem( - "lit-wallet-sig", - JSON.stringify({ - address: currentAccount.address, - timestamp: Date.now(), - sig: signatures.walletSig, - }) - ); - localStorage?.setItem("lit-session-key", signatures.sessionKey); - cipherProvider?.enableDecryption(true); localStorage?.setItem("isDecryptionEnabled", JSON.stringify(true)); } diff --git a/packages/single-invoice/src/lib/single-invoice.svelte b/packages/single-invoice/src/lib/single-invoice.svelte index 8e37cf27..04152cc9 100644 --- a/packages/single-invoice/src/lib/single-invoice.svelte +++ b/packages/single-invoice/src/lib/single-invoice.svelte @@ -124,6 +124,9 @@ localStorage?.getItem("isDecryptionEnabled") ?? "false" ); + let litSessionInitialized = false; + let initializationAttempted = false; + $: cipherProvider = requestNetwork?.getCipherProvider() as CipherProvider; $: if (request && address) { @@ -207,8 +210,78 @@ unknownCurrency = currency ? currency.decimals === undefined : false; } + const initializeLitSession = async ( + currentAccount: GetAccountReturnType | undefined + ) => { + if ( + !currentAccount?.address || + !cipherProvider || + initializationAttempted + ) { + console.error( + "Initialization skipped: Missing account, cipherProvider, or already attempted." + ); + return; + } + + initializationAttempted = true; + + try { + const storedSig = localStorage?.getItem("lit-wallet-sig"); + const sessionKey = localStorage?.getItem("lit-session-key"); + + if (storedSig && sessionKey) { + const parsedSig = JSON.parse(storedSig); + + if ( + parsedSig.address?.toLowerCase() === + currentAccount.address?.toLowerCase() + ) { + try { + // Use the stored session key and signature to restore the session + await cipherProvider.enableDecryption(true); + litSessionInitialized = true; + localStorage.setItem("isDecryptionEnabled", "true"); + console.log("Lit session restored successfully."); + return true; + } catch (error) { + console.error("Failed to restore Lit session:", error); + clearLitStorage(); + } + } else { + console.warn("Stored signature does not match current account."); + clearLitStorage(); + } + } else { + console.warn("No stored session data found."); + } + } catch (error) { + console.error("Failed to initialize Lit session:", error); + clearLitStorage(); + } + return false; + }; + + const clearLitStorage = () => { + localStorage?.removeItem("lit-wallet-sig"); + localStorage?.removeItem("lit-session-key"); + localStorage.setItem("isDecryptionEnabled", "false"); + if (cipherProvider) { + cipherProvider.enableDecryption(false); + } + console.log("Cleared Lit session storage."); + }; + onMount(async () => { currencyManager = await initializeCurrencyManager(); + if (account?.address) { + // Attempt to use existing session from the dashboard + const sessionRestored = await initializeLitSession(account); + if (!sessionRestored) { + // If no session is restored, initialize a new session + await initializeLitSession(account); + } + } }); onMount(() => { @@ -252,16 +325,21 @@ }; const ensureDecryption = async () => { - if (!account?.address || !cipherProvider) return; + if (!account?.address || !cipherProvider) return false; const walletSig = localStorage.getItem("lit-wallet-sig"); const sessionKey = localStorage.getItem("lit-session-key"); const isEnabled = localStorage.getItem("isDecryptionEnabled") === "true"; + console.log("walletSig", walletSig); + console.log("sessionKey", sessionKey); + console.log("isEnabled", isEnabled); + if (walletSig && sessionKey && isEnabled) { try { // Use existing signatures cipherProvider.enableDecryption(true); + return true; } catch (error) { console.error( "Failed to enable decryption with existing signatures:", @@ -271,8 +349,10 @@ localStorage.removeItem("lit-wallet-sig"); localStorage.removeItem("lit-session-key"); localStorage.setItem("isDecryptionEnabled", "false"); + return false; } } + return false; }; const getOneRequest = async (requestId: string) => { @@ -281,10 +361,14 @@ unsupportedNetwork = false; // Only attempt decryption setup if needed + console.log("isDecryptionEnabled", isDecryptionEnabled); if (isDecryptionEnabled) { const encrypted = await isRequestEncrypted(requestId); + console.log("encrypted", encrypted); if (encrypted) { + console.log("Ensuring decryption..."); const decryptionReady = await ensureDecryption(); + console.log("decryptionReady", decryptionReady); if (!decryptionReady) { throw new Error("Failed to initialize decryption"); } @@ -295,6 +379,7 @@ } const singleRequest = await requestNetwork?.fromRequestId(requestId); + console.log("singleRequest", singleRequest); if (!singleRequest) { console.log("No request found"); return; From ede8ea84284479739885a5b1288cabf66b098adb Mon Sep 17 00:00:00 2001 From: sstefdev Date: Tue, 18 Feb 2025 16:45:57 +0100 Subject: [PATCH 03/19] chore: remove console.logs --- .../src/lib/single-invoice.svelte | 21 +------------------ 1 file changed, 1 insertion(+), 20 deletions(-) diff --git a/packages/single-invoice/src/lib/single-invoice.svelte b/packages/single-invoice/src/lib/single-invoice.svelte index 04152cc9..9bcced4a 100644 --- a/packages/single-invoice/src/lib/single-invoice.svelte +++ b/packages/single-invoice/src/lib/single-invoice.svelte @@ -265,11 +265,10 @@ const clearLitStorage = () => { localStorage?.removeItem("lit-wallet-sig"); localStorage?.removeItem("lit-session-key"); - localStorage.setItem("isDecryptionEnabled", "false"); + localStorage?.setItem("isDecryptionEnabled", "false"); if (cipherProvider) { cipherProvider.enableDecryption(false); } - console.log("Cleared Lit session storage."); }; onMount(async () => { @@ -331,20 +330,12 @@ const sessionKey = localStorage.getItem("lit-session-key"); const isEnabled = localStorage.getItem("isDecryptionEnabled") === "true"; - console.log("walletSig", walletSig); - console.log("sessionKey", sessionKey); - console.log("isEnabled", isEnabled); - if (walletSig && sessionKey && isEnabled) { try { // Use existing signatures cipherProvider.enableDecryption(true); return true; } catch (error) { - console.error( - "Failed to enable decryption with existing signatures:", - error - ); // Clear invalid signatures localStorage.removeItem("lit-wallet-sig"); localStorage.removeItem("lit-session-key"); @@ -360,34 +351,25 @@ loading = true; unsupportedNetwork = false; - // Only attempt decryption setup if needed - console.log("isDecryptionEnabled", isDecryptionEnabled); if (isDecryptionEnabled) { const encrypted = await isRequestEncrypted(requestId); - console.log("encrypted", encrypted); if (encrypted) { - console.log("Ensuring decryption..."); const decryptionReady = await ensureDecryption(); - console.log("decryptionReady", decryptionReady); if (!decryptionReady) { throw new Error("Failed to initialize decryption"); } } else { - // For non-encrypted requests, just disable decryption cipherProvider?.enableDecryption(false); } } const singleRequest = await requestNetwork?.fromRequestId(requestId); - console.log("singleRequest", singleRequest); if (!singleRequest) { - console.log("No request found"); return; } request = singleRequest.getData(); if (!request) { - console.log("No request data found"); return; } @@ -480,7 +462,6 @@ status = checkStatus(requestData); await checkBalance(); } catch (error) { - console.error("Failed to fetch request:", error); if (String(error).includes("Unsupported payment")) { unsupportedNetwork = true; } else if (String(error).includes("LitNodeClient is not ready")) { From 46bea8529066a94342fe561ba78eb4977f2b2c44 Mon Sep 17 00:00:00 2001 From: sstefdev Date: Wed, 26 Feb 2025 13:18:45 +0100 Subject: [PATCH 04/19] chore: pin web3modal version --- package-lock.json | 1148 ++++++++++++++------------ packages/payment-widget/package.json | 2 +- 2 files changed, 622 insertions(+), 528 deletions(-) diff --git a/package-lock.json b/package-lock.json index 73d31709..4fd6a923 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5230,145 +5230,84 @@ "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", "license": "0BSD" }, - "node_modules/@web3modal/base": { - "version": "5.1.11", - "resolved": "https://registry.npmjs.org/@web3modal/base/-/base-5.1.11.tgz", - "integrity": "sha512-wJCsqQ1FG0Isiv0Exaz2Sv+FpijVmNPNay+sGdV5HP2SpBAR/1xxHca2/vLBdACX7rYAFAj723DYQE0fmUpIaw==", + "node_modules/@web3modal/scaffold": { + "version": "5.0.11", + "resolved": "https://registry.npmjs.org/@web3modal/scaffold/-/scaffold-5.0.11.tgz", + "integrity": "sha512-QoKI1srTvUVem9zUGJ//d0rq7xxQhyulC9CeaSusa6roljS6VP65aqPvhEvtudK5LWbqpLoK6WtLrIdVVj3DFg==", "license": "Apache-2.0", "dependencies": { - "@walletconnect/utils": "2.16.1", - "@web3modal/common": "5.1.11", - "@web3modal/core": "5.1.11", - "@web3modal/polyfills": "5.1.11", - "@web3modal/scaffold-ui": "5.1.11", - "@web3modal/scaffold-utils": "5.1.11", - "@web3modal/siwe": "5.1.11", - "@web3modal/ui": "5.1.11", - "@web3modal/wallet": "5.1.11" - }, - "optionalDependencies": { - "borsh": "0.7.0", - "bs58": "5.0.0" - } - }, - "node_modules/@web3modal/base/node_modules/@walletconnect/types": { - "version": "2.16.1", - "resolved": "https://registry.npmjs.org/@walletconnect/types/-/types-2.16.1.tgz", - "integrity": "sha512-9P4RG4VoDEF+yBF/n2TF12gsvT/aTaeZTVDb/AOayafqiPnmrQZMKmNCJJjq1sfdsDcHXFcZWMGsuCeSJCmrXA==", - "license": "Apache-2.0", - "dependencies": { - "@walletconnect/events": "1.0.1", - "@walletconnect/heartbeat": "1.2.2", - "@walletconnect/jsonrpc-types": "1.0.4", - "@walletconnect/keyvaluestorage": "1.1.1", - "@walletconnect/logger": "2.1.2", - "events": "3.3.0" + "@web3modal/common": "5.0.11", + "@web3modal/core": "5.0.11", + "@web3modal/scaffold-ui": "5.0.11", + "@web3modal/scaffold-utils": "5.0.11", + "@web3modal/siwe": "5.0.11", + "@web3modal/ui": "5.0.11", + "@web3modal/wallet": "5.0.11", + "lit": "3.1.0" } }, - "node_modules/@web3modal/base/node_modules/@walletconnect/utils": { - "version": "2.16.1", - "resolved": "https://registry.npmjs.org/@walletconnect/utils/-/utils-2.16.1.tgz", - "integrity": "sha512-aoQirVoDoiiEtYeYDtNtQxFzwO/oCrz9zqeEEXYJaAwXlGVTS34KFe7W3/Rxd/pldTYKFOZsku2EzpISfH8Wsw==", + "node_modules/@web3modal/scaffold-vue": { + "version": "5.0.11", + "resolved": "https://registry.npmjs.org/@web3modal/scaffold-vue/-/scaffold-vue-5.0.11.tgz", + "integrity": "sha512-GvdWVMAis1nvjErrsxsd4DvGyZ/+V1DoeoCBLgXqImYg2JfIYuH80xUiOJNKWq1wrs+/J9pNsc+r4BDSNtI+HQ==", "license": "Apache-2.0", "dependencies": { - "@stablelib/chacha20poly1305": "1.0.1", - "@stablelib/hkdf": "1.0.1", - "@stablelib/random": "1.0.2", - "@stablelib/sha256": "1.0.1", - "@stablelib/x25519": "1.0.3", - "@walletconnect/relay-api": "1.0.11", - "@walletconnect/relay-auth": "1.0.4", - "@walletconnect/safe-json": "1.0.2", - "@walletconnect/time": "1.0.2", - "@walletconnect/types": "2.16.1", - "@walletconnect/window-getters": "1.0.1", - "@walletconnect/window-metadata": "1.0.1", - "detect-browser": "5.3.0", - "elliptic": "^6.5.7", - "query-string": "7.1.3", - "uint8arrays": "3.1.0" - } - }, - "node_modules/@web3modal/base/node_modules/bn.js": { - "version": "4.12.1", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.1.tgz", - "integrity": "sha512-k8TVBiPkPJT9uHLdOKfFpqcfprwBFOAAXXozRubr7R7PfIuKvQlzcI4M0pALeqXN09vdaMbUdUj+pass+uULAg==", - "license": "MIT" - }, - "node_modules/@web3modal/base/node_modules/elliptic": { - "version": "6.6.1", - "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.6.1.tgz", - "integrity": "sha512-RaddvvMatK2LJHqFJ+YA4WysVN5Ita9E35botqIYspQ4TkRAlCicdzKOjlyv/1Za5RyTNn7di//eEV0uTAfe3g==", - "license": "MIT", - "dependencies": { - "bn.js": "^4.11.9", - "brorand": "^1.1.0", - "hash.js": "^1.0.0", - "hmac-drbg": "^1.0.1", - "inherits": "^2.0.4", - "minimalistic-assert": "^1.0.1", - "minimalistic-crypto-utils": "^1.0.1" + "@web3modal/core": "5.0.11", + "@web3modal/scaffold": "5.0.11" + }, + "peerDependencies": { + "vue": ">=3" + }, + "peerDependenciesMeta": { + "vue": { + "optional": true + } } }, - "node_modules/@web3modal/common": { - "version": "5.1.11", - "resolved": "https://registry.npmjs.org/@web3modal/common/-/common-5.1.11.tgz", - "integrity": "sha512-YfSklKjjiM1RGxFTQm3ycYZ2Ktb6vswt9eg8lGXRknxN+SC7bCtuvgtyyCO0Z9/f9dPMOGIAmoJ/y6WHXWQqcg==", + "node_modules/@web3modal/scaffold-vue/node_modules/@web3modal/common": { + "version": "5.0.11", + "resolved": "https://registry.npmjs.org/@web3modal/common/-/common-5.0.11.tgz", + "integrity": "sha512-xI6FKrk4/TofM27e0R5F0e7OWMa0YECJshITgFVrX57ZPbgw0O8bTTgLa0yxYG3A5xMnuz6dOYjAAQV+EXrr9w==", "license": "Apache-2.0", "dependencies": { "bignumber.js": "9.1.2", "dayjs": "1.11.10" } }, - "node_modules/@web3modal/core": { - "version": "5.1.11", - "resolved": "https://registry.npmjs.org/@web3modal/core/-/core-5.1.11.tgz", - "integrity": "sha512-ugUVFVml1vVW+V7yxkn/AYYdrUJzn4ulFbDlxDMpmukKY6sDYLMMGAJ84O8ZC/OPyC7009NYd3mKZurxEyWkHw==", + "node_modules/@web3modal/scaffold-vue/node_modules/@web3modal/core": { + "version": "5.0.11", + "resolved": "https://registry.npmjs.org/@web3modal/core/-/core-5.0.11.tgz", + "integrity": "sha512-YX5msOOEmB0HYwdDt3sF8JCMyTfkzCV9tMWPMQqBdFT8p+9lPaW4JCmqYwJMI9AhUiPpZWc6ubFit62+OzBAQQ==", "deprecated": "Web3Modal is now Reown AppKit. Please follow the upgrade guide at https://docs.reown.com/appkit/upgrade/from-w3m-to-reown", "license": "Apache-2.0", "dependencies": { - "@web3modal/common": "5.1.11", - "@web3modal/wallet": "5.1.11", + "@web3modal/common": "5.0.11", + "@web3modal/wallet": "5.0.11", "valtio": "1.11.2" } }, - "node_modules/@web3modal/ethers5": { - "version": "5.1.11", - "resolved": "https://registry.npmjs.org/@web3modal/ethers5/-/ethers5-5.1.11.tgz", - "integrity": "sha512-Z/8RTNbV6DftKZktzrqvgIIK+2CoSISmAKKl7lGlOP+WqwwGvyTO7+hap64VktSDCGK/oFHKCasi/YKuXmam5Q==", - "deprecated": "Web3Modal is now Reown AppKit. Please follow the upgrade guide at https://docs.reown.com/appkit/upgrade/from-w3m-to-reown", + "node_modules/@web3modal/scaffold-vue/node_modules/@web3modal/polyfills": { + "version": "5.0.11", + "resolved": "https://registry.npmjs.org/@web3modal/polyfills/-/polyfills-5.0.11.tgz", + "integrity": "sha512-F2pC4egFTwlGyyK6PuW1lEJwdl1NK+9AfiO9aiR58RXzj4uFStPuO4wzOGONz+5Kv8lM1ZiooRD0pMcJmsyzLw==", "license": "Apache-2.0", "dependencies": { - "@coinbase/wallet-sdk": "4.0.3", - "@walletconnect/ethereum-provider": "2.16.1", - "@walletconnect/utils": "2.16.1", - "@web3modal/base": "5.1.11", - "@web3modal/common": "5.1.11", - "@web3modal/polyfills": "5.1.11", - "@web3modal/scaffold-utils": "5.1.11", - "@web3modal/siwe": "5.1.11", - "@web3modal/wallet": "5.1.11", - "valtio": "1.11.2" - }, - "peerDependencies": { - "ethers": ">=4.1.0 <6.0.0", - "react": ">=17", - "react-dom": ">=17", - "vue": ">=3" - }, - "peerDependenciesMeta": { - "react": { - "optional": true - }, - "react-dom": { - "optional": true - }, - "vue": { - "optional": true - } + "buffer": "6.0.3" + } + }, + "node_modules/@web3modal/scaffold-vue/node_modules/@web3modal/wallet": { + "version": "5.0.11", + "resolved": "https://registry.npmjs.org/@web3modal/wallet/-/wallet-5.0.11.tgz", + "integrity": "sha512-8lsDCfsJS23UXllVyg9uB/RIWi+2k/g3hc4QN8Z9HGVhJREjk/cNc7e+mWWI077PDsplXAjnw3sK864O12v7Xg==", + "license": "Apache-2.0", + "dependencies": { + "@walletconnect/logger": "2.1.2", + "@web3modal/common": "5.0.11", + "@web3modal/polyfills": "5.0.11", + "zod": "3.22.4" } }, - "node_modules/@web3modal/ethers5/node_modules/@coinbase/wallet-sdk": { + "node_modules/@web3modal/scaffold/node_modules/@coinbase/wallet-sdk": { "version": "4.0.3", "resolved": "https://registry.npmjs.org/@coinbase/wallet-sdk/-/wallet-sdk-4.0.3.tgz", "integrity": "sha512-y/OGEjlvosikjfB+wk+4CVb9OxD1ob9cidEBLI5h8Hxaf/Qoob2XoVT1uvhtAzBx34KpGYSd+alKvh/GCRre4Q==", @@ -5382,209 +5321,172 @@ "sha.js": "^2.4.11" } }, - "node_modules/@web3modal/ethers5/node_modules/@walletconnect/core": { - "version": "2.16.1", - "resolved": "https://registry.npmjs.org/@walletconnect/core/-/core-2.16.1.tgz", - "integrity": "sha512-UlsnEMT5wwFvmxEjX8s4oju7R3zadxNbZgsFeHEsjh7uknY2zgmUe1Lfc5XU6zyPb1Jx7Nqpdx1KN485ee8ogw==", - "license": "Apache-2.0", + "node_modules/@web3modal/scaffold/node_modules/@lit/reactive-element": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/@lit/reactive-element/-/reactive-element-2.0.4.tgz", + "integrity": "sha512-GFn91inaUa2oHLak8awSIigYz0cU0Payr1rcFsrkf5OJ5eSPxElyZfKh0f2p9FsTiZWXQdWGJeXZICEfXXYSXQ==", + "license": "BSD-3-Clause", "dependencies": { - "@walletconnect/heartbeat": "1.2.2", - "@walletconnect/jsonrpc-provider": "1.0.14", - "@walletconnect/jsonrpc-types": "1.0.4", - "@walletconnect/jsonrpc-utils": "1.0.8", - "@walletconnect/jsonrpc-ws-connection": "1.0.14", - "@walletconnect/keyvaluestorage": "1.1.1", - "@walletconnect/logger": "2.1.2", - "@walletconnect/relay-api": "1.0.11", - "@walletconnect/relay-auth": "1.0.4", - "@walletconnect/safe-json": "1.0.2", - "@walletconnect/time": "1.0.2", - "@walletconnect/types": "2.16.1", - "@walletconnect/utils": "2.16.1", - "events": "3.3.0", - "lodash.isequal": "4.5.0", - "uint8arrays": "3.1.0" - }, - "engines": { - "node": ">=18" + "@lit-labs/ssr-dom-shim": "^1.2.0" } }, - "node_modules/@web3modal/ethers5/node_modules/@walletconnect/ethereum-provider": { - "version": "2.16.1", - "resolved": "https://registry.npmjs.org/@walletconnect/ethereum-provider/-/ethereum-provider-2.16.1.tgz", - "integrity": "sha512-oD7DNCssUX3plS5gGUZ9JQ63muQB/vxO68X6RzD2wd8gBsYtSPw4BqYFc7KTO6dUizD6gfPirw32yW2pTvy92w==", - "license": "Apache-2.0", + "node_modules/@web3modal/scaffold/node_modules/@walletconnect/heartbeat": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@walletconnect/heartbeat/-/heartbeat-1.2.1.tgz", + "integrity": "sha512-yVzws616xsDLJxuG/28FqtZ5rzrTA4gUjdEMTbWB5Y8V1XHRmqq4efAxCw5ie7WjbXFSUyBHaWlMR+2/CpQC5Q==", + "license": "MIT", "dependencies": { - "@walletconnect/jsonrpc-http-connection": "1.0.8", - "@walletconnect/jsonrpc-provider": "1.0.14", - "@walletconnect/jsonrpc-types": "1.0.4", - "@walletconnect/jsonrpc-utils": "1.0.8", - "@walletconnect/modal": "2.6.2", - "@walletconnect/sign-client": "2.16.1", - "@walletconnect/types": "2.16.1", - "@walletconnect/universal-provider": "2.16.1", - "@walletconnect/utils": "2.16.1", - "events": "3.3.0" + "@walletconnect/events": "^1.0.1", + "@walletconnect/time": "^1.0.2", + "tslib": "1.14.1" } }, - "node_modules/@web3modal/ethers5/node_modules/@walletconnect/modal": { - "version": "2.6.2", - "resolved": "https://registry.npmjs.org/@walletconnect/modal/-/modal-2.6.2.tgz", - "integrity": "sha512-eFopgKi8AjKf/0U4SemvcYw9zlLpx9njVN8sf6DAkowC2Md0gPU/UNEbH1Wwj407pEKnEds98pKWib1NN1ACoA==", - "license": "Apache-2.0", + "node_modules/@web3modal/scaffold/node_modules/@walletconnect/jsonrpc-types": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/@walletconnect/jsonrpc-types/-/jsonrpc-types-1.0.3.tgz", + "integrity": "sha512-iIQ8hboBl3o5ufmJ8cuduGad0CQm3ZlsHtujv9Eu16xq89q+BG7Nh5VLxxUgmtpnrePgFkTwXirCTkwJH1v+Yw==", + "license": "MIT", "dependencies": { - "@walletconnect/modal-core": "2.6.2", - "@walletconnect/modal-ui": "2.6.2" + "keyvaluestorage-interface": "^1.0.0", + "tslib": "1.14.1" } }, - "node_modules/@web3modal/ethers5/node_modules/@walletconnect/modal-core": { - "version": "2.6.2", - "resolved": "https://registry.npmjs.org/@walletconnect/modal-core/-/modal-core-2.6.2.tgz", - "integrity": "sha512-cv8ibvdOJQv2B+nyxP9IIFdxvQznMz8OOr/oR/AaUZym4hjXNL/l1a2UlSQBXrVjo3xxbouMxLb3kBsHoYP2CA==", + "node_modules/@web3modal/scaffold/node_modules/@walletconnect/types": { + "version": "2.12.0", + "resolved": "https://registry.npmjs.org/@walletconnect/types/-/types-2.12.0.tgz", + "integrity": "sha512-uhB3waGmujQVJcPgJvGOpB8RalgYSBT+HpmVbfl4Qe0xJyqpRUo4bPjQa0UYkrHaW20xIw94OuP4+FMLYdeemg==", "license": "Apache-2.0", "dependencies": { - "valtio": "1.11.2" + "@walletconnect/events": "^1.0.1", + "@walletconnect/heartbeat": "1.2.1", + "@walletconnect/jsonrpc-types": "1.0.3", + "@walletconnect/keyvaluestorage": "^1.1.1", + "@walletconnect/logger": "^2.0.1", + "events": "^3.3.0" } }, - "node_modules/@web3modal/ethers5/node_modules/@walletconnect/modal-ui": { - "version": "2.6.2", - "resolved": "https://registry.npmjs.org/@walletconnect/modal-ui/-/modal-ui-2.6.2.tgz", - "integrity": "sha512-rbdstM1HPGvr7jprQkyPggX7rP4XiCG85ZA+zWBEX0dVQg8PpAgRUqpeub4xQKDgY7pY/xLRXSiCVdWGqvG2HA==", + "node_modules/@web3modal/scaffold/node_modules/@walletconnect/utils": { + "version": "2.12.0", + "resolved": "https://registry.npmjs.org/@walletconnect/utils/-/utils-2.12.0.tgz", + "integrity": "sha512-GIpfHUe1Bjp1Tjda0SkJEizKOT2biuv7VPFnKsOLT1T+8QxEP9NruC+K2UUEvijS1Qr/LKH9P5004RYNgrch+w==", "license": "Apache-2.0", "dependencies": { - "@walletconnect/modal-core": "2.6.2", - "lit": "2.8.0", - "motion": "10.16.2", - "qrcode": "1.5.3" + "@stablelib/chacha20poly1305": "1.0.1", + "@stablelib/hkdf": "1.0.1", + "@stablelib/random": "^1.0.2", + "@stablelib/sha256": "1.0.1", + "@stablelib/x25519": "^1.0.3", + "@walletconnect/relay-api": "^1.0.9", + "@walletconnect/safe-json": "^1.0.2", + "@walletconnect/time": "^1.0.2", + "@walletconnect/types": "2.12.0", + "@walletconnect/window-getters": "^1.0.1", + "@walletconnect/window-metadata": "^1.0.1", + "detect-browser": "5.3.0", + "query-string": "7.1.3", + "uint8arrays": "^3.1.0" } }, - "node_modules/@web3modal/ethers5/node_modules/@walletconnect/sign-client": { - "version": "2.16.1", - "resolved": "https://registry.npmjs.org/@walletconnect/sign-client/-/sign-client-2.16.1.tgz", - "integrity": "sha512-s2Tx2n2duxt+sHtuWXrN9yZVaHaYqcEcjwlTD+55/vs5NUPlISf+fFmZLwSeX1kUlrSBrAuxPUcqQuRTKcjLOA==", + "node_modules/@web3modal/scaffold/node_modules/@web3modal/common": { + "version": "5.0.11", + "resolved": "https://registry.npmjs.org/@web3modal/common/-/common-5.0.11.tgz", + "integrity": "sha512-xI6FKrk4/TofM27e0R5F0e7OWMa0YECJshITgFVrX57ZPbgw0O8bTTgLa0yxYG3A5xMnuz6dOYjAAQV+EXrr9w==", "license": "Apache-2.0", "dependencies": { - "@walletconnect/core": "2.16.1", - "@walletconnect/events": "1.0.1", - "@walletconnect/heartbeat": "1.2.2", - "@walletconnect/jsonrpc-utils": "1.0.8", - "@walletconnect/logger": "2.1.2", - "@walletconnect/time": "1.0.2", - "@walletconnect/types": "2.16.1", - "@walletconnect/utils": "2.16.1", - "events": "3.3.0" + "bignumber.js": "9.1.2", + "dayjs": "1.11.10" } }, - "node_modules/@web3modal/ethers5/node_modules/@walletconnect/types": { - "version": "2.16.1", - "resolved": "https://registry.npmjs.org/@walletconnect/types/-/types-2.16.1.tgz", - "integrity": "sha512-9P4RG4VoDEF+yBF/n2TF12gsvT/aTaeZTVDb/AOayafqiPnmrQZMKmNCJJjq1sfdsDcHXFcZWMGsuCeSJCmrXA==", + "node_modules/@web3modal/scaffold/node_modules/@web3modal/core": { + "version": "5.0.11", + "resolved": "https://registry.npmjs.org/@web3modal/core/-/core-5.0.11.tgz", + "integrity": "sha512-YX5msOOEmB0HYwdDt3sF8JCMyTfkzCV9tMWPMQqBdFT8p+9lPaW4JCmqYwJMI9AhUiPpZWc6ubFit62+OzBAQQ==", + "deprecated": "Web3Modal is now Reown AppKit. Please follow the upgrade guide at https://docs.reown.com/appkit/upgrade/from-w3m-to-reown", "license": "Apache-2.0", "dependencies": { - "@walletconnect/events": "1.0.1", - "@walletconnect/heartbeat": "1.2.2", - "@walletconnect/jsonrpc-types": "1.0.4", - "@walletconnect/keyvaluestorage": "1.1.1", - "@walletconnect/logger": "2.1.2", - "events": "3.3.0" + "@web3modal/common": "5.0.11", + "@web3modal/wallet": "5.0.11", + "valtio": "1.11.2" } }, - "node_modules/@web3modal/ethers5/node_modules/@walletconnect/universal-provider": { - "version": "2.16.1", - "resolved": "https://registry.npmjs.org/@walletconnect/universal-provider/-/universal-provider-2.16.1.tgz", - "integrity": "sha512-q/tyWUVNenizuClEiaekx9FZj/STU1F3wpDK4PUIh3xh+OmUI5fw2dY3MaNDjyb5AyrS0M8BuQDeuoSuOR/Q7w==", + "node_modules/@web3modal/scaffold/node_modules/@web3modal/polyfills": { + "version": "5.0.11", + "resolved": "https://registry.npmjs.org/@web3modal/polyfills/-/polyfills-5.0.11.tgz", + "integrity": "sha512-F2pC4egFTwlGyyK6PuW1lEJwdl1NK+9AfiO9aiR58RXzj4uFStPuO4wzOGONz+5Kv8lM1ZiooRD0pMcJmsyzLw==", "license": "Apache-2.0", "dependencies": { - "@walletconnect/jsonrpc-http-connection": "1.0.8", - "@walletconnect/jsonrpc-provider": "1.0.14", - "@walletconnect/jsonrpc-types": "1.0.4", - "@walletconnect/jsonrpc-utils": "1.0.8", - "@walletconnect/logger": "2.1.2", - "@walletconnect/sign-client": "2.16.1", - "@walletconnect/types": "2.16.1", - "@walletconnect/utils": "2.16.1", - "events": "3.3.0" + "buffer": "6.0.3" } }, - "node_modules/@web3modal/ethers5/node_modules/@walletconnect/utils": { - "version": "2.16.1", - "resolved": "https://registry.npmjs.org/@walletconnect/utils/-/utils-2.16.1.tgz", - "integrity": "sha512-aoQirVoDoiiEtYeYDtNtQxFzwO/oCrz9zqeEEXYJaAwXlGVTS34KFe7W3/Rxd/pldTYKFOZsku2EzpISfH8Wsw==", + "node_modules/@web3modal/scaffold/node_modules/@web3modal/scaffold-ui": { + "version": "5.0.11", + "resolved": "https://registry.npmjs.org/@web3modal/scaffold-ui/-/scaffold-ui-5.0.11.tgz", + "integrity": "sha512-QHi980YGjFW335VVLQ9lQasH347xrdHomtvU1P1jXGg3wygDRs57rGRy6kK2yiLJomom02YGI+H1Tl8JvnAtZg==", "license": "Apache-2.0", "dependencies": { - "@stablelib/chacha20poly1305": "1.0.1", - "@stablelib/hkdf": "1.0.1", - "@stablelib/random": "1.0.2", - "@stablelib/sha256": "1.0.1", - "@stablelib/x25519": "1.0.3", - "@walletconnect/relay-api": "1.0.11", - "@walletconnect/relay-auth": "1.0.4", - "@walletconnect/safe-json": "1.0.2", - "@walletconnect/time": "1.0.2", - "@walletconnect/types": "2.16.1", - "@walletconnect/window-getters": "1.0.1", - "@walletconnect/window-metadata": "1.0.1", - "detect-browser": "5.3.0", - "elliptic": "^6.5.7", - "query-string": "7.1.3", - "uint8arrays": "3.1.0" + "@web3modal/common": "5.0.11", + "@web3modal/core": "5.0.11", + "@web3modal/scaffold-utils": "5.0.11", + "@web3modal/siwe": "5.0.11", + "@web3modal/ui": "5.0.11", + "@web3modal/wallet": "5.0.11", + "lit": "3.1.0" } }, - "node_modules/@web3modal/ethers5/node_modules/bn.js": { - "version": "4.12.1", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.1.tgz", - "integrity": "sha512-k8TVBiPkPJT9uHLdOKfFpqcfprwBFOAAXXozRubr7R7PfIuKvQlzcI4M0pALeqXN09vdaMbUdUj+pass+uULAg==", - "license": "MIT" - }, - "node_modules/@web3modal/ethers5/node_modules/elliptic": { - "version": "6.6.1", - "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.6.1.tgz", - "integrity": "sha512-RaddvvMatK2LJHqFJ+YA4WysVN5Ita9E35botqIYspQ4TkRAlCicdzKOjlyv/1Za5RyTNn7di//eEV0uTAfe3g==", - "license": "MIT", + "node_modules/@web3modal/scaffold/node_modules/@web3modal/scaffold-utils": { + "version": "5.0.11", + "resolved": "https://registry.npmjs.org/@web3modal/scaffold-utils/-/scaffold-utils-5.0.11.tgz", + "integrity": "sha512-3/fEndFBX9tNf/OpbE8zny9XRbGPlKojDlrkhz6ygcF2Dx0458ykpB342OtZPs3CjnPnZKRuo+H2y11KFo1IdQ==", + "license": "Apache-2.0", "dependencies": { - "bn.js": "^4.11.9", - "brorand": "^1.1.0", - "hash.js": "^1.0.0", - "hmac-drbg": "^1.0.1", - "inherits": "^2.0.4", - "minimalistic-assert": "^1.0.1", - "minimalistic-crypto-utils": "^1.0.1" + "@coinbase/wallet-sdk": "4.0.3", + "@web3modal/core": "5.0.11", + "@web3modal/polyfills": "5.0.11", + "@web3modal/wallet": "5.0.11", + "valtio": "1.11.2" } }, - "node_modules/@web3modal/polyfills": { - "version": "5.1.11", - "resolved": "https://registry.npmjs.org/@web3modal/polyfills/-/polyfills-5.1.11.tgz", - "integrity": "sha512-BDIDYA2LGTCquahbZ+wyWQy4IBOPeKVSgt4ZpFir1fnVJUPkEluSwZStcKLtCzQvxJgER1sLicUrjJQHF36TOg==", + "node_modules/@web3modal/scaffold/node_modules/@web3modal/siwe": { + "version": "5.0.11", + "resolved": "https://registry.npmjs.org/@web3modal/siwe/-/siwe-5.0.11.tgz", + "integrity": "sha512-dQZFxhoyphINz2H6Y/t8/zalErulV46NGk+U2z7Hq6H5c8XKBC4dCIDFem62+kDk07QKgg3lG+sUlf4ZU4YgRA==", + "deprecated": "Web3Modal is now Reown AppKit. Please follow the upgrade guide at https://docs.reown.com/appkit/upgrade/from-w3m-to-reown", "license": "Apache-2.0", "dependencies": { - "buffer": "6.0.3" + "@walletconnect/utils": "2.12.0", + "@web3modal/common": "5.0.11", + "@web3modal/core": "5.0.11", + "@web3modal/scaffold-utils": "5.0.11", + "@web3modal/ui": "5.0.11", + "@web3modal/wallet": "5.0.11", + "lit": "3.1.0", + "valtio": "1.11.2" } }, - "node_modules/@web3modal/scaffold-ui": { - "version": "5.1.11", - "resolved": "https://registry.npmjs.org/@web3modal/scaffold-ui/-/scaffold-ui-5.1.11.tgz", - "integrity": "sha512-fBqzd7DStUaEjtdbEU86rzY4XIgt8c8JN8oxS/xnUEopmjFYvBLCCVEfbTkZyJrRvAAphz7+oS4TVzXw9k6t5A==", + "node_modules/@web3modal/scaffold/node_modules/@web3modal/ui": { + "version": "5.0.11", + "resolved": "https://registry.npmjs.org/@web3modal/ui/-/ui-5.0.11.tgz", + "integrity": "sha512-Tm5SU7GGymvTgqRBCqMYl/I6Kou8hOLdYVhQIfghFEGd/TH0kTdAdjH30a65n/sxTmW3LC/CoflC6FCGP0TOcA==", + "deprecated": "Web3Modal is now Reown AppKit. Please follow the upgrade guide at https://docs.reown.com/appkit/upgrade/from-w3m-to-reown", "license": "Apache-2.0", "dependencies": { - "@web3modal/common": "5.1.11", - "@web3modal/core": "5.1.11", - "@web3modal/scaffold-utils": "5.1.11", - "@web3modal/siwe": "5.1.11", - "@web3modal/ui": "5.1.11", - "@web3modal/wallet": "5.1.11", - "lit": "3.1.0" + "lit": "3.1.0", + "qrcode": "1.5.3" } }, - "node_modules/@web3modal/scaffold-ui/node_modules/@lit/reactive-element": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/@lit/reactive-element/-/reactive-element-2.0.4.tgz", - "integrity": "sha512-GFn91inaUa2oHLak8awSIigYz0cU0Payr1rcFsrkf5OJ5eSPxElyZfKh0f2p9FsTiZWXQdWGJeXZICEfXXYSXQ==", - "license": "BSD-3-Clause", + "node_modules/@web3modal/scaffold/node_modules/@web3modal/wallet": { + "version": "5.0.11", + "resolved": "https://registry.npmjs.org/@web3modal/wallet/-/wallet-5.0.11.tgz", + "integrity": "sha512-8lsDCfsJS23UXllVyg9uB/RIWi+2k/g3hc4QN8Z9HGVhJREjk/cNc7e+mWWI077PDsplXAjnw3sK864O12v7Xg==", + "license": "Apache-2.0", "dependencies": { - "@lit-labs/ssr-dom-shim": "^1.2.0" + "@walletconnect/logger": "2.1.2", + "@web3modal/common": "5.0.11", + "@web3modal/polyfills": "5.0.11", + "zod": "3.22.4" } }, - "node_modules/@web3modal/scaffold-ui/node_modules/lit": { + "node_modules/@web3modal/scaffold/node_modules/lit": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/lit/-/lit-3.1.0.tgz", "integrity": "sha512-rzo/hmUqX8zmOdamDAeydfjsGXbbdtAFqMhmocnh2j9aDYqbu0fjXygjCa0T99Od9VQ/2itwaGrjZz/ZELVl7w==", @@ -5595,7 +5497,7 @@ "lit-html": "^3.1.0" } }, - "node_modules/@web3modal/scaffold-ui/node_modules/lit-element": { + "node_modules/@web3modal/scaffold/node_modules/lit-element": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/lit-element/-/lit-element-4.1.1.tgz", "integrity": "sha512-HO9Tkkh34QkTeUmEdNYhMT8hzLid7YlMlATSi1q4q17HE5d9mrrEHJ/o8O2D0cMi182zK1F3v7x0PWFjrhXFew==", @@ -5606,7 +5508,7 @@ "lit-html": "^3.2.0" } }, - "node_modules/@web3modal/scaffold-ui/node_modules/lit-html": { + "node_modules/@web3modal/scaffold/node_modules/lit-html": { "version": "3.2.1", "resolved": "https://registry.npmjs.org/lit-html/-/lit-html-3.2.1.tgz", "integrity": "sha512-qI/3lziaPMSKsrwlxH/xMgikhQ0EGOX2ICU73Bi/YHFvz2j/yMCIrw4+puF2IpQ4+upd3EWbvnHM9+PnJn48YA==", @@ -5615,197 +5517,11 @@ "@types/trusted-types": "^2.0.2" } }, - "node_modules/@web3modal/scaffold-utils": { - "version": "5.1.11", - "resolved": "https://registry.npmjs.org/@web3modal/scaffold-utils/-/scaffold-utils-5.1.11.tgz", - "integrity": "sha512-4bcYpQ3oxak5mDZMW5/7ayrhpaJHy6dCfUio15AGPHnQlFjkqcfSuuG0Io8Oj8VUXcK2UBLch9YiEDz4Xgce9Q==", - "license": "Apache-2.0", - "dependencies": { - "@web3modal/common": "5.1.11", - "@web3modal/core": "5.1.11", - "@web3modal/polyfills": "5.1.11", - "@web3modal/wallet": "5.1.11", - "valtio": "1.11.2" - } - }, - "node_modules/@web3modal/siwe": { - "version": "5.1.11", - "resolved": "https://registry.npmjs.org/@web3modal/siwe/-/siwe-5.1.11.tgz", - "integrity": "sha512-1aKEtMosACyY0SRjHjdcA/g3bRtMojTxlK7S/T6zBk57X/P3xcEZq9J8UM73plmGewjZdLaqGMgv6B/k/WleZQ==", - "deprecated": "Web3Modal is now Reown AppKit. Please follow the upgrade guide at https://docs.reown.com/appkit/upgrade/from-w3m-to-reown", - "license": "Apache-2.0", - "dependencies": { - "@walletconnect/utils": "2.16.1", - "@web3modal/common": "5.1.11", - "@web3modal/core": "5.1.11", - "@web3modal/scaffold-utils": "5.1.11", - "@web3modal/ui": "5.1.11", - "@web3modal/wallet": "5.1.11", - "lit": "3.1.0", - "valtio": "1.11.2" - } - }, - "node_modules/@web3modal/siwe/node_modules/@lit/reactive-element": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/@lit/reactive-element/-/reactive-element-2.0.4.tgz", - "integrity": "sha512-GFn91inaUa2oHLak8awSIigYz0cU0Payr1rcFsrkf5OJ5eSPxElyZfKh0f2p9FsTiZWXQdWGJeXZICEfXXYSXQ==", - "license": "BSD-3-Clause", - "dependencies": { - "@lit-labs/ssr-dom-shim": "^1.2.0" - } - }, - "node_modules/@web3modal/siwe/node_modules/@walletconnect/types": { - "version": "2.16.1", - "resolved": "https://registry.npmjs.org/@walletconnect/types/-/types-2.16.1.tgz", - "integrity": "sha512-9P4RG4VoDEF+yBF/n2TF12gsvT/aTaeZTVDb/AOayafqiPnmrQZMKmNCJJjq1sfdsDcHXFcZWMGsuCeSJCmrXA==", - "license": "Apache-2.0", - "dependencies": { - "@walletconnect/events": "1.0.1", - "@walletconnect/heartbeat": "1.2.2", - "@walletconnect/jsonrpc-types": "1.0.4", - "@walletconnect/keyvaluestorage": "1.1.1", - "@walletconnect/logger": "2.1.2", - "events": "3.3.0" - } - }, - "node_modules/@web3modal/siwe/node_modules/@walletconnect/utils": { - "version": "2.16.1", - "resolved": "https://registry.npmjs.org/@walletconnect/utils/-/utils-2.16.1.tgz", - "integrity": "sha512-aoQirVoDoiiEtYeYDtNtQxFzwO/oCrz9zqeEEXYJaAwXlGVTS34KFe7W3/Rxd/pldTYKFOZsku2EzpISfH8Wsw==", - "license": "Apache-2.0", - "dependencies": { - "@stablelib/chacha20poly1305": "1.0.1", - "@stablelib/hkdf": "1.0.1", - "@stablelib/random": "1.0.2", - "@stablelib/sha256": "1.0.1", - "@stablelib/x25519": "1.0.3", - "@walletconnect/relay-api": "1.0.11", - "@walletconnect/relay-auth": "1.0.4", - "@walletconnect/safe-json": "1.0.2", - "@walletconnect/time": "1.0.2", - "@walletconnect/types": "2.16.1", - "@walletconnect/window-getters": "1.0.1", - "@walletconnect/window-metadata": "1.0.1", - "detect-browser": "5.3.0", - "elliptic": "^6.5.7", - "query-string": "7.1.3", - "uint8arrays": "3.1.0" - } - }, - "node_modules/@web3modal/siwe/node_modules/bn.js": { - "version": "4.12.1", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.1.tgz", - "integrity": "sha512-k8TVBiPkPJT9uHLdOKfFpqcfprwBFOAAXXozRubr7R7PfIuKvQlzcI4M0pALeqXN09vdaMbUdUj+pass+uULAg==", - "license": "MIT" - }, - "node_modules/@web3modal/siwe/node_modules/elliptic": { - "version": "6.6.1", - "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.6.1.tgz", - "integrity": "sha512-RaddvvMatK2LJHqFJ+YA4WysVN5Ita9E35botqIYspQ4TkRAlCicdzKOjlyv/1Za5RyTNn7di//eEV0uTAfe3g==", - "license": "MIT", - "dependencies": { - "bn.js": "^4.11.9", - "brorand": "^1.1.0", - "hash.js": "^1.0.0", - "hmac-drbg": "^1.0.1", - "inherits": "^2.0.4", - "minimalistic-assert": "^1.0.1", - "minimalistic-crypto-utils": "^1.0.1" - } - }, - "node_modules/@web3modal/siwe/node_modules/lit": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/lit/-/lit-3.1.0.tgz", - "integrity": "sha512-rzo/hmUqX8zmOdamDAeydfjsGXbbdtAFqMhmocnh2j9aDYqbu0fjXygjCa0T99Od9VQ/2itwaGrjZz/ZELVl7w==", - "license": "BSD-3-Clause", - "dependencies": { - "@lit/reactive-element": "^2.0.0", - "lit-element": "^4.0.0", - "lit-html": "^3.1.0" - } - }, - "node_modules/@web3modal/siwe/node_modules/lit-element": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/lit-element/-/lit-element-4.1.1.tgz", - "integrity": "sha512-HO9Tkkh34QkTeUmEdNYhMT8hzLid7YlMlATSi1q4q17HE5d9mrrEHJ/o8O2D0cMi182zK1F3v7x0PWFjrhXFew==", - "license": "BSD-3-Clause", - "dependencies": { - "@lit-labs/ssr-dom-shim": "^1.2.0", - "@lit/reactive-element": "^2.0.4", - "lit-html": "^3.2.0" - } - }, - "node_modules/@web3modal/siwe/node_modules/lit-html": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/lit-html/-/lit-html-3.2.1.tgz", - "integrity": "sha512-qI/3lziaPMSKsrwlxH/xMgikhQ0EGOX2ICU73Bi/YHFvz2j/yMCIrw4+puF2IpQ4+upd3EWbvnHM9+PnJn48YA==", - "license": "BSD-3-Clause", - "dependencies": { - "@types/trusted-types": "^2.0.2" - } - }, - "node_modules/@web3modal/ui": { - "version": "5.1.11", - "resolved": "https://registry.npmjs.org/@web3modal/ui/-/ui-5.1.11.tgz", - "integrity": "sha512-L0L+2YOK+ONx+W7GPtkSdKZuAQ8cjcS5N8kp+WZzKOMUTeDLuXKtSnES4p/ShOVmkpV6qB8r0pPA9xgFh1D3ow==", - "deprecated": "Web3Modal is now Reown AppKit. Please follow the upgrade guide at https://docs.reown.com/appkit/upgrade/from-w3m-to-reown", - "license": "Apache-2.0", - "dependencies": { - "lit": "3.1.0", - "qrcode": "1.5.3" - } - }, - "node_modules/@web3modal/ui/node_modules/@lit/reactive-element": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/@lit/reactive-element/-/reactive-element-2.0.4.tgz", - "integrity": "sha512-GFn91inaUa2oHLak8awSIigYz0cU0Payr1rcFsrkf5OJ5eSPxElyZfKh0f2p9FsTiZWXQdWGJeXZICEfXXYSXQ==", - "license": "BSD-3-Clause", - "dependencies": { - "@lit-labs/ssr-dom-shim": "^1.2.0" - } - }, - "node_modules/@web3modal/ui/node_modules/lit": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/lit/-/lit-3.1.0.tgz", - "integrity": "sha512-rzo/hmUqX8zmOdamDAeydfjsGXbbdtAFqMhmocnh2j9aDYqbu0fjXygjCa0T99Od9VQ/2itwaGrjZz/ZELVl7w==", - "license": "BSD-3-Clause", - "dependencies": { - "@lit/reactive-element": "^2.0.0", - "lit-element": "^4.0.0", - "lit-html": "^3.1.0" - } - }, - "node_modules/@web3modal/ui/node_modules/lit-element": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/lit-element/-/lit-element-4.1.1.tgz", - "integrity": "sha512-HO9Tkkh34QkTeUmEdNYhMT8hzLid7YlMlATSi1q4q17HE5d9mrrEHJ/o8O2D0cMi182zK1F3v7x0PWFjrhXFew==", - "license": "BSD-3-Clause", - "dependencies": { - "@lit-labs/ssr-dom-shim": "^1.2.0", - "@lit/reactive-element": "^2.0.4", - "lit-html": "^3.2.0" - } - }, - "node_modules/@web3modal/ui/node_modules/lit-html": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/lit-html/-/lit-html-3.2.1.tgz", - "integrity": "sha512-qI/3lziaPMSKsrwlxH/xMgikhQ0EGOX2ICU73Bi/YHFvz2j/yMCIrw4+puF2IpQ4+upd3EWbvnHM9+PnJn48YA==", - "license": "BSD-3-Clause", - "dependencies": { - "@types/trusted-types": "^2.0.2" - } - }, - "node_modules/@web3modal/wallet": { - "version": "5.1.11", - "resolved": "https://registry.npmjs.org/@web3modal/wallet/-/wallet-5.1.11.tgz", - "integrity": "sha512-/ooQZXK1h7LGBUemebldYPAV2oJAgxkgSiCMoHWynhuS0LO3BzhOhGL+jV19w4iU81bS1GSNFTxYT9LL6Scesw==", - "license": "Apache-2.0", - "dependencies": { - "@walletconnect/logger": "2.1.2", - "@web3modal/common": "5.1.11", - "@web3modal/polyfills": "5.1.11", - "zod": "3.22.4" - } + "node_modules/@web3modal/scaffold/node_modules/tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", + "license": "0BSD" }, "node_modules/abitype": { "version": "1.0.8", @@ -6131,13 +5847,6 @@ "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", "license": "MIT" }, - "node_modules/base-x": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/base-x/-/base-x-4.0.0.tgz", - "integrity": "sha512-FuwxlW4H5kh37X/oW59pwTzzTKRzfrrQwhmyspRM7swOEZcHtDZSCt45U6oKgtuFE+WYPblePMVIPR4RZrh/hw==", - "license": "MIT", - "optional": true - }, "node_modules/base64-js": { "version": "1.5.1", "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", @@ -6281,38 +5990,6 @@ "@popperjs/core": "^2.11.8" } }, - "node_modules/borsh": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/borsh/-/borsh-0.7.0.tgz", - "integrity": "sha512-CLCsZGIBCFnPtkNnieW/a8wmreDmfUtjU2m9yHrzPXIlNbqVs0AQrSatSG6vdNYUqdc83tkQi2eHfF98ubzQLA==", - "license": "Apache-2.0", - "optional": true, - "dependencies": { - "bn.js": "^5.2.0", - "bs58": "^4.0.0", - "text-encoding-utf-8": "^1.0.2" - } - }, - "node_modules/borsh/node_modules/base-x": { - "version": "3.0.10", - "resolved": "https://registry.npmjs.org/base-x/-/base-x-3.0.10.tgz", - "integrity": "sha512-7d0s06rR9rYaIWHkpfLIFICM/tkSVdoPC9qYAQRpxn9DdKNWNsKC0uk++akckyLq16Tx2WIinnZ6WRriAt6njQ==", - "license": "MIT", - "optional": true, - "dependencies": { - "safe-buffer": "^5.0.1" - } - }, - "node_modules/borsh/node_modules/bs58": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/bs58/-/bs58-4.0.1.tgz", - "integrity": "sha512-Ok3Wdf5vOIlBrgCvTq96gBkJw+JUEzdBgyaza5HLtPm7yTHkjRy8+JzNyHF7BHa0bNWOQIp3m5YF0nnFcOIKLw==", - "license": "MIT", - "optional": true, - "dependencies": { - "base-x": "^3.0.2" - } - }, "node_modules/bowser": { "version": "2.11.0", "resolved": "https://registry.npmjs.org/bowser/-/bowser-2.11.0.tgz", @@ -6655,16 +6332,6 @@ "node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7" } }, - "node_modules/bs58": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/bs58/-/bs58-5.0.0.tgz", - "integrity": "sha512-r+ihvQJvahgYT50JD05dyJNKlmmSlMoOGwn1lCcEzanPglg7TxYjioQUYehQ9mAR/+hOSd2jRc/Z2y5UxBymvQ==", - "license": "MIT", - "optional": true, - "dependencies": { - "base-x": "^4.0.0" - } - }, "node_modules/buffer": { "version": "6.0.3", "resolved": "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz", @@ -9486,6 +9153,16 @@ "node": ">=10" } }, + "node_modules/isomorphic-unfetch": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/isomorphic-unfetch/-/isomorphic-unfetch-3.1.0.tgz", + "integrity": "sha512-geDJjpoZ8N0kWexiwkX8F9NkTsXhetLPVbZFQ+JTW239QNOwvB0gniuR1Wc6f0AMTn7/mFGyXvHTifrCp/GH8Q==", + "license": "MIT", + "dependencies": { + "node-fetch": "^2.6.1", + "unfetch": "^4.2.0" + } + }, "node_modules/isows": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/isows/-/isows-1.0.6.tgz", @@ -13314,12 +12991,6 @@ "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", "license": "MIT" }, - "node_modules/text-encoding-utf-8": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/text-encoding-utf-8/-/text-encoding-utf-8-1.0.2.tgz", - "integrity": "sha512-8bw4MY9WjdsD2aMtO0OzOCY3pXGYNx2d2FfHRVUKkiCPDWjKuOlhLVASS+pD7VkLTVjW268LYJHwsnPFlBpbAg==", - "optional": true - }, "node_modules/thenify": { "version": "3.3.1", "resolved": "https://registry.npmjs.org/thenify/-/thenify-3.3.1.tgz", @@ -13801,6 +13472,12 @@ "optional": true, "peer": true }, + "node_modules/unfetch": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/unfetch/-/unfetch-4.2.0.tgz", + "integrity": "sha512-F9p7yYCn6cIW9El1zi0HI6vqpeIvBsr3dSuRO6Xuppb1u5rXpCPmMvLSyECLhybr9isec8Ohl0hPekMVrEinDA==", + "license": "MIT" + }, "node_modules/universalify": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", @@ -14617,12 +14294,6 @@ "integrity": "sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==", "license": "ISC" }, - "node_modules/yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", - "license": "ISC" - }, "node_modules/yaml": { "version": "2.7.0", "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.7.0.tgz", @@ -14745,7 +14416,7 @@ }, "packages/create-invoice-form": { "name": "@requestnetwork/create-invoice-form", - "version": "0.12.4", + "version": "0.13.0", "license": "MIT", "dependencies": { "@requestnetwork/data-format": "0.19.9", @@ -14806,7 +14477,7 @@ "@requestnetwork/payment-processor": "0.56.0", "@requestnetwork/request-client.js": "0.58.0", "@requestnetwork/web3-signature": "0.8.9", - "@web3modal/ethers5": "^5.0.11", + "@web3modal/ethers5": "5.0.11", "ethers": "^5.7.2", "vite-plugin-node-polyfills": "^0.22.0" }, @@ -14827,6 +14498,429 @@ "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0" } }, + "packages/payment-widget/node_modules/@coinbase/wallet-sdk": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/@coinbase/wallet-sdk/-/wallet-sdk-4.0.3.tgz", + "integrity": "sha512-y/OGEjlvosikjfB+wk+4CVb9OxD1ob9cidEBLI5h8Hxaf/Qoob2XoVT1uvhtAzBx34KpGYSd+alKvh/GCRre4Q==", + "license": "Apache-2.0", + "dependencies": { + "buffer": "^6.0.3", + "clsx": "^1.2.1", + "eventemitter3": "^5.0.1", + "keccak": "^3.0.3", + "preact": "^10.16.0", + "sha.js": "^2.4.11" + } + }, + "packages/payment-widget/node_modules/@lit/reactive-element": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/@lit/reactive-element/-/reactive-element-2.0.4.tgz", + "integrity": "sha512-GFn91inaUa2oHLak8awSIigYz0cU0Payr1rcFsrkf5OJ5eSPxElyZfKh0f2p9FsTiZWXQdWGJeXZICEfXXYSXQ==", + "license": "BSD-3-Clause", + "dependencies": { + "@lit-labs/ssr-dom-shim": "^1.2.0" + } + }, + "packages/payment-widget/node_modules/@walletconnect/core": { + "version": "2.14.0", + "resolved": "https://registry.npmjs.org/@walletconnect/core/-/core-2.14.0.tgz", + "integrity": "sha512-E/dgBM9q3judXnTfZQ5ILvDpeSdDpabBLsXtYXa3Nyc26cfNplfLJ2nXm9FgtTdhM1nZ7yx4+zDPiXawBRZl2g==", + "license": "Apache-2.0", + "dependencies": { + "@walletconnect/heartbeat": "1.2.2", + "@walletconnect/jsonrpc-provider": "1.0.14", + "@walletconnect/jsonrpc-types": "1.0.4", + "@walletconnect/jsonrpc-utils": "1.0.8", + "@walletconnect/jsonrpc-ws-connection": "1.0.14", + "@walletconnect/keyvaluestorage": "1.1.1", + "@walletconnect/logger": "2.1.2", + "@walletconnect/relay-api": "1.0.10", + "@walletconnect/relay-auth": "1.0.4", + "@walletconnect/safe-json": "1.0.2", + "@walletconnect/time": "1.0.2", + "@walletconnect/types": "2.14.0", + "@walletconnect/utils": "2.14.0", + "events": "3.3.0", + "isomorphic-unfetch": "3.1.0", + "lodash.isequal": "4.5.0", + "uint8arrays": "3.1.0" + } + }, + "packages/payment-widget/node_modules/@walletconnect/ethereum-provider": { + "version": "2.14.0", + "resolved": "https://registry.npmjs.org/@walletconnect/ethereum-provider/-/ethereum-provider-2.14.0.tgz", + "integrity": "sha512-Cc2/DCn85VciA10BrsNWFM//3VC1D8yjwrjfUKjGndLPDz0YIdAxTgYZViIlMjE0lzQC/DMvPYEAnGfW0O1Bwg==", + "license": "Apache-2.0", + "dependencies": { + "@walletconnect/jsonrpc-http-connection": "1.0.8", + "@walletconnect/jsonrpc-provider": "1.0.14", + "@walletconnect/jsonrpc-types": "1.0.4", + "@walletconnect/jsonrpc-utils": "1.0.8", + "@walletconnect/modal": "2.6.2", + "@walletconnect/sign-client": "2.14.0", + "@walletconnect/types": "2.14.0", + "@walletconnect/universal-provider": "2.14.0", + "@walletconnect/utils": "2.14.0", + "events": "3.3.0" + } + }, + "packages/payment-widget/node_modules/@walletconnect/modal": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/@walletconnect/modal/-/modal-2.6.2.tgz", + "integrity": "sha512-eFopgKi8AjKf/0U4SemvcYw9zlLpx9njVN8sf6DAkowC2Md0gPU/UNEbH1Wwj407pEKnEds98pKWib1NN1ACoA==", + "license": "Apache-2.0", + "dependencies": { + "@walletconnect/modal-core": "2.6.2", + "@walletconnect/modal-ui": "2.6.2" + } + }, + "packages/payment-widget/node_modules/@walletconnect/modal-core": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/@walletconnect/modal-core/-/modal-core-2.6.2.tgz", + "integrity": "sha512-cv8ibvdOJQv2B+nyxP9IIFdxvQznMz8OOr/oR/AaUZym4hjXNL/l1a2UlSQBXrVjo3xxbouMxLb3kBsHoYP2CA==", + "license": "Apache-2.0", + "dependencies": { + "valtio": "1.11.2" + } + }, + "packages/payment-widget/node_modules/@walletconnect/modal-ui": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/@walletconnect/modal-ui/-/modal-ui-2.6.2.tgz", + "integrity": "sha512-rbdstM1HPGvr7jprQkyPggX7rP4XiCG85ZA+zWBEX0dVQg8PpAgRUqpeub4xQKDgY7pY/xLRXSiCVdWGqvG2HA==", + "license": "Apache-2.0", + "dependencies": { + "@walletconnect/modal-core": "2.6.2", + "lit": "2.8.0", + "motion": "10.16.2", + "qrcode": "1.5.3" + } + }, + "packages/payment-widget/node_modules/@walletconnect/relay-api": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/@walletconnect/relay-api/-/relay-api-1.0.10.tgz", + "integrity": "sha512-tqrdd4zU9VBNqUaXXQASaexklv6A54yEyQQEXYOCr+Jz8Ket0dmPBDyg19LVSNUN2cipAghQc45/KVmfFJ0cYw==", + "license": "MIT", + "dependencies": { + "@walletconnect/jsonrpc-types": "^1.0.2" + } + }, + "packages/payment-widget/node_modules/@walletconnect/sign-client": { + "version": "2.14.0", + "resolved": "https://registry.npmjs.org/@walletconnect/sign-client/-/sign-client-2.14.0.tgz", + "integrity": "sha512-UrB3S3eLjPYfBLCN3WJ5u7+WcZ8kFMe/QIDqLf76Jk6TaLwkSUy563LvnSw4KW/kA+/cY1KBSdUDfX1tzYJJXg==", + "license": "Apache-2.0", + "dependencies": { + "@walletconnect/core": "2.14.0", + "@walletconnect/events": "1.0.1", + "@walletconnect/heartbeat": "1.2.2", + "@walletconnect/jsonrpc-utils": "1.0.8", + "@walletconnect/logger": "2.1.2", + "@walletconnect/time": "1.0.2", + "@walletconnect/types": "2.14.0", + "@walletconnect/utils": "2.14.0", + "events": "3.3.0" + } + }, + "packages/payment-widget/node_modules/@walletconnect/types": { + "version": "2.14.0", + "resolved": "https://registry.npmjs.org/@walletconnect/types/-/types-2.14.0.tgz", + "integrity": "sha512-vevMi4jZLJ55vLuFOicQFmBBbLyb+S0sZS4IsaBdZkQflfGIq34HkN13c/KPl4Ye0aoR4/cUcUSitmGIzEQM5g==", + "license": "Apache-2.0", + "dependencies": { + "@walletconnect/events": "1.0.1", + "@walletconnect/heartbeat": "1.2.2", + "@walletconnect/jsonrpc-types": "1.0.4", + "@walletconnect/keyvaluestorage": "1.1.1", + "@walletconnect/logger": "2.1.2", + "events": "3.3.0" + } + }, + "packages/payment-widget/node_modules/@walletconnect/universal-provider": { + "version": "2.14.0", + "resolved": "https://registry.npmjs.org/@walletconnect/universal-provider/-/universal-provider-2.14.0.tgz", + "integrity": "sha512-Mr8uoTmD6H0+Hh+3gxBu4l3T2uP/nNPR02sVtwEujNum++F727mMk+ifPRIpkVo21V/bvXFEy8sHTs5hqyq5iA==", + "license": "Apache-2.0", + "dependencies": { + "@walletconnect/jsonrpc-http-connection": "1.0.8", + "@walletconnect/jsonrpc-provider": "1.0.14", + "@walletconnect/jsonrpc-types": "1.0.4", + "@walletconnect/jsonrpc-utils": "1.0.8", + "@walletconnect/logger": "2.1.2", + "@walletconnect/sign-client": "2.14.0", + "@walletconnect/types": "2.14.0", + "@walletconnect/utils": "2.14.0", + "events": "3.3.0" + } + }, + "packages/payment-widget/node_modules/@walletconnect/utils": { + "version": "2.14.0", + "resolved": "https://registry.npmjs.org/@walletconnect/utils/-/utils-2.14.0.tgz", + "integrity": "sha512-vRVomYQEtEAyCK2c5bzzEvtgxaGGITF8mWuIL+WYSAMyEJLY97mirP2urDucNwcUczwxUgI+no9RiNFbUHreQQ==", + "license": "Apache-2.0", + "dependencies": { + "@stablelib/chacha20poly1305": "1.0.1", + "@stablelib/hkdf": "1.0.1", + "@stablelib/random": "1.0.2", + "@stablelib/sha256": "1.0.1", + "@stablelib/x25519": "1.0.3", + "@walletconnect/relay-api": "1.0.10", + "@walletconnect/safe-json": "1.0.2", + "@walletconnect/time": "1.0.2", + "@walletconnect/types": "2.14.0", + "@walletconnect/window-getters": "1.0.1", + "@walletconnect/window-metadata": "1.0.1", + "detect-browser": "5.3.0", + "query-string": "7.1.3", + "uint8arrays": "3.1.0" + } + }, + "packages/payment-widget/node_modules/@web3modal/common": { + "version": "5.0.11", + "resolved": "https://registry.npmjs.org/@web3modal/common/-/common-5.0.11.tgz", + "integrity": "sha512-xI6FKrk4/TofM27e0R5F0e7OWMa0YECJshITgFVrX57ZPbgw0O8bTTgLa0yxYG3A5xMnuz6dOYjAAQV+EXrr9w==", + "license": "Apache-2.0", + "dependencies": { + "bignumber.js": "9.1.2", + "dayjs": "1.11.10" + } + }, + "packages/payment-widget/node_modules/@web3modal/core": { + "version": "5.0.11", + "resolved": "https://registry.npmjs.org/@web3modal/core/-/core-5.0.11.tgz", + "integrity": "sha512-YX5msOOEmB0HYwdDt3sF8JCMyTfkzCV9tMWPMQqBdFT8p+9lPaW4JCmqYwJMI9AhUiPpZWc6ubFit62+OzBAQQ==", + "deprecated": "Web3Modal is now Reown AppKit. Please follow the upgrade guide at https://docs.reown.com/appkit/upgrade/from-w3m-to-reown", + "license": "Apache-2.0", + "dependencies": { + "@web3modal/common": "5.0.11", + "@web3modal/wallet": "5.0.11", + "valtio": "1.11.2" + } + }, + "packages/payment-widget/node_modules/@web3modal/ethers5": { + "version": "5.0.11", + "resolved": "https://registry.npmjs.org/@web3modal/ethers5/-/ethers5-5.0.11.tgz", + "integrity": "sha512-fwMow5sZsxOZlbjQqn3vZUo2E4hHWq4c9NsFuIuQgjZjCkVqJwj8b6wWFObLFydZJgRrh+qyHSmds9c4i/n6fg==", + "deprecated": "Web3Modal is now Reown AppKit. Please follow the upgrade guide at https://docs.reown.com/appkit/upgrade/from-w3m-to-reown", + "license": "Apache-2.0", + "dependencies": { + "@coinbase/wallet-sdk": "4.0.3", + "@walletconnect/ethereum-provider": "2.14.0", + "@walletconnect/utils": "2.14.0", + "@web3modal/common": "5.0.11", + "@web3modal/polyfills": "5.0.11", + "@web3modal/scaffold": "5.0.11", + "@web3modal/scaffold-react": "5.0.11", + "@web3modal/scaffold-utils": "5.0.11", + "@web3modal/scaffold-vue": "5.0.11", + "@web3modal/siwe": "5.0.11", + "valtio": "1.11.2" + }, + "peerDependencies": { + "ethers": ">=4.1.0 <6.0.0", + "react": ">=17", + "react-dom": ">=17", + "vue": ">=3" + }, + "peerDependenciesMeta": { + "react": { + "optional": true + }, + "react-dom": { + "optional": true + }, + "vue": { + "optional": true + } + } + }, + "packages/payment-widget/node_modules/@web3modal/ethers5/node_modules/@web3modal/scaffold-react": { + "version": "5.0.11", + "resolved": "https://registry.npmjs.org/@web3modal/scaffold-react/-/scaffold-react-5.0.11.tgz", + "integrity": "sha512-zJJY9WsIUDnPvdJ91FpkUM8YORq4dsWF74hbMBGSwKzkHcJg1PmGWBz2+iKfkR6pr/0FRUYlxkqS4MzrEaGItQ==", + "license": "Apache-2.0", + "dependencies": { + "@web3modal/scaffold": "5.0.11" + }, + "peerDependencies": { + "react": ">=17", + "react-dom": ">=17" + }, + "peerDependenciesMeta": { + "react": { + "optional": true + }, + "react-dom": { + "optional": true + } + } + }, + "packages/payment-widget/node_modules/@web3modal/polyfills": { + "version": "5.0.11", + "resolved": "https://registry.npmjs.org/@web3modal/polyfills/-/polyfills-5.0.11.tgz", + "integrity": "sha512-F2pC4egFTwlGyyK6PuW1lEJwdl1NK+9AfiO9aiR58RXzj4uFStPuO4wzOGONz+5Kv8lM1ZiooRD0pMcJmsyzLw==", + "license": "Apache-2.0", + "dependencies": { + "buffer": "6.0.3" + } + }, + "packages/payment-widget/node_modules/@web3modal/scaffold-utils": { + "version": "5.0.11", + "resolved": "https://registry.npmjs.org/@web3modal/scaffold-utils/-/scaffold-utils-5.0.11.tgz", + "integrity": "sha512-3/fEndFBX9tNf/OpbE8zny9XRbGPlKojDlrkhz6ygcF2Dx0458ykpB342OtZPs3CjnPnZKRuo+H2y11KFo1IdQ==", + "license": "Apache-2.0", + "dependencies": { + "@coinbase/wallet-sdk": "4.0.3", + "@web3modal/core": "5.0.11", + "@web3modal/polyfills": "5.0.11", + "@web3modal/wallet": "5.0.11", + "valtio": "1.11.2" + } + }, + "packages/payment-widget/node_modules/@web3modal/siwe": { + "version": "5.0.11", + "resolved": "https://registry.npmjs.org/@web3modal/siwe/-/siwe-5.0.11.tgz", + "integrity": "sha512-dQZFxhoyphINz2H6Y/t8/zalErulV46NGk+U2z7Hq6H5c8XKBC4dCIDFem62+kDk07QKgg3lG+sUlf4ZU4YgRA==", + "deprecated": "Web3Modal is now Reown AppKit. Please follow the upgrade guide at https://docs.reown.com/appkit/upgrade/from-w3m-to-reown", + "license": "Apache-2.0", + "dependencies": { + "@walletconnect/utils": "2.12.0", + "@web3modal/common": "5.0.11", + "@web3modal/core": "5.0.11", + "@web3modal/scaffold-utils": "5.0.11", + "@web3modal/ui": "5.0.11", + "@web3modal/wallet": "5.0.11", + "lit": "3.1.0", + "valtio": "1.11.2" + } + }, + "packages/payment-widget/node_modules/@web3modal/siwe/node_modules/@walletconnect/heartbeat": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@walletconnect/heartbeat/-/heartbeat-1.2.1.tgz", + "integrity": "sha512-yVzws616xsDLJxuG/28FqtZ5rzrTA4gUjdEMTbWB5Y8V1XHRmqq4efAxCw5ie7WjbXFSUyBHaWlMR+2/CpQC5Q==", + "license": "MIT", + "dependencies": { + "@walletconnect/events": "^1.0.1", + "@walletconnect/time": "^1.0.2", + "tslib": "1.14.1" + } + }, + "packages/payment-widget/node_modules/@web3modal/siwe/node_modules/@walletconnect/jsonrpc-types": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/@walletconnect/jsonrpc-types/-/jsonrpc-types-1.0.3.tgz", + "integrity": "sha512-iIQ8hboBl3o5ufmJ8cuduGad0CQm3ZlsHtujv9Eu16xq89q+BG7Nh5VLxxUgmtpnrePgFkTwXirCTkwJH1v+Yw==", + "license": "MIT", + "dependencies": { + "keyvaluestorage-interface": "^1.0.0", + "tslib": "1.14.1" + } + }, + "packages/payment-widget/node_modules/@web3modal/siwe/node_modules/@walletconnect/types": { + "version": "2.12.0", + "resolved": "https://registry.npmjs.org/@walletconnect/types/-/types-2.12.0.tgz", + "integrity": "sha512-uhB3waGmujQVJcPgJvGOpB8RalgYSBT+HpmVbfl4Qe0xJyqpRUo4bPjQa0UYkrHaW20xIw94OuP4+FMLYdeemg==", + "license": "Apache-2.0", + "dependencies": { + "@walletconnect/events": "^1.0.1", + "@walletconnect/heartbeat": "1.2.1", + "@walletconnect/jsonrpc-types": "1.0.3", + "@walletconnect/keyvaluestorage": "^1.1.1", + "@walletconnect/logger": "^2.0.1", + "events": "^3.3.0" + } + }, + "packages/payment-widget/node_modules/@web3modal/siwe/node_modules/@walletconnect/utils": { + "version": "2.12.0", + "resolved": "https://registry.npmjs.org/@walletconnect/utils/-/utils-2.12.0.tgz", + "integrity": "sha512-GIpfHUe1Bjp1Tjda0SkJEizKOT2biuv7VPFnKsOLT1T+8QxEP9NruC+K2UUEvijS1Qr/LKH9P5004RYNgrch+w==", + "license": "Apache-2.0", + "dependencies": { + "@stablelib/chacha20poly1305": "1.0.1", + "@stablelib/hkdf": "1.0.1", + "@stablelib/random": "^1.0.2", + "@stablelib/sha256": "1.0.1", + "@stablelib/x25519": "^1.0.3", + "@walletconnect/relay-api": "^1.0.9", + "@walletconnect/safe-json": "^1.0.2", + "@walletconnect/time": "^1.0.2", + "@walletconnect/types": "2.12.0", + "@walletconnect/window-getters": "^1.0.1", + "@walletconnect/window-metadata": "^1.0.1", + "detect-browser": "5.3.0", + "query-string": "7.1.3", + "uint8arrays": "^3.1.0" + } + }, + "packages/payment-widget/node_modules/@web3modal/siwe/node_modules/lit": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/lit/-/lit-3.1.0.tgz", + "integrity": "sha512-rzo/hmUqX8zmOdamDAeydfjsGXbbdtAFqMhmocnh2j9aDYqbu0fjXygjCa0T99Od9VQ/2itwaGrjZz/ZELVl7w==", + "license": "BSD-3-Clause", + "dependencies": { + "@lit/reactive-element": "^2.0.0", + "lit-element": "^4.0.0", + "lit-html": "^3.1.0" + } + }, + "packages/payment-widget/node_modules/@web3modal/ui": { + "version": "5.0.11", + "resolved": "https://registry.npmjs.org/@web3modal/ui/-/ui-5.0.11.tgz", + "integrity": "sha512-Tm5SU7GGymvTgqRBCqMYl/I6Kou8hOLdYVhQIfghFEGd/TH0kTdAdjH30a65n/sxTmW3LC/CoflC6FCGP0TOcA==", + "deprecated": "Web3Modal is now Reown AppKit. Please follow the upgrade guide at https://docs.reown.com/appkit/upgrade/from-w3m-to-reown", + "license": "Apache-2.0", + "dependencies": { + "lit": "3.1.0", + "qrcode": "1.5.3" + } + }, + "packages/payment-widget/node_modules/@web3modal/ui/node_modules/lit": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/lit/-/lit-3.1.0.tgz", + "integrity": "sha512-rzo/hmUqX8zmOdamDAeydfjsGXbbdtAFqMhmocnh2j9aDYqbu0fjXygjCa0T99Od9VQ/2itwaGrjZz/ZELVl7w==", + "license": "BSD-3-Clause", + "dependencies": { + "@lit/reactive-element": "^2.0.0", + "lit-element": "^4.0.0", + "lit-html": "^3.1.0" + } + }, + "packages/payment-widget/node_modules/@web3modal/wallet": { + "version": "5.0.11", + "resolved": "https://registry.npmjs.org/@web3modal/wallet/-/wallet-5.0.11.tgz", + "integrity": "sha512-8lsDCfsJS23UXllVyg9uB/RIWi+2k/g3hc4QN8Z9HGVhJREjk/cNc7e+mWWI077PDsplXAjnw3sK864O12v7Xg==", + "license": "Apache-2.0", + "dependencies": { + "@walletconnect/logger": "2.1.2", + "@web3modal/common": "5.0.11", + "@web3modal/polyfills": "5.0.11", + "zod": "3.22.4" + } + }, + "packages/payment-widget/node_modules/lit-element": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/lit-element/-/lit-element-4.1.1.tgz", + "integrity": "sha512-HO9Tkkh34QkTeUmEdNYhMT8hzLid7YlMlATSi1q4q17HE5d9mrrEHJ/o8O2D0cMi182zK1F3v7x0PWFjrhXFew==", + "license": "BSD-3-Clause", + "dependencies": { + "@lit-labs/ssr-dom-shim": "^1.2.0", + "@lit/reactive-element": "^2.0.4", + "lit-html": "^3.2.0" + } + }, + "packages/payment-widget/node_modules/lit-html": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/lit-html/-/lit-html-3.2.1.tgz", + "integrity": "sha512-qI/3lziaPMSKsrwlxH/xMgikhQ0EGOX2ICU73Bi/YHFvz2j/yMCIrw4+puF2IpQ4+upd3EWbvnHM9+PnJn48YA==", + "license": "BSD-3-Clause", + "dependencies": { + "@types/trusted-types": "^2.0.2" + } + }, + "packages/payment-widget/node_modules/tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", + "license": "0BSD" + }, "packages/single-invoice": { "name": "@requestnetwork/single-invoice", "version": "0.1.3", diff --git a/packages/payment-widget/package.json b/packages/payment-widget/package.json index 082fc04c..4a5591bf 100644 --- a/packages/payment-widget/package.json +++ b/packages/payment-widget/package.json @@ -59,7 +59,7 @@ "@requestnetwork/payment-processor": "0.56.0", "@requestnetwork/request-client.js": "0.58.0", "@requestnetwork/web3-signature": "0.8.9", - "@web3modal/ethers5": "^5.0.11", + "@web3modal/ethers5": "5.0.11", "ethers": "^5.7.2", "vite-plugin-node-polyfills": "^0.22.0" } From 96655a944f94a31f9633c4f1d0e2a8bd39cbc1a6 Mon Sep 17 00:00:00 2001 From: sstefdev Date: Wed, 26 Feb 2025 13:37:15 +0100 Subject: [PATCH 05/19] fix: node out of space error --- .github/workflows/build.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ffc80a2f..a821802b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -17,13 +17,15 @@ jobs: uses: actions/checkout@v4 - name: Setup Node.js - uses: actions/setup-node@v4 + uses: actions/setup-node@v3 with: - node-version: '18' - cache: 'npm' + node-version: "18" + cache: "npm" - name: Install dependencies run: npm ci - name: Build + env: + NODE_OPTIONS: "--max-old-space-size=8192" run: npm run build From 0432bd84cf543815ea18e67b5b3199b83ec9f9f6 Mon Sep 17 00:00:00 2001 From: MantisClone Date: Thu, 27 Feb 2025 16:23:13 -0500 Subject: [PATCH 06/19] fix: revert downgrade of actions/setup-node back to v4 instead of v3 --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a821802b..762dc83e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -17,7 +17,7 @@ jobs: uses: actions/checkout@v4 - name: Setup Node.js - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: "18" cache: "npm" From e06d530edbd299685a4986c41ef9395b4380bd1f Mon Sep 17 00:00:00 2001 From: MantisClone Date: Thu, 27 Feb 2025 16:23:43 -0500 Subject: [PATCH 07/19] fix: Set container to 8g memory. Adjust max_old_space_size=7680 * 7680 so we leave enough of the memory for other processes --- .github/workflows/build.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 762dc83e..579842ea 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -12,6 +12,9 @@ concurrency: jobs: build: runs-on: ubuntu-latest + container: + image: node:18 + options: --memory=8g steps: - name: Checkout uses: actions/checkout@v4 @@ -27,5 +30,5 @@ jobs: - name: Build env: - NODE_OPTIONS: "--max-old-space-size=8192" + NODE_OPTIONS: "--max-old-space-size=7680" run: npm run build From 1e3fc9c05966871cdeae6baa29b3e1183e85959e Mon Sep 17 00:00:00 2001 From: MantisClone Date: Thu, 27 Feb 2025 17:38:31 -0500 Subject: [PATCH 08/19] fix: partial revert - undefiner build container in github action --- .github/workflows/build.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 579842ea..210870b6 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -12,9 +12,6 @@ concurrency: jobs: build: runs-on: ubuntu-latest - container: - image: node:18 - options: --memory=8g steps: - name: Checkout uses: actions/checkout@v4 From b0624a0d2aa609873c83e3aa7568dd3d99d2c0fd Mon Sep 17 00:00:00 2001 From: MantisClone Date: Thu, 27 Feb 2025 17:39:49 -0500 Subject: [PATCH 09/19] fix: set max_old_space_size=7680 when building locally too --- .github/workflows/build.yml | 2 +- package.json | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 210870b6..c499bcc0 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -27,5 +27,5 @@ jobs: - name: Build env: - NODE_OPTIONS: "--max-old-space-size=7680" + NODE_OPTIONS: "--max-old-space-size=7680" # 8 GB - 512 MB for OS run: npm run build diff --git a/package.json b/package.json index 1dd12142..4f7b9f0b 100644 --- a/package.json +++ b/package.json @@ -10,11 +10,11 @@ ], "scripts": { "test": "echo \"Error: no test specified\" && exit 1", - "build": "turbo run build", + "build": "NODE_OPTIONS=--max_old_space_size=7680 turbo run build", "build:form": "turbo run build --filter=@requestnetwork/create-invoice-form", "build:dashboard": "turbo run build --filter=@requestnetwork/invoice-dashboard", "build:stakeholder": "turbo run build --filter=@requestnetwork/add-stakeholder", - "build:payment-widget": "turbo run build --filter=@requestnetwork/payment-widget", + "build:payment-widget": "NODE_OPTIONS=--max_old_space_size=7680 turbo run build --filter=@requestnetwork/payment-widget", "build:single-invoice": "turbo run build --filter=@requestnetwork/single-invoice", "clean": "npm run clean:dist && npm run clean:sveltekit", "clean:dist": "find . -path ./node_modules -prune -o -name 'dist' -type d -exec rm -rf '{}' + -exec echo '{}' deleted \\;", From d7c0440e91fa73aec8c56a205da63b0f30ad59b8 Mon Sep 17 00:00:00 2001 From: MantisClone Date: Thu, 27 Feb 2025 17:40:20 -0500 Subject: [PATCH 10/19] chore: move turbo clean script under clean instead of deep-clean --- package.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 4f7b9f0b..f45eabdf 100644 --- a/package.json +++ b/package.json @@ -16,11 +16,11 @@ "build:stakeholder": "turbo run build --filter=@requestnetwork/add-stakeholder", "build:payment-widget": "NODE_OPTIONS=--max_old_space_size=7680 turbo run build --filter=@requestnetwork/payment-widget", "build:single-invoice": "turbo run build --filter=@requestnetwork/single-invoice", - "clean": "npm run clean:dist && npm run clean:sveltekit", + "clean": "npm run clean:dist && npm run clean:sveltekit && npm run clean:turbo", "clean:dist": "find . -path ./node_modules -prune -o -name 'dist' -type d -exec rm -rf '{}' + -exec echo '{}' deleted \\;", "clean:sveltekit": "find . -name '.svelte-kit' -type d -exec rm -rf '{}' + -exec echo '{}' deleted \\;", - "deep-clean": "npm run clean && npm run deep-clean:turbo && npm run deep-clean:node-modules", - "deep-clean:turbo": "find . -name '.turbo' -type d -exec rm -rf '{}' + -exec echo '{}' deleted \\;", + "clean:turbo": "find . -name '.turbo' -type d -exec rm -rf '{}' + -exec echo '{}' deleted \\;", + "deep-clean": "npm run clean && npm run deep-clean:node-modules", "deep-clean:node-modules": "find . -name 'node_modules' -type d -exec rm -rf '{}' + -exec echo '{}' deleted \\;", "link:react": "npm link $npm_config_app_path/node_modules/react $npm_config_app_path/node_modules/react-dom", "link:all": "npm run link:react --app-path=$npm_config_app_path && for d in packages/*; do (cd $d && npm link); done", From 72d023b50dff23b464e3ab2830b0e327c1060641 Mon Sep 17 00:00:00 2001 From: MantisClone Date: Fri, 28 Feb 2025 15:13:00 -0500 Subject: [PATCH 11/19] fix: remove unused variable litSessionInitialized --- packages/invoice-dashboard/src/lib/view-requests.svelte | 3 --- packages/single-invoice/src/lib/single-invoice.svelte | 2 -- 2 files changed, 5 deletions(-) diff --git a/packages/invoice-dashboard/src/lib/view-requests.svelte b/packages/invoice-dashboard/src/lib/view-requests.svelte index 0e8736c6..7fb5385a 100644 --- a/packages/invoice-dashboard/src/lib/view-requests.svelte +++ b/packages/invoice-dashboard/src/lib/view-requests.svelte @@ -136,7 +136,6 @@ { value: "pending", checked: false }, ]; - let litSessionInitialized = false; let initializationAttempted = false; const handleWalletConnection = async () => { @@ -158,7 +157,6 @@ ) => { if (account?.address !== previousAccount?.address) { clearLitStorage(); - litSessionInitialized = false; initializationAttempted = false; if (account?.address) { await initializeLitSession(account); @@ -223,7 +221,6 @@ // Use the stored session key and signature to restore the session await cipherProvider.enableDecryption(true); sliderValueForDecryption = "on"; - litSessionInitialized = true; localStorage.setItem("isDecryptionEnabled", "true"); await getRequests(currentAccount, requestNetwork); return true; diff --git a/packages/single-invoice/src/lib/single-invoice.svelte b/packages/single-invoice/src/lib/single-invoice.svelte index 9bcced4a..9da5e7a4 100644 --- a/packages/single-invoice/src/lib/single-invoice.svelte +++ b/packages/single-invoice/src/lib/single-invoice.svelte @@ -124,7 +124,6 @@ localStorage?.getItem("isDecryptionEnabled") ?? "false" ); - let litSessionInitialized = false; let initializationAttempted = false; $: cipherProvider = requestNetwork?.getCipherProvider() as CipherProvider; @@ -240,7 +239,6 @@ try { // Use the stored session key and signature to restore the session await cipherProvider.enableDecryption(true); - litSessionInitialized = true; localStorage.setItem("isDecryptionEnabled", "true"); console.log("Lit session restored successfully."); return true; From cf04e296f2314628c704fdd5f54d886abb084a7b Mon Sep 17 00:00:00 2001 From: MantisClone Date: Fri, 28 Feb 2025 15:35:59 -0500 Subject: [PATCH 12/19] fix: remove unused debouncedUpdate varaible --- packages/invoice-dashboard/src/lib/view-requests.svelte | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/invoice-dashboard/src/lib/view-requests.svelte b/packages/invoice-dashboard/src/lib/view-requests.svelte index 7fb5385a..6c89a136 100644 --- a/packages/invoice-dashboard/src/lib/view-requests.svelte +++ b/packages/invoice-dashboard/src/lib/view-requests.svelte @@ -87,7 +87,6 @@ let loading = false; let searchQuery = ""; - let debouncedUpdate: any; let isRequestPayed = false; let currentTab = "All"; let requests: Types.IRequestDataWithEvents[] | undefined = []; @@ -518,7 +517,7 @@ }; onMount(() => { - debouncedUpdate = debounce((value: string) => { + debounce((value: string) => { searchQuery = value.toLowerCase(); }, 500); }); From e7de39c869cc2ba0e875ff71fa2edab1ba433d86 Mon Sep 17 00:00:00 2001 From: MantisClone Date: Fri, 28 Feb 2025 15:55:27 -0500 Subject: [PATCH 13/19] Make view-requests log the same error as single-invoice --- packages/invoice-dashboard/src/lib/view-requests.svelte | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/invoice-dashboard/src/lib/view-requests.svelte b/packages/invoice-dashboard/src/lib/view-requests.svelte index 6c89a136..8ccb606a 100644 --- a/packages/invoice-dashboard/src/lib/view-requests.svelte +++ b/packages/invoice-dashboard/src/lib/view-requests.svelte @@ -200,8 +200,12 @@ const initializeLitSession = async ( currentAccount: GetAccountReturnType | undefined ) => { - if (!currentAccount?.address || !cipherProvider || initializationAttempted) + if (!currentAccount?.address || !cipherProvider || initializationAttempted) { + console.error( + "Initialization skipped: Missing account, cipherProvider, or already attempted." + ); return; + } initializationAttempted = true; From b3af3613e8426909bf1ed07beeac8c206bce6326 Mon Sep 17 00:00:00 2001 From: MantisClone Date: Fri, 28 Feb 2025 16:00:55 -0500 Subject: [PATCH 14/19] fix: try to make requests load upon wallet connect, per edits by claude --- .../src/lib/view-requests.svelte | 22 +++++++++++++------ 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/packages/invoice-dashboard/src/lib/view-requests.svelte b/packages/invoice-dashboard/src/lib/view-requests.svelte index 8ccb606a..e1cfec7d 100644 --- a/packages/invoice-dashboard/src/lib/view-requests.svelte +++ b/packages/invoice-dashboard/src/lib/view-requests.svelte @@ -139,7 +139,10 @@ const handleWalletConnection = async () => { account = getAccount(wagmiConfig); - await loadRequests(sliderValueForDecryption, account, requestNetwork); + if (account?.address) { + await initializeLitSession(account); + await loadRequests(sliderValueForDecryption, account, requestNetwork); + } }; const handleWalletDisconnection = () => { @@ -159,6 +162,7 @@ initializationAttempted = false; if (account?.address) { await initializeLitSession(account); + await loadRequests(sliderValueForDecryption, account, requestNetwork); } } }; @@ -166,8 +170,10 @@ onMount(async () => { try { currencyManager = await initializeCurrencyManager(); + account = getAccount(wagmiConfig); if (account?.address) { await initializeLitSession(account); + await loadRequests(sliderValueForDecryption, account, requestNetwork); } } catch (error) { console.error("Failed to initialize:", error); @@ -193,6 +199,9 @@ $: { signer = account?.address; + if (signer && requestNetwork && !loading && !requests?.length) { + loadRequests(sliderValueForDecryption, account, requestNetwork); + } } $: isRequestPayed, getOneRequest(activeRequest); @@ -562,8 +571,7 @@ currentAccount: GetAccountReturnType | undefined, currentRequestNetwork: RequestNetwork | undefined | null ) => { - if (!currentAccount?.address || !currentRequestNetwork || !cipherProvider) - return; + if (!currentAccount?.address || !currentRequestNetwork) return; loading = true; const previousNetworks = [...selectedNetworks]; // Store current selection @@ -590,6 +598,7 @@ } catch (error) { console.error("Failed to enable decryption:", error); toast.error("Failed to enable decryption."); + sliderValueForDecryption = "off"; return; } finally { loadSessionSignatures = false; @@ -603,15 +612,14 @@ } await getRequests(currentAccount, currentRequestNetwork); selectedNetworks = previousNetworks; // Restore selection + } catch (error) { + console.error("Error loading requests:", error); + toast.error("Failed to load requests"); } finally { loading = false; } - await getRequests(currentAccount, currentRequestNetwork); - loading = false; }; - $: loadRequests(sliderValueForDecryption, account, requestNetwork); - const handleNetworkSelection = async (networks: string[]) => { selectedNetworks = networks; currentPage = 1; From 7de94b58ba6ca2837c7f545efe4766169e64fca5 Mon Sep 17 00:00:00 2001 From: MantisClone Date: Fri, 28 Feb 2025 17:52:37 -0500 Subject: [PATCH 15/19] fix: load unencrypted requests after initial wallet connection Changes to invoice-dashboard/src/lib/view-requests.svelte 1. **Added Request Network Polling Mechanism**: - Implemented a `waitForRequestNetwork` function that actively polls for the `requestNetwork` object to become available - Added configurable retry attempts (MAX_RETRY_ATTEMPTS = 10) and interval (RETRY_INTERVAL = 500ms) - The function returns a Promise that resolves to true if requestNetwork becomes available or false after max retries 2. **Enhanced Wallet Connection Handling**: - Modified `handleWalletConnection` to wait for requestNetwork availability before proceeding - Added clear error handling and user notifications when requestNetwork isn't available - Improved logic to prevent unnecessary reinitialization when connections are already established 3. **Added Proper Wallet Disconnection Handling**: - Implemented a robust `handleWalletDisconnection` function to clean up all wallet-related state - Properly resets account, requests, and other user-specific data - Cleans up Lit Protocol session data and disconnects any active providers - Called during manual disconnections, account changes, and component destruction 4. **Improved Wallet Change Handler**: - Updated `handleWalletChange` to use the new wallet disconnection function - Added more robust error handling around network operations - Simplified the code flow by extracting common clean-up tasks 5. **Enhanced Component Lifecycle Management**: - Added proper cleanup on component destruction via `onDestroy` hook - Improved component initialization with better error handling and logging - Added a delay during component mounting to allow dependencies to initialize properly 6. **Added JSDoc-style Documentation**: - Added detailed function documentation for key functions - Improved code readability with clear purpose statements for complex functions - Documented parameters and return values where applicable 7. **Added Reactive Network Change Detection**: - Added monitoring for changes in the requestNetwork object availability - Implemented a reactive block to detect when requestNetwork changes from null to defined - Added debug logging throughout the connection flow 8. **Fixed Race Condition**: - Resolved the race condition where wallet connections could occur before requestNetwork was ready - The retry mechanism ensures requests are loaded once both the account and requestNetwork are available 9. **Implemented Debugging Utilities**: - Added a `debugState` function to output component state for troubleshooting - Enhanced console logging throughout the component for better traceability These changes collectively create a more robust solution that properly handles initialization order issues, cleans up resources appropriately, and provides better error reporting when things go wrong. The component now gracefully handles the situation where a wallet connects before the Request Network is fully initialized. --- .../src/lib/view-requests.svelte | 373 ++++++++++++++++-- 1 file changed, 331 insertions(+), 42 deletions(-) diff --git a/packages/invoice-dashboard/src/lib/view-requests.svelte b/packages/invoice-dashboard/src/lib/view-requests.svelte index e1cfec7d..96c7b99b 100644 --- a/packages/invoice-dashboard/src/lib/view-requests.svelte +++ b/packages/invoice-dashboard/src/lib/view-requests.svelte @@ -137,53 +137,247 @@ let initializationAttempted = false; + // Track initialization state + let initialized = false; + let previousAddress: `0x${string}` | undefined; + + // Add request network polling mechanism + let requestNetworkRetryAttempts = 0; + const MAX_RETRY_ATTEMPTS = 10; + const RETRY_INTERVAL = 500; // ms + + /** + * Polls for the requestNetwork object to become available + * Attempts multiple times with a delay between attempts + * @returns {Promise} True if requestNetwork is available, false if max retries exceeded + */ + const waitForRequestNetwork = async (): Promise => { + if (requestNetwork) { + console.log("RequestNetwork is already available"); + return true; + } + + return new Promise((resolve) => { + const checkRequestNetwork = () => { + requestNetworkRetryAttempts += 1; + console.log(`Checking for RequestNetwork (attempt ${requestNetworkRetryAttempts})`); + + if (requestNetwork) { + console.log("RequestNetwork is now available"); + resolve(true); + return; + } + + if (requestNetworkRetryAttempts >= MAX_RETRY_ATTEMPTS) { + console.error("Max retry attempts reached waiting for RequestNetwork"); + resolve(false); + return; + } + + setTimeout(checkRequestNetwork, RETRY_INTERVAL); + }; + + checkRequestNetwork(); + }); + }; + + /** + * Handles wallet connection and loads requests + * Waits for requestNetwork to be available before proceeding + */ const handleWalletConnection = async () => { - account = getAccount(wagmiConfig); - if (account?.address) { - await initializeLitSession(account); - await loadRequests(sliderValueForDecryption, account, requestNetwork); + const currentAccount = getAccount(wagmiConfig); + if (!currentAccount?.address) { + console.log("No account found during wallet connection"); + return; + } + + console.log("Wallet connected or changed:", currentAccount.address); + + // Wait for requestNetwork to become available + const isRequestNetworkAvailable = await waitForRequestNetwork(); + if (!isRequestNetworkAvailable) { + console.error("RequestNetwork not available after retries"); + toast.error("Failed to load requests", { + description: "Connection to Request Network failed" + }); + return; + } + + // Only proceed if this is a new connection or we don't have requests yet + if (previousAddress === currentAccount.address && initialized && requests?.length > 0) { + console.log("Already initialized with requests, skipping"); + return; + } + + previousAddress = currentAccount.address; + account = currentAccount; + + try { + loading = true; + + // Initialize currency manager if needed + if (!currencyManager) { + console.log("Initializing currency manager"); + currencyManager = await initializeCurrencyManager(); + } + + // Handle Lit Protocol initialization for encrypted requests + if (sliderValueForDecryption === "on") { + await initializeLitSession(currentAccount); + } else { + console.log("Skipping Lit initialization as decryption is off"); + initializationAttempted = true; + } + + console.log("Fetching requests"); + await getRequests(currentAccount, requestNetwork); + initialized = true; + } catch (error) { + console.error("Error during wallet connection handling:", error); + toast.error("Failed to load requests", { + description: error instanceof Error ? error.message : String(error) + }); + } finally { + loading = false; } }; + /** + * Handles wallet disconnection cleanup + * Resets all wallet-related state and clears storage + */ const handleWalletDisconnection = () => { + console.log("Handling wallet disconnection"); account = undefined; + previousAddress = undefined; requests = []; activeRequest = undefined; - cipherProvider?.disconnectWallet(); - cipherProvider = undefined; + initialized = false; + + // Clear Lit Protocol session data + clearLitStorage(); + + if (cipherProvider?.disconnectWallet) { + cipherProvider.disconnectWallet(); + } + + // Reset state + loading = false; + isRequestPayed = false; }; + /** + * Handles wallet account changes + * Clears session data and reloads requests with new account + */ const handleWalletChange = async ( - account: GetAccountReturnType, + newAccount: GetAccountReturnType, previousAccount: GetAccountReturnType ) => { - if (account?.address !== previousAccount?.address) { - clearLitStorage(); + console.log("Account change detected:", + newAccount?.address, + previousAccount?.address + ); + + if (newAccount?.address !== previousAccount?.address) { + // Handle disconnection if there's no new account + if (!newAccount?.address) { + handleWalletDisconnection(); + return; + } + + // Reset state for new account initializationAttempted = false; - if (account?.address) { - await initializeLitSession(account); - await loadRequests(sliderValueForDecryption, account, requestNetwork); + initialized = false; + previousAddress = undefined; + clearLitStorage(); + + loading = true; + try { + // Wait for requestNetwork to become available + const isRequestNetworkAvailable = await waitForRequestNetwork(); + if (!isRequestNetworkAvailable) { + console.error("RequestNetwork not available after retries"); + toast.error("Failed to load requests", { + description: "Connection to Request Network failed" + }); + return; + } + + // Setup account + account = newAccount; + previousAddress = newAccount.address; + + // Handle Lit Protocol initialization for encrypted requests + if (sliderValueForDecryption === "on") { + await initializeLitSession(newAccount); + } else { + console.log("Skipping Lit initialization as decryption is off"); + } + + await getRequests(newAccount, requestNetwork); + initialized = true; + } catch (error) { + console.error("Error during wallet change handling:", error); + } finally { + loading = false; } + } else if (account?.address) { + await handleWalletConnection(); + } else { + handleWalletDisconnection(); } }; + // Enhanced onMount with clearer initialization flow onMount(async () => { try { + console.log("Component mounting"); + + // Initialize currency manager first currencyManager = await initializeCurrencyManager(); - account = getAccount(wagmiConfig); - if (account?.address) { - await initializeLitSession(account); - await loadRequests(sliderValueForDecryption, account, requestNetwork); + console.log("Currency manager initialized"); + + // Check if account is already connected on mount + const currentAccount = getAccount(wagmiConfig); + if (currentAccount?.address) { + console.log("Account found on mount:", currentAccount.address); + + // Explicitly initialize and load requests with a slight delay to ensure + // the component is fully mounted and all services are ready + setTimeout(async () => { + try { + account = currentAccount; + previousAddress = currentAccount.address; + + // Skip Lit initialization if decryption is off + if (sliderValueForDecryption === "on" && !initializationAttempted) { + await initializeLitSession(currentAccount); + } + + // Always try to load requests if we have an account and requestNetwork + if (requestNetwork) { + await getRequests(currentAccount, requestNetwork); + initialized = true; + } else { + console.error("RequestNetwork not available during mount initialization"); + } + } catch (initError) { + console.error("Error during initialization:", initError); + } + }, 300); + } else { + console.log("No account connected on mount"); } } catch (error) { - console.error("Failed to initialize:", error); + console.error("Failed to initialize on mount:", error); } + // Set up account change watcher unwatchAccount = watchAccount(wagmiConfig, { - onChange( - account: GetAccountReturnType, - previousAccount: GetAccountReturnType - ) { + onChange(account, previousAccount) { + console.log("Watch account triggered:", account?.address); handleWalletChange(account, previousAccount); }, }); @@ -192,11 +386,50 @@ let unwatchAccount: WatchAccountReturnType | undefined; onDestroy(() => { - if (typeof unwatchAccount === "function") unwatchAccount(); + if (typeof unwatchAccount === "function") { + unwatchAccount(); + } + + // Clean up when component is destroyed + handleWalletDisconnection(); }); $: cipherProvider = requestNetwork?.getCipherProvider() as CipherProvider; + // Clean up repeated reactive logic with a single watcher for account changes + $: { + if (account?.address && requestNetwork && !loading) { + const isNewAccount = previousAddress !== account.address; + const hasNoRequests = !requests?.length; + + if (isNewAccount || hasNoRequests) { + console.log("Reactive detection triggered a request loading:", { + isNewAccount, + hasNoRequests, + address: account.address + }); + handleWalletConnection(); + } + } + } + + // Modified reactive statement to wait for requestNetwork + $: if (requestNetwork && account?.address && !loading && !requests?.length) { + console.log("RequestNetwork detected, loading requests"); + handleWalletConnection(); + } + + // Add this to actively monitor for changes in requestNetwork + $: if (requestNetwork && !previousRequestNetwork) { + console.log("requestNetwork changed from null to defined"); + previousRequestNetwork = requestNetwork; + if (account?.address && !loading && !requests?.length) { + console.log("RequestNetwork is now available with connected account, loading requests"); + handleWalletConnection(); + } + } + let previousRequestNetwork: RequestNetwork | null | undefined = null; + $: { signer = account?.address; if (signer && requestNetwork && !loading && !requests?.length) { @@ -206,6 +439,10 @@ $: isRequestPayed, getOneRequest(activeRequest); + /** + * Initializes Lit Protocol session for encrypted requests + * Attempts to restore existing session if available + */ const initializeLitSession = async ( currentAccount: GetAccountReturnType | undefined ) => { @@ -292,37 +529,66 @@ } }; + /** + * Fetches requests for the connected account + * Processes and formats the response data + */ const getRequests = async ( account: GetAccountReturnType, requestNetwork: RequestNetwork | undefined | null ) => { - if (!account?.address || !requestNetwork) return; + if (!account?.address) { + console.error("Cannot get requests: missing account address"); + return; + } + + if (!requestNetwork) { + console.error("Cannot get requests: missing requestNetwork"); + return; + } + loading = true; + console.log("Fetching requests for:", account.address); + try { - const data = await queryClient.fetchQuery({ - queryKey: getRequestsQueryKey(account.address, currentPage), - queryFn: () => - fetchRequests(account.address, currentPage, itemsPerPage), - }); + // Add explicit try/catch for the fetchQuery to better handle errors + try { + const data = await queryClient.fetchQuery({ + queryKey: getRequestsQueryKey(account.address, currentPage), + queryFn: () => fetchRequests(account.address, currentPage, itemsPerPage), + staleTime: 0, // Force a fresh fetch always + }); - if (data) { - requests = data.requests - ?.map((request) => request.getData()) - .sort((a, b) => b.timestamp - a.timestamp); - hasMoreRequests = data?.meta?.pagination?.hasMore || false; - } else { - requests = []; - hasMoreRequests = false; - } + if (data) { + console.log(`Found ${data.requests?.length || 0} requests`); + requests = data.requests + ?.map((request) => request.getData()) + .sort((a, b) => b.timestamp - a.timestamp); + hasMoreRequests = data?.meta?.pagination?.hasMore || false; + } else { + console.log("No requests data returned"); + requests = []; + hasMoreRequests = false; + } - if (hasMoreRequests) { - queryClient.prefetchQuery({ - queryKey: getRequestsQueryKey(account.address, currentPage + 1), - queryFn: () => - fetchRequests(account.address, currentPage + 1, itemsPerPage), + // Prefetch next page if available + if (hasMoreRequests) { + queryClient.prefetchQuery({ + queryKey: getRequestsQueryKey(account.address, currentPage + 1), + queryFn: () => + fetchRequests(account.address, currentPage + 1, itemsPerPage), + }); + } + } catch (queryError) { + console.error("Query error when fetching requests:", queryError); + toast.error("Error loading requests", { + description: queryError instanceof Error ? queryError.message : String(queryError) }); + requests = []; + hasMoreRequests = false; } + // Update network options based on fetched requests const uniqueNetworks = new Set(); requests?.forEach((request) => { const network = request.currencyInfo.network; @@ -337,6 +603,9 @@ })); } catch (error) { console.error("Failed to fetch requests:", error); + toast.error("Failed to load requests", { + description: error instanceof Error ? error.message : String(error), + }); } finally { loading = false; } @@ -610,6 +879,8 @@ cipherProvider?.enableDecryption(false); localStorage?.setItem("isDecryptionEnabled", JSON.stringify(false)); } + + // Always load requests regardless of decryption state await getRequests(currentAccount, currentRequestNetwork); selectedNetworks = previousNetworks; // Restore selection } catch (error) { @@ -642,6 +913,24 @@ selectedStatuses = statuses; currentPage = 1; }; + + // Add this debug function to help troubleshoot + const debugState = () => { + console.log("Current state:", { + address: account?.address, + initialized, + initializationAttempted, + hasRequests: requests?.length > 0, + isLoading: loading, + decryptionEnabled: sliderValueForDecryption === "on" + }); + }; + + $: { + if (signer && !loading) { + debugState(); + } + }
Date: Sat, 1 Mar 2025 07:22:03 -0500 Subject: [PATCH 16/19] refactor: rename var to litInitializationAttempted for clarity --- .../invoice-dashboard/src/lib/view-requests.svelte | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/packages/invoice-dashboard/src/lib/view-requests.svelte b/packages/invoice-dashboard/src/lib/view-requests.svelte index 96c7b99b..718114b6 100644 --- a/packages/invoice-dashboard/src/lib/view-requests.svelte +++ b/packages/invoice-dashboard/src/lib/view-requests.svelte @@ -135,7 +135,7 @@ { value: "pending", checked: false }, ]; - let initializationAttempted = false; + let litInitializationAttempted = false; // Track initialization state let initialized = false; @@ -227,7 +227,7 @@ await initializeLitSession(currentAccount); } else { console.log("Skipping Lit initialization as decryption is off"); - initializationAttempted = true; + litInitializationAttempted = true; } console.log("Fetching requests"); @@ -288,7 +288,7 @@ } // Reset state for new account - initializationAttempted = false; + litInitializationAttempted = false; initialized = false; previousAddress = undefined; clearLitStorage(); @@ -352,7 +352,7 @@ previousAddress = currentAccount.address; // Skip Lit initialization if decryption is off - if (sliderValueForDecryption === "on" && !initializationAttempted) { + if (sliderValueForDecryption === "on" && !litInitializationAttempted) { await initializeLitSession(currentAccount); } @@ -446,14 +446,14 @@ const initializeLitSession = async ( currentAccount: GetAccountReturnType | undefined ) => { - if (!currentAccount?.address || !cipherProvider || initializationAttempted) { + if (!currentAccount?.address || !cipherProvider || litInitializationAttempted) { console.error( "Initialization skipped: Missing account, cipherProvider, or already attempted." ); return; } - initializationAttempted = true; + litInitializationAttempted = true; try { const storedSig = localStorage?.getItem("lit-wallet-sig"); @@ -919,7 +919,7 @@ console.log("Current state:", { address: account?.address, initialized, - initializationAttempted, + litInitializationAttempted, hasRequests: requests?.length > 0, isLoading: loading, decryptionEnabled: sliderValueForDecryption === "on" From 3620394e2af3ad4b3c2dad17cc15a123f279e090 Mon Sep 17 00:00:00 2001 From: MantisClone Date: Sat, 1 Mar 2025 07:24:55 -0500 Subject: [PATCH 17/19] fix: remove unnecessary await calling cipherProvider.enableDecryption --- packages/invoice-dashboard/src/lib/view-requests.svelte | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/invoice-dashboard/src/lib/view-requests.svelte b/packages/invoice-dashboard/src/lib/view-requests.svelte index 718114b6..2baf1fa0 100644 --- a/packages/invoice-dashboard/src/lib/view-requests.svelte +++ b/packages/invoice-dashboard/src/lib/view-requests.svelte @@ -468,7 +468,7 @@ ) { try { // Use the stored session key and signature to restore the session - await cipherProvider.enableDecryption(true); + cipherProvider.enableDecryption(true); sliderValueForDecryption = "on"; localStorage.setItem("isDecryptionEnabled", "true"); await getRequests(currentAccount, requestNetwork); From d65b96388f3086b5a63cd2b45031941646c1d07c Mon Sep 17 00:00:00 2001 From: MantisClone Date: Sat, 1 Mar 2025 07:46:37 -0500 Subject: [PATCH 18/19] refactor: lit session handling 1. Renamed clearLitStorage to resetDecryptionState: - The original name only mentioned storage clearing, but the function also changes UI state and disables decryption in the provider. - The new name better reflects that this is a complete reset of the decryption system. 2. Enhanced Error Handling: - Added error handling around cipher provider operations which could fail. - Added try/catch blocks for localStorage operations which might fail in private browsing mode. - Added error logging with more descriptive messages. 3. Improved State Consistency: - Made sure UI state (sliderValueForDecryption) is always updated regardless of storage operations success. - Added consistency checks between local storage state and UI state. 4. Better Documentation: - Updated function documentation to clarify what each function does. - Added return type for initializeLitSession to make it clear it returns a success status. 5. Optimized Query Invalidation: - Only invalidate queries when the decryption state actually changes, not on every load. - Added checks to compare current state vs desired state before performing operations. 6. Better Error Messages and Logging: - Added more descriptive console logs for better debugging. - More specific error messages in catch blocks. --- .../src/lib/view-requests.svelte | 145 ++++++++++++------ 1 file changed, 95 insertions(+), 50 deletions(-) diff --git a/packages/invoice-dashboard/src/lib/view-requests.svelte b/packages/invoice-dashboard/src/lib/view-requests.svelte index 2baf1fa0..facf0276 100644 --- a/packages/invoice-dashboard/src/lib/view-requests.svelte +++ b/packages/invoice-dashboard/src/lib/view-requests.svelte @@ -243,6 +243,31 @@ } }; + /** + * Disables decryption capabilities, clears Lit Protocol session data, and resets UI state + */ + const resetDecryptionState = () => { + try { + localStorage?.removeItem("lit-wallet-sig"); + localStorage?.removeItem("lit-session-key"); + localStorage?.setItem("isDecryptionEnabled", "false"); + sliderValueForDecryption = "off"; + + if (cipherProvider) { + try { + cipherProvider.enableDecryption(false); + } catch (error) { + console.error("Error while disabling cipher provider decryption:", error); + // Continue execution even if this fails + } + } + } catch (storageError) { + console.error("Error while clearing storage:", storageError); + // We still want to update the UI state even if storage operations fail + sliderValueForDecryption = "off"; + } + }; + /** * Handles wallet disconnection cleanup * Resets all wallet-related state and clears storage @@ -255,11 +280,15 @@ activeRequest = undefined; initialized = false; - // Clear Lit Protocol session data - clearLitStorage(); + // Reset decryption state + resetDecryptionState(); if (cipherProvider?.disconnectWallet) { - cipherProvider.disconnectWallet(); + try { + cipherProvider.disconnectWallet(); + } catch (error) { + console.error("Error during cipher provider disconnection:", error); + } } // Reset state @@ -291,7 +320,7 @@ litInitializationAttempted = false; initialized = false; previousAddress = undefined; - clearLitStorage(); + resetDecryptionState(); loading = true; try { @@ -442,15 +471,24 @@ /** * Initializes Lit Protocol session for encrypted requests * Attempts to restore existing session if available + * @returns {Promise} Success status of the initialization */ const initializeLitSession = async ( currentAccount: GetAccountReturnType | undefined - ) => { - if (!currentAccount?.address || !cipherProvider || litInitializationAttempted) { - console.error( - "Initialization skipped: Missing account, cipherProvider, or already attempted." - ); - return; + ): Promise => { + if (!currentAccount?.address) { + console.error("Cannot initialize Lit session: Missing account address"); + return false; + } + + if (!cipherProvider) { + console.error("Cannot initialize Lit session: Missing cipher provider"); + return false; + } + + if (litInitializationAttempted) { + console.log("Lit initialization already attempted for this session"); + return false; } litInitializationAttempted = true; @@ -458,46 +496,41 @@ try { const storedSig = localStorage?.getItem("lit-wallet-sig"); const sessionKey = localStorage?.getItem("lit-session-key"); + const isEnabled = localStorage?.getItem("isDecryptionEnabled") === "true"; - if (storedSig && sessionKey) { - const parsedSig = JSON.parse(storedSig); + // If we have all necessary session data and they match the current account + if (storedSig && sessionKey && isEnabled) { + try { + const parsedSig = JSON.parse(storedSig); - if ( - parsedSig.address?.toLowerCase() === - currentAccount.address?.toLowerCase() - ) { - try { + if (parsedSig.address?.toLowerCase() === currentAccount.address?.toLowerCase()) { // Use the stored session key and signature to restore the session - cipherProvider.enableDecryption(true); + await cipherProvider.enableDecryption(true); sliderValueForDecryption = "on"; + + // Ensure our UI state reflects the storage state localStorage.setItem("isDecryptionEnabled", "true"); - await getRequests(currentAccount, requestNetwork); + + console.log("Successfully restored Lit session for account:", parsedSig.address); return true; - } catch (error) { - console.error("Failed to restore Lit session:", error); - clearLitStorage(); + } else { + console.log("Stored signature address doesn't match current account, resetting"); + resetDecryptionState(); } - } else { - clearLitStorage(); + } catch (sessionError) { + console.error("Failed to restore Lit session:", sessionError); + resetDecryptionState(); } + } else { + console.log("Incomplete session data, cannot restore Lit session"); } } catch (error) { console.error("Failed to initialize Lit session:", error); - clearLitStorage(); + resetDecryptionState(); } return false; }; - const clearLitStorage = () => { - localStorage?.removeItem("lit-wallet-sig"); - localStorage?.removeItem("lit-session-key"); - localStorage?.setItem("isDecryptionEnabled", "false"); - sliderValueForDecryption = "off"; - if (cipherProvider) { - cipherProvider.enableDecryption(false); - } - }; - const getRequestsQueryKey = (address: string, currentPage: number) => [ "requestsData", address, @@ -846,38 +879,50 @@ const previousNetworks = [...selectedNetworks]; // Store current selection try { + // Handle decryption state changes based on slider value if (sliderValue === "on") { - if (localStorage?.getItem("isDecryptionEnabled") === "false") { + const currentDecryptionState = localStorage?.getItem("isDecryptionEnabled") === "true"; + + // Only invalidate queries if we're changing the decryption state + if (!currentDecryptionState) { queryClient.invalidateQueries(); } + try { const signer = await getEthersSigner(wagmiConfig); if (signer && currentAccount?.address) { - loadSessionSignatures = - localStorage?.getItem("lit-wallet-sig") === null; - await cipherProvider?.getSessionSignatures( - signer, - currentAccount.address, - window.location.host, - "Sign in to Lit Protocol through Request Network" - ); - cipherProvider?.enableDecryption(true); - localStorage?.setItem("isDecryptionEnabled", JSON.stringify(true)); + // Check if we need to get signatures + loadSessionSignatures = localStorage?.getItem("lit-wallet-sig") === null; + + if (loadSessionSignatures) { + await cipherProvider?.getSessionSignatures( + signer, + currentAccount.address, + window.location.host, + "Sign in to Lit Protocol through Request Network" + ); + } + + await cipherProvider?.enableDecryption(true); + localStorage?.setItem("isDecryptionEnabled", "true"); } } catch (error) { console.error("Failed to enable decryption:", error); toast.error("Failed to enable decryption."); - sliderValueForDecryption = "off"; + resetDecryptionState(); return; } finally { loadSessionSignatures = false; } } else { - if (localStorage?.getItem("isDecryptionEnabled") === "true") { + const currentDecryptionState = localStorage?.getItem("isDecryptionEnabled") === "true"; + + // Only invalidate queries if we're changing the decryption state + if (currentDecryptionState) { queryClient.invalidateQueries(); } - cipherProvider?.enableDecryption(false); - localStorage?.setItem("isDecryptionEnabled", JSON.stringify(false)); + + resetDecryptionState(); } // Always load requests regardless of decryption state From 82dd1a3352e125fa8a39ec7330a342d132c42a73 Mon Sep 17 00:00:00 2001 From: MantisClone Date: Sat, 1 Mar 2025 07:57:01 -0500 Subject: [PATCH 19/19] feat: improve toast messages 1. **Removed unnecessary awaits for `enableDecryption`**: - The `cipherProvider.enableDecryption()` method is not asynchronous, so I removed the `await` before these calls in the `initializeLitSession`, `loadRequests`, and other functions. 2. **Added user-friendly error toasts**: - Added more descriptive toast messages for common error scenarios in the Lit Protocol initialization - Added informative toast when a decryption session is reset due to address mismatch - Improved error messages in the `loadRequests` function 3. **Enhanced error handling**: - Added specific try/catch block for session signature requests - Provided more context in error messages to help users understand what went wrong - Made error messages more actionable with suggestions on how to resolve issues 4. **Improved error descriptions**: - Using the actual error message when available - Providing helpful fallback messages when the error doesn't have a message property - Including user-friendly suggestions for resolving common issues --- .../src/lib/view-requests.svelte | 54 +++++++++++++++---- 1 file changed, 43 insertions(+), 11 deletions(-) diff --git a/packages/invoice-dashboard/src/lib/view-requests.svelte b/packages/invoice-dashboard/src/lib/view-requests.svelte index facf0276..c687f70b 100644 --- a/packages/invoice-dashboard/src/lib/view-requests.svelte +++ b/packages/invoice-dashboard/src/lib/view-requests.svelte @@ -478,11 +478,17 @@ ): Promise => { if (!currentAccount?.address) { console.error("Cannot initialize Lit session: Missing account address"); + toast.error("Decryption initialization failed", { + description: "Wallet connection required for decrypted requests" + }); return false; } if (!cipherProvider) { console.error("Cannot initialize Lit session: Missing cipher provider"); + toast.error("Decryption initialization failed", { + description: "Encryption service not available" + }); return false; } @@ -504,8 +510,7 @@ const parsedSig = JSON.parse(storedSig); if (parsedSig.address?.toLowerCase() === currentAccount.address?.toLowerCase()) { - // Use the stored session key and signature to restore the session - await cipherProvider.enableDecryption(true); + cipherProvider.enableDecryption(true); sliderValueForDecryption = "on"; // Ensure our UI state reflects the storage state @@ -516,10 +521,16 @@ } else { console.log("Stored signature address doesn't match current account, resetting"); resetDecryptionState(); + toast.info("Decryption session reset", { + description: "Previous session belonged to a different wallet address" + }); } } catch (sessionError) { console.error("Failed to restore Lit session:", sessionError); resetDecryptionState(); + toast.error("Failed to restore decryption session", { + description: "Try toggling decryption off and on again" + }); } } else { console.log("Incomplete session data, cannot restore Lit session"); @@ -527,6 +538,9 @@ } catch (error) { console.error("Failed to initialize Lit session:", error); resetDecryptionState(); + toast.error("Decryption initialization failed", { + description: error instanceof Error ? error.message : "Unknown error occurred" + }); } return false; }; @@ -895,20 +909,34 @@ loadSessionSignatures = localStorage?.getItem("lit-wallet-sig") === null; if (loadSessionSignatures) { - await cipherProvider?.getSessionSignatures( - signer, - currentAccount.address, - window.location.host, - "Sign in to Lit Protocol through Request Network" - ); + try { + await cipherProvider?.getSessionSignatures( + signer, + currentAccount.address, + window.location.host, + "Sign in to Lit Protocol through Request Network" + ); + } catch (sigError) { + console.error("Failed to get session signatures:", sigError); + toast.error("Signature request failed", { + description: "Couldn't obtain needed signatures for decryption" + }); + resetDecryptionState(); + return; + } } - await cipherProvider?.enableDecryption(true); + // No await needed - enableDecryption is not async + cipherProvider?.enableDecryption(true); localStorage?.setItem("isDecryptionEnabled", "true"); } } catch (error) { console.error("Failed to enable decryption:", error); - toast.error("Failed to enable decryption."); + toast.error("Failed to enable decryption", { + description: error instanceof Error ? + error.message : + "Make sure your wallet is connected and try again" + }); resetDecryptionState(); return; } finally { @@ -930,7 +958,11 @@ selectedNetworks = previousNetworks; // Restore selection } catch (error) { console.error("Error loading requests:", error); - toast.error("Failed to load requests"); + toast.error("Failed to load requests", { + description: error instanceof Error ? + error.message : + "Check your connection and try again" + }); } finally { loading = false; }