diff --git a/package-lock.json b/package-lock.json index 3e8a713..6cc5622 100644 --- a/package-lock.json +++ b/package-lock.json @@ -19,7 +19,7 @@ "@radix-ui/react-toggle": "^1.1.2", "@radix-ui/react-toggle-group": "^1.1.2", "@radix-ui/react-tooltip": "^1.1.8", - "@waku/rln": "0.1.7-987c6cd.0", + "@waku/rln": "0.1.10-593bc45.0", "class-variance-authority": "^0.7.1", "clsx": "^2.1.1", "framer-motion": "^12.6.3", @@ -1292,51 +1292,77 @@ "license": "MIT" }, "node_modules/@libp2p/crypto": { - "version": "5.1.7", - "resolved": "https://registry.npmjs.org/@libp2p/crypto/-/crypto-5.1.7.tgz", - "integrity": "sha512-7DO0piidLEKfCuNfS420BlHG0e2tH7W/zugdsPSiC/1Apa/s1B1dBkaIEgfDkGjrRP4S/8Or86Rtq7zXeEu67g==", + "version": "5.1.11", + "resolved": "https://registry.npmjs.org/@libp2p/crypto/-/crypto-5.1.11.tgz", + "integrity": "sha512-J+C4bntXEhf43fJZbgyoa4XI8/kzwB5wE/2FoNQcwhIwgDd4YyRB1SHswgI0KWqF0pgKtFLE+sLnUBn/ZYUTjw==", "license": "Apache-2.0 OR MIT", "dependencies": { - "@libp2p/interface": "^2.10.5", - "@noble/curves": "^1.9.1", - "@noble/hashes": "^1.8.0", - "multiformats": "^13.3.6", - "protons-runtime": "^5.5.0", + "@libp2p/interface": "^3.0.1", + "@noble/curves": "^2.0.1", + "@noble/hashes": "^2.0.1", + "multiformats": "^13.4.0", + "protons-runtime": "^5.6.0", "uint8arraylist": "^2.4.8", "uint8arrays": "^5.1.0" } }, + "node_modules/@libp2p/crypto/node_modules/@libp2p/interface": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@libp2p/interface/-/interface-3.0.1.tgz", + "integrity": "sha512-Fc502I77E+vLiADk7PyydM3NwW6F1HCQGhhtbzi9jLb+X8KgVBL3wlPqWXVM8fyQ++4CpOcAyMel8UYhIXr26w==", + "license": "Apache-2.0 OR MIT", + "dependencies": { + "@multiformats/dns": "^1.0.6", + "@multiformats/multiaddr": "^13.0.1", + "main-event": "^1.0.1", + "multiformats": "^13.4.0", + "progress-events": "^1.0.1", + "uint8arraylist": "^2.4.8" + } + }, + "node_modules/@libp2p/crypto/node_modules/@multiformats/multiaddr": { + "version": "13.0.1", + "resolved": "https://registry.npmjs.org/@multiformats/multiaddr/-/multiaddr-13.0.1.tgz", + "integrity": "sha512-XToN915cnfr6Lr9EdGWakGJbPT0ghpg/850HvdC+zFX8XvpLZElwa8synCiwa8TuvKNnny6m8j8NVBNCxhIO3g==", + "license": "Apache-2.0 OR MIT", + "dependencies": { + "@chainsafe/is-ip": "^2.0.1", + "multiformats": "^13.0.0", + "uint8-varint": "^2.0.1", + "uint8arrays": "^5.0.0" + } + }, "node_modules/@libp2p/crypto/node_modules/@noble/curves": { - "version": "1.9.2", - "resolved": "https://registry.npmjs.org/@noble/curves/-/curves-1.9.2.tgz", - "integrity": "sha512-HxngEd2XUcg9xi20JkwlLCtYwfoFw4JGkuZpT+WlsPD4gB/cxkvTD8fSsoAnphGZhFdZYKeQIPCuFlWPm1uE0g==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/@noble/curves/-/curves-2.0.1.tgz", + "integrity": "sha512-vs1Az2OOTBiP4q0pwjW5aF0xp9n4MxVrmkFBxc6EKZc6ddYx5gaZiAsZoq0uRRXWbi3AT/sBqn05eRPtn1JCPw==", "license": "MIT", "dependencies": { - "@noble/hashes": "1.8.0" + "@noble/hashes": "2.0.1" }, "engines": { - "node": "^14.21.3 || >=16" + "node": ">= 20.19.0" }, "funding": { "url": "https://paulmillr.com/funding/" } }, "node_modules/@libp2p/crypto/node_modules/@noble/hashes": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.8.0.tgz", - "integrity": "sha512-jCs9ldd7NwzpgXDIf6P3+NrHh9/sD6CQdxHyjQI+h/6rDNo88ypBxxz45UDuZHz9r3tNz7N/VInSVoVdtXEI4A==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-2.0.1.tgz", + "integrity": "sha512-XlOlEbQcE9fmuXxrVTXCTlG2nlRXa9Rj3rr5Ue/+tX+nmkgbX720YHh0VR3hBF9xDvwnb8D2shVGOwNx+ulArw==", "license": "MIT", "engines": { - "node": "^14.21.3 || >=16" + "node": ">= 20.19.0" }, "funding": { "url": "https://paulmillr.com/funding/" } }, "node_modules/@libp2p/interface": { - "version": "2.10.5", - "resolved": "https://registry.npmjs.org/@libp2p/interface/-/interface-2.10.5.tgz", - "integrity": "sha512-Z52n04Mph/myGdwyExbFi5S/HqrmZ9JOmfLc2v4r2Cik3GRdw98vrGH19PFvvwjLwAjaqsweCtlGaBzAz09YDw==", + "version": "2.11.0", + "resolved": "https://registry.npmjs.org/@libp2p/interface/-/interface-2.11.0.tgz", + "integrity": "sha512-0MUFKoXWHTQW3oWIgSHApmYMUKWO/Y02+7Hpyp+n3z+geD4Xo2Rku2gYWmxcq+Pyjkz6Q9YjDWz3Yb2SoV2E8Q==", "license": "Apache-2.0 OR MIT", "dependencies": { "@multiformats/dns": "^1.0.6", @@ -1350,24 +1376,24 @@ } }, "node_modules/@libp2p/interface-internal": { - "version": "2.3.18", - "resolved": "https://registry.npmjs.org/@libp2p/interface-internal/-/interface-internal-2.3.18.tgz", - "integrity": "sha512-tnZ20IFASXLbDc2JxeUPZNIXDuN5Ge7be6BU458WLvmquf93NlSqZkWs6xFdi+0yXUrw7GGTgzIP5v+1LnDUmA==", + "version": "2.3.19", + "resolved": "https://registry.npmjs.org/@libp2p/interface-internal/-/interface-internal-2.3.19.tgz", + "integrity": "sha512-v335EB0i5CaNF+0SqT01CTBp0VyjJizpy46KprcshFFjX16UQ8+/QzoTZqmot9WiAmAzwR0b87oKmlAE9cpxzQ==", "license": "Apache-2.0 OR MIT", "dependencies": { - "@libp2p/interface": "^2.10.5", - "@libp2p/peer-collections": "^6.0.34", + "@libp2p/interface": "^2.11.0", + "@libp2p/peer-collections": "^6.0.35", "@multiformats/multiaddr": "^12.4.4", "progress-events": "^1.0.1" } }, "node_modules/@libp2p/logger": { - "version": "5.1.21", - "resolved": "https://registry.npmjs.org/@libp2p/logger/-/logger-5.1.21.tgz", - "integrity": "sha512-V1TWlZM5BuKkiGQ7En4qOnseVP82JwDIpIfNjceUZz1ArL32A5HXJjLQnJchkZ3VW8PVciJzUos/vP6slhPY6Q==", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@libp2p/logger/-/logger-5.2.0.tgz", + "integrity": "sha512-OEFS529CnIKfbWEHmuCNESw9q0D0hL8cQ8klQfjIVPur15RcgAEgc1buQ7Y6l0B6tCYg120bp55+e9tGvn8c0g==", "license": "Apache-2.0 OR MIT", "dependencies": { - "@libp2p/interface": "^2.10.5", + "@libp2p/interface": "^2.11.0", "@multiformats/multiaddr": "^12.4.4", "interface-datastore": "^8.3.1", "multiformats": "^13.3.6", @@ -1375,25 +1401,25 @@ } }, "node_modules/@libp2p/peer-collections": { - "version": "6.0.34", - "resolved": "https://registry.npmjs.org/@libp2p/peer-collections/-/peer-collections-6.0.34.tgz", - "integrity": "sha512-rw8gDGhou4sF6W6i9ntmRARFePX19Dw9MMVpZHr6Kx9q2kvBJq91IXUzsXP06roexEOu1CUlZwxtUAqOBy+Eww==", + "version": "6.0.35", + "resolved": "https://registry.npmjs.org/@libp2p/peer-collections/-/peer-collections-6.0.35.tgz", + "integrity": "sha512-QiloK3T7DXW7R2cpL38dBnALCHf5pMzs/TyFzlEK33WezA2YFVoj7CtOJKqbn29bmV9uspWOxMgfmLUXf8ALvA==", "license": "Apache-2.0 OR MIT", "dependencies": { - "@libp2p/interface": "^2.10.5", - "@libp2p/peer-id": "^5.1.8", - "@libp2p/utils": "^6.7.1", + "@libp2p/interface": "^2.11.0", + "@libp2p/peer-id": "^5.1.9", + "@libp2p/utils": "^6.7.2", "multiformats": "^13.3.6" } }, "node_modules/@libp2p/peer-id": { - "version": "5.1.8", - "resolved": "https://registry.npmjs.org/@libp2p/peer-id/-/peer-id-5.1.8.tgz", - "integrity": "sha512-pGaM4BwjnXdGtAtd84L4/wuABpsnFYE+AQ+h3GxNFme0IsTaTVKWd1jBBE5YFeKHBHGUOhF3TlHsdjFfjQA7TA==", + "version": "5.1.9", + "resolved": "https://registry.npmjs.org/@libp2p/peer-id/-/peer-id-5.1.9.tgz", + "integrity": "sha512-cVDp7lX187Epmi/zr0Qq2RsEMmueswP9eIxYSFoMcHL/qcvRFhsxOfUGB8361E26s2WJvC9sXZ0oJS9XVueJhQ==", "license": "Apache-2.0 OR MIT", "dependencies": { - "@libp2p/crypto": "^5.1.7", - "@libp2p/interface": "^2.10.5", + "@libp2p/crypto": "^5.1.8", + "@libp2p/interface": "^2.11.0", "multiformats": "^13.3.6", "uint8arrays": "^5.1.0" } @@ -1414,16 +1440,16 @@ } }, "node_modules/@libp2p/utils": { - "version": "6.7.1", - "resolved": "https://registry.npmjs.org/@libp2p/utils/-/utils-6.7.1.tgz", - "integrity": "sha512-x3WImvw4unmx1ZeAedj8AkRe4UImUlkw0ZItYAiKiekElMNUXwv+Yt48dI/LmB38JIof8sng29XvUeCVU3F6OA==", + "version": "6.7.2", + "resolved": "https://registry.npmjs.org/@libp2p/utils/-/utils-6.7.2.tgz", + "integrity": "sha512-yglVPcYErb4al3MMTdedVLLsdUvr5KaqrrxohxTl/FXMFBvBs0o3w8lo29nfnTUpnNSHFhWZ9at0ZGNnpT/C/w==", "license": "Apache-2.0 OR MIT", "dependencies": { "@chainsafe/is-ip": "^2.1.0", "@chainsafe/netmask": "^2.0.0", - "@libp2p/crypto": "^5.1.7", - "@libp2p/interface": "^2.10.5", - "@libp2p/logger": "^5.1.21", + "@libp2p/crypto": "^5.1.8", + "@libp2p/interface": "^2.11.0", + "@libp2p/logger": "^5.2.0", "@multiformats/multiaddr": "^12.4.4", "@sindresorhus/fnv1a": "^3.1.0", "any-signal": "^4.1.1", @@ -1445,12 +1471,11 @@ } }, "node_modules/@multiformats/dns": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/@multiformats/dns/-/dns-1.0.6.tgz", - "integrity": "sha512-nt/5UqjMPtyvkG9BQYdJ4GfLK3nMqGpFZOzf4hAmIa0sJh2LlS9YKXZ4FgwBDsaHvzZqR/rUFIywIc7pkHNNuw==", + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/@multiformats/dns/-/dns-1.0.9.tgz", + "integrity": "sha512-Ja4hevWI9p96ICx11K3suFvFirnMmXILzS7FpsR2KG3FoKF/XJijm8ylf3vY6kRFGr98yfZYM+zIn18KaINs3A==", "license": "Apache-2.0 OR MIT", "dependencies": { - "@types/dns-packet": "^5.6.5", "buffer": "^6.0.3", "dns-packet": "^5.6.1", "hashlru": "^2.3.0", @@ -1523,6 +1548,111 @@ "node": ">= 10" } }, + "node_modules/@next/swc-darwin-x64": { + "version": "15.1.7", + "resolved": "https://registry.npmjs.org/@next/swc-darwin-x64/-/swc-darwin-x64-15.1.7.tgz", + "integrity": "sha512-2qoas+fO3OQKkU0PBUfwTiw/EYpN+kdAx62cePRyY1LqKtP09Vp5UcUntfZYajop5fDFTjSxCHfZVRxzi+9FYQ==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@next/swc-linux-arm64-gnu": { + "version": "15.1.7", + "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-gnu/-/swc-linux-arm64-gnu-15.1.7.tgz", + "integrity": "sha512-sKLLwDX709mPdzxMnRIXLIT9zaX2w0GUlkLYQnKGoXeWUhcvpCrK+yevcwCJPdTdxZEUA0mOXGLdPsGkudGdnA==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@next/swc-linux-arm64-musl": { + "version": "15.1.7", + "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-musl/-/swc-linux-arm64-musl-15.1.7.tgz", + "integrity": "sha512-zblK1OQbQWdC8fxdX4fpsHDw+VSpBPGEUX4PhSE9hkaWPrWoeIJn+baX53vbsbDRaDKd7bBNcXRovY1hEhFd7w==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@next/swc-linux-x64-gnu": { + "version": "15.1.7", + "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-gnu/-/swc-linux-x64-gnu-15.1.7.tgz", + "integrity": "sha512-GOzXutxuLvLHFDAPsMP2zDBMl1vfUHHpdNpFGhxu90jEzH6nNIgmtw/s1MDwpTOiM+MT5V8+I1hmVFeAUhkbgQ==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@next/swc-linux-x64-musl": { + "version": "15.1.7", + "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-musl/-/swc-linux-x64-musl-15.1.7.tgz", + "integrity": "sha512-WrZ7jBhR7ATW1z5iEQ0ZJfE2twCNSXbpCSaAunF3BKcVeHFADSI/AW1y5Xt3DzTqPF1FzQlwQTewqetAABhZRQ==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@next/swc-win32-arm64-msvc": { + "version": "15.1.7", + "resolved": "https://registry.npmjs.org/@next/swc-win32-arm64-msvc/-/swc-win32-arm64-msvc-15.1.7.tgz", + "integrity": "sha512-LDnj1f3OVbou1BqvvXVqouJZKcwq++mV2F+oFHptToZtScIEnhNRJAhJzqAtTE2dB31qDYL45xJwrc+bLeKM2Q==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@next/swc-win32-x64-msvc": { + "version": "15.1.7", + "resolved": "https://registry.npmjs.org/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-15.1.7.tgz", + "integrity": "sha512-dC01f1quuf97viOfW05/K8XYv2iuBgAxJZl7mbCKEjMgdQl5JjAKJ0D2qMKZCgPWDeFbFT0Q0nYWwytEW0DWTQ==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 10" + } + }, "node_modules/@noble/ciphers": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/@noble/ciphers/-/ciphers-1.2.1.tgz", @@ -2549,15 +2679,6 @@ "@types/ms": "*" } }, - "node_modules/@types/dns-packet": { - "version": "5.6.5", - "resolved": "https://registry.npmjs.org/@types/dns-packet/-/dns-packet-5.6.5.tgz", - "integrity": "sha512-qXOC7XLOEe43ehtWJCMnQXvgcIpv6rPmQ1jXT98Ad8A3TB1Ue50jsCbSSSyuazScEuZ/Q026vHbrOTVkmwA+7Q==", - "license": "MIT", - "dependencies": { - "@types/node": "*" - } - }, "node_modules/@types/estree": { "version": "1.0.7", "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.7.tgz", @@ -2615,6 +2736,7 @@ "version": "20.17.30", "resolved": "https://registry.npmjs.org/@types/node/-/node-20.17.30.tgz", "integrity": "sha512-7zf4YyHA+jvBNfVrk2Gtvs6x7E8V+YDW05bNfG2XkWDJfYRXrTiP/DsB2zSYTaHX0bGIujTBQdMVAhb+j7mwpg==", + "dev": true, "license": "MIT", "dependencies": { "undici-types": "~6.19.2" @@ -2872,17 +2994,17 @@ ] }, "node_modules/@waku/core": { - "version": "0.0.37-987c6cd.0", - "resolved": "https://registry.npmjs.org/@waku/core/-/core-0.0.37-987c6cd.0.tgz", - "integrity": "sha512-w3F/dzY/YA5T3l62YKKcza3fMLZNzprupoKScvtpWS8VymLIGZCMhzcKOij4lt6SWzHWyTEMa9qtcB6tZPIC+A==", + "version": "0.0.40-593bc45.0", + "resolved": "https://registry.npmjs.org/@waku/core/-/core-0.0.40-593bc45.0.tgz", + "integrity": "sha512-STERLmw+lNFOUynRrdD33E4cwAEBTTobdaGcERJhfeeaipvQYmoQ5PQpnJLh34kV1wka1Jl+5EW4oj6SHFaRHw==", "license": "MIT OR Apache-2.0", "dependencies": { "@libp2p/ping": "2.0.35", "@noble/hashes": "^1.3.2", - "@waku/enr": "0.0.31-987c6cd.0", - "@waku/interfaces": "0.0.32-987c6cd.0", - "@waku/proto": "0.0.12-987c6cd.0", - "@waku/utils": "0.0.25-987c6cd.0", + "@waku/enr": "0.0.34-593bc45.0", + "@waku/interfaces": "0.0.35-593bc45.0", + "@waku/proto": "0.0.15-593bc45.0", + "@waku/utils": "0.0.28-593bc45.0", "debug": "^4.3.4", "it-all": "^3.0.4", "it-length-prefixed": "^9.0.4", @@ -2920,9 +3042,9 @@ } }, "node_modules/@waku/enr": { - "version": "0.0.31-987c6cd.0", - "resolved": "https://registry.npmjs.org/@waku/enr/-/enr-0.0.31-987c6cd.0.tgz", - "integrity": "sha512-nStUXohULcatKLxCyzU7JJK2gKhMXYEAdN90uL1Ggl4tKA9uUrQ2YZC/WB61RmucnDlFNH6phFv47/WbARhhVA==", + "version": "0.0.34-593bc45.0", + "resolved": "https://registry.npmjs.org/@waku/enr/-/enr-0.0.34-593bc45.0.tgz", + "integrity": "sha512-59lJhBOUUXcIJJo6ApUz3ntUUn1PGSFs8dbfuN/0TRreexjzcmwrrX0TKX2hfUoJlY670D9YnbZuaeT3oCO/1Q==", "license": "MIT OR Apache-2.0", "dependencies": { "@ethersproject/rlp": "^5.7.0", @@ -2930,7 +3052,7 @@ "@libp2p/peer-id": "5.1.7", "@multiformats/multiaddr": "^12.0.0", "@noble/secp256k1": "^1.7.1", - "@waku/utils": "0.0.25-987c6cd.0", + "@waku/utils": "0.0.28-593bc45.0", "debug": "^4.3.4", "js-sha3": "^0.9.2" }, @@ -2974,9 +3096,9 @@ } }, "node_modules/@waku/enr/node_modules/@noble/curves": { - "version": "1.9.2", - "resolved": "https://registry.npmjs.org/@noble/curves/-/curves-1.9.2.tgz", - "integrity": "sha512-HxngEd2XUcg9xi20JkwlLCtYwfoFw4JGkuZpT+WlsPD4gB/cxkvTD8fSsoAnphGZhFdZYKeQIPCuFlWPm1uE0g==", + "version": "1.9.7", + "resolved": "https://registry.npmjs.org/@noble/curves/-/curves-1.9.7.tgz", + "integrity": "sha512-gbKGcRUYIjA3/zCCNaWDciTMFI0dCkvou3TL8Zmy5Nc7sJ47a0jtOeZoTaMxkuqRo9cRhjOdZJXegxYE5FN/xw==", "license": "MIT", "dependencies": { "@noble/hashes": "1.8.0" @@ -3007,18 +3129,18 @@ "license": "MIT" }, "node_modules/@waku/interfaces": { - "version": "0.0.32-987c6cd.0", - "resolved": "https://registry.npmjs.org/@waku/interfaces/-/interfaces-0.0.32-987c6cd.0.tgz", - "integrity": "sha512-7dfGDx1bs+rs1nlMwAZYd0Di4gLyD9cWR0ApDJ+I0sU3enn1NT6hM1U3cp+LE6xqxXUoe2tfQi/4QhrECaGypQ==", + "version": "0.0.35-593bc45.0", + "resolved": "https://registry.npmjs.org/@waku/interfaces/-/interfaces-0.0.35-593bc45.0.tgz", + "integrity": "sha512-BAQs7Qbm3Vbb8ZMcH0b/7RaA0c39HChuU9aHrNYWemwcZ7ZmQbJPGGQmRqnQkPpWJs0eo0VRPTjZbnE9Vi6I+Q==", "license": "MIT OR Apache-2.0", "engines": { "node": ">=22" } }, "node_modules/@waku/proto": { - "version": "0.0.12-987c6cd.0", - "resolved": "https://registry.npmjs.org/@waku/proto/-/proto-0.0.12-987c6cd.0.tgz", - "integrity": "sha512-B0u7Qkm/U6mH0ZCGYvRfg4d44JboscYBmXifeOTwY0i4QH8nvrZcPIIsUqvNmzT2CjrAwpt8H+98fGp9l4fKow==", + "version": "0.0.15-593bc45.0", + "resolved": "https://registry.npmjs.org/@waku/proto/-/proto-0.0.15-593bc45.0.tgz", + "integrity": "sha512-fGYt25PvZBZv0EBjvLVzopFBkum3iUQs+1Kjyju3cA5zULA4FH2G8CMmBts81rH0EpGSi/eeUal119+kuctZHw==", "license": "MIT OR Apache-2.0", "dependencies": { "protons-runtime": "^5.4.0" @@ -3028,16 +3150,16 @@ } }, "node_modules/@waku/rln": { - "version": "0.1.7-987c6cd.0", - "resolved": "https://registry.npmjs.org/@waku/rln/-/rln-0.1.7-987c6cd.0.tgz", - "integrity": "sha512-6w/17WpD7jdw5LyM6OX0c2mMxW3cRrXG7wxi7PzhoSb2celNWZYhnPR9UK+rgsP5opoBDXD7LAyaEEqA3afbgA==", + "version": "0.1.10-593bc45.0", + "resolved": "https://registry.npmjs.org/@waku/rln/-/rln-0.1.10-593bc45.0.tgz", + "integrity": "sha512-nkUcwfosKDXSsqzxBzTV+x9Iiuo0Ti5vVLQP8MnWttf4FuJxR8hKcde9+hvkzZZTZntn6TEQaYFzG3KOAC2kcA==", "license": "MIT OR Apache-2.0", "dependencies": { "@chainsafe/bls-keystore": "3.0.0", "@noble/hashes": "^1.2.0", - "@waku/core": "0.0.37-987c6cd.0", - "@waku/utils": "0.0.25-987c6cd.0", - "@waku/zerokit-rln-wasm": "^0.0.13", + "@waku/core": "0.0.40-593bc45.0", + "@waku/utils": "0.0.28-593bc45.0", + "@waku/zerokit-rln-wasm": "^0.2.1", "chai": "^5.1.2", "chai-as-promised": "^8.0.1", "chai-spies": "^1.1.0", @@ -3053,13 +3175,13 @@ } }, "node_modules/@waku/utils": { - "version": "0.0.25-987c6cd.0", - "resolved": "https://registry.npmjs.org/@waku/utils/-/utils-0.0.25-987c6cd.0.tgz", - "integrity": "sha512-HaYkDnVtpfmsXfDBd0gB63CxidIeE9gKMRMCaaywy6W07HK32ZgMgnD/BoPbaREa4BpEZELvW3qbYUydm3AKzw==", + "version": "0.0.28-593bc45.0", + "resolved": "https://registry.npmjs.org/@waku/utils/-/utils-0.0.28-593bc45.0.tgz", + "integrity": "sha512-m4FEzl89cVx6dCQYd15VxRmeqT1DTodHEAS4st7UMdNwaURGWeADbw37NPRc0wHu6LocQYQshJEP1eXtbTkmwg==", "license": "MIT OR Apache-2.0", "dependencies": { "@noble/hashes": "^1.3.2", - "@waku/interfaces": "0.0.32-987c6cd.0", + "@waku/interfaces": "0.0.35-593bc45.0", "chai": "^4.3.10", "debug": "^4.3.4", "uint8arrays": "^5.0.1" @@ -3138,9 +3260,9 @@ } }, "node_modules/@waku/zerokit-rln-wasm": { - "version": "0.0.13", - "resolved": "https://registry.npmjs.org/@waku/zerokit-rln-wasm/-/zerokit-rln-wasm-0.0.13.tgz", - "integrity": "sha512-x7CRIIslmfCmTZc7yVp3dhLlKeLUs8ILIm9kv7+wVJ23H4pPw0Z+uH0ueLIYYfwODI6fDiwJj3S1vdFzM8D1zA==", + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/@waku/zerokit-rln-wasm/-/zerokit-rln-wasm-0.2.1.tgz", + "integrity": "sha512-2Xp7e92y4qZpsiTPGBSVr4gVJ9mJTLaudlo0DQxNpxJUBtoJKpxdH5xDCQDiorbkWZC2j9EId+ohhxHO/xC1QQ==", "license": "MIT or Apache2" }, "node_modules/abort-error": { @@ -7328,9 +7450,9 @@ "license": "MIT" }, "node_modules/multiformats": { - "version": "13.3.7", - "resolved": "https://registry.npmjs.org/multiformats/-/multiformats-13.3.7.tgz", - "integrity": "sha512-meL9DERHj+fFVWoOX9fXqfcYcSpUfSYJPcFvDPKrxitICbwAoWR+Ut4j5NO9zAT917HUHLQmqzQbAsGNHlDcxQ==", + "version": "13.4.1", + "resolved": "https://registry.npmjs.org/multiformats/-/multiformats-13.4.1.tgz", + "integrity": "sha512-VqO6OSvLrFVAYYjgsr8tyv62/rCQhPgsZUXLTqoFLSgdkgiUYKYeArbt1uWLlEpkjxQe+P0+sHlbPEte1Bi06Q==", "license": "Apache-2.0 OR MIT" }, "node_modules/mz": { @@ -7708,9 +7830,9 @@ } }, "node_modules/p-queue": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/p-queue/-/p-queue-8.1.0.tgz", - "integrity": "sha512-mxLDbbGIBEXTJL0zEx8JIylaj3xQ7Z/7eEVjcF9fJX4DBiH9oqe+oahYnlKKxm0Ci9TlWTyhSHgygxMxjIB2jw==", + "version": "8.1.1", + "resolved": "https://registry.npmjs.org/p-queue/-/p-queue-8.1.1.tgz", + "integrity": "sha512-aNZ+VfjobsWryoiPnEApGGmf5WmNsCo9xu8dfaYamG5qaLP7ClhLN6NgsFe6SwJ2UbLEBK5dv9x8Mn5+RVhMWQ==", "license": "MIT", "dependencies": { "eventemitter3": "^5.0.1", @@ -8122,9 +8244,9 @@ "license": "MIT" }, "node_modules/race-event": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/race-event/-/race-event-1.6.0.tgz", - "integrity": "sha512-hXkk3CDepWELBG2MsT/zIiTbjNNucMo49vwZEdjChJlxJivc8fWIu/Gh/4vEJdWsHDmnGCC6++ftP2Afep6RUg==", + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/race-event/-/race-event-1.6.1.tgz", + "integrity": "sha512-vi7WH5g5KoTFpu2mme/HqZiWH14XSOtg5rfp6raBskBHl7wnmy3F/biAIyY5MsK+BHWhoPhxtZ1Y2R7OHHaWyQ==", "license": "Apache-2.0 OR MIT", "dependencies": { "abort-error": "^1.0.1" @@ -9501,6 +9623,7 @@ "version": "6.19.8", "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.19.8.tgz", "integrity": "sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw==", + "dev": true, "license": "MIT" }, "node_modules/unified": { @@ -9720,31 +9843,31 @@ } }, "node_modules/weald": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/weald/-/weald-1.0.4.tgz", - "integrity": "sha512-+kYTuHonJBwmFhP1Z4YQK/dGi3jAnJGCYhyODFpHK73rbxnp9lnZQj7a2m+WVgn8fXr5bJaxUpF6l8qZpPeNWQ==", + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/weald/-/weald-1.0.6.tgz", + "integrity": "sha512-sX1PzkcMJZUJ848JbFzB6aKHHglTxqACEnq2KgI75b7vWYvfXFBNbOuDKqFKwCT44CrP6c5r+L4+5GmPnb5/SQ==", "license": "Apache-2.0 OR MIT", "dependencies": { "ms": "^3.0.0-canary.1", - "supports-color": "^9.4.0" + "supports-color": "^10.0.0" } }, "node_modules/weald/node_modules/ms": { - "version": "3.0.0-canary.1", - "resolved": "https://registry.npmjs.org/ms/-/ms-3.0.0-canary.1.tgz", - "integrity": "sha512-kh8ARjh8rMN7Du2igDRO9QJnqCb2xYTJxyQYK7vJJS4TvLLmsbyhiKpSW+t+y26gyOyMd0riphX0GeWKU3ky5g==", + "version": "3.0.0-canary.202508261828", + "resolved": "https://registry.npmjs.org/ms/-/ms-3.0.0-canary.202508261828.tgz", + "integrity": "sha512-NotsCoUCIUkojWCzQff4ttdCfIPoA1UGZsyQbi7KmqkNRfKCrvga8JJi2PknHymHOuor0cJSn/ylj52Cbt2IrQ==", "license": "MIT", "engines": { - "node": ">=12.13" + "node": ">=18" } }, "node_modules/weald/node_modules/supports-color": { - "version": "9.4.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-9.4.0.tgz", - "integrity": "sha512-VL+lNrEoIXww1coLPOmiEmK/0sGigko5COxI09KzHc2VJXJsQ37UaQ+8quuxjDeA7+KnLGTWRyOXSLLR2Wb4jw==", + "version": "10.2.2", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-10.2.2.tgz", + "integrity": "sha512-SS+jx45GF1QjgEXQx4NJZV9ImqmO2NPz5FNsIHrsDjh2YsHnawpan7SNQ1o8NuhrbHZy9AZhIoCUiCeaW/C80g==", "license": "MIT", "engines": { - "node": ">=12" + "node": ">=18" }, "funding": { "url": "https://github.com/chalk/supports-color?sponsor=1" diff --git a/package.json b/package.json index 954a1a4..1cdb333 100644 --- a/package.json +++ b/package.json @@ -21,7 +21,7 @@ "@radix-ui/react-toggle": "^1.1.2", "@radix-ui/react-toggle-group": "^1.1.2", "@radix-ui/react-tooltip": "^1.1.8", - "@waku/rln": "0.1.7-987c6cd.0", + "@waku/rln": "0.1.10-593bc45.0", "class-variance-authority": "^0.7.1", "clsx": "^2.1.1", "framer-motion": "^12.6.3", diff --git a/src/components/RLNStatusIndicator.tsx b/src/components/RLNStatusIndicator.tsx index b656526..7eda657 100644 --- a/src/components/RLNStatusIndicator.tsx +++ b/src/components/RLNStatusIndicator.tsx @@ -5,20 +5,9 @@ import { useRLN } from '../contexts'; import { useWallet } from '../contexts'; export function RLNStatusIndicator() { - const { isInitialized, isStarted, isLoading, error, rln } = useRLN(); + const { isInitialized, isStarted, isLoading, error } = useRLN(); const { isConnected, chainId } = useWallet(); - // Debug logging - console.log('RLN Status:', { - isConnected, - chainId, - isInitialized, - isStarted, - isLoading, - error, - rln - }); - const getStatusColor = () => { if (error) return 'bg-red-500 shadow-[0_0_8px_0_rgba(239,68,68,0.6)]'; if (isLoading) return 'bg-yellow-500 animate-pulse shadow-[0_0_8px_0_rgba(234,179,8,0.6)]'; diff --git a/src/components/Tabs/RunNodeTab/RunNodeTab.tsx b/src/components/Tabs/RunNodeTab/RunNodeTab.tsx index 8f47a2a..4720d4d 100644 --- a/src/components/Tabs/RunNodeTab/RunNodeTab.tsx +++ b/src/components/Tabs/RunNodeTab/RunNodeTab.tsx @@ -35,6 +35,7 @@ function CodeBlock({ code }: { code: string }) { ); } +// eslint-disable-next-line @typescript-eslint/no-unused-vars export default function RunNodeTab({ tabId: _tabId }: RunNodeTabProps) { const { hasStoredCredentials, diff --git a/src/content/index.ts b/src/content/index.ts index d508239..b07a45a 100644 --- a/src/content/index.ts +++ b/src/content/index.ts @@ -1,3 +1,5 @@ +import { RLN_REGISTRATION_CONTRACT_ADDRESS } from '../contracts/constants'; + export type ContentSegment = { type: 'text' | 'link'; content: string; @@ -20,7 +22,7 @@ export const membershipRegistration = { ], [ { type: 'text', content: 'This application is configured to use the ' }, - { type: 'link', content: 'Linea Sepolia', url: 'https://sepolia.lineascan.build/address/0xb9cd878c90e49f797b4431fbf4fb333108cb90e6' }, + { type: 'link', content: 'Linea Sepolia', url: `https://sepolia.lineascan.build/address/${RLN_REGISTRATION_CONTRACT_ADDRESS.toLowerCase()}` }, { type: 'text', content: ' testnet for RLN registrations.' } ], [ diff --git a/src/contexts/rln/RLNContext.tsx b/src/contexts/rln/RLNContext.tsx index 3fe37cd..9cf21d7 100644 --- a/src/contexts/rln/RLNContext.tsx +++ b/src/contexts/rln/RLNContext.tsx @@ -1,13 +1,15 @@ "use client"; import { createContext, useContext, useState, useEffect, ReactNode, useCallback } from 'react'; -import { KeystoreEntity, MembershipInfo, RLNCredentialsManager } from '@waku/rln'; +import { KeystoreEntity, MembershipInfo, RLNInstance, createRLN } from '@waku/rln'; import { ethers } from 'ethers'; import { useKeystore } from '../keystore'; +import { useWallet } from '../wallet'; import { ERC20_ABI, LINEA_SEPOLIA_CONFIG, ensureLineaSepoliaNetwork } from '../../utils/network'; +import { WAKU_TESTNET_TOKEN_ADDRESS } from '../../contracts/constants'; interface RLNContextType { - rln: RLNCredentialsManager | null; + rln: RLNInstance | null; isInitialized: boolean; isStarted: boolean; error: string | null; @@ -34,12 +36,23 @@ interface RLNContextType { saveCredentialsToKeystore: (credentials: KeystoreEntity, password: string) => Promise; isLoading: boolean; getPriceForRateLimit: (rateLimit: number) => Promise<{ price: string }>; + tokenApprovalStatus: { + isApproved: boolean | null; + isChecking: boolean; + needsApproval: boolean; + requiredAmount: string | null; + currentAllowance: string | null; + tokenBalance: string | null; + hasEnoughBalance: boolean | null; + }; + checkTokenApproval: (rateLimit: number) => Promise; + approveTokens: () => Promise<{ success: boolean; error?: string }>; } const RLNContext = createContext(undefined); export function RLNProvider({ children }: { children: ReactNode }) { - const [rln, setRln] = useState(null); + const [rln, setRln] = useState(null); const [isInitialized, setIsInitialized] = useState(false); const [isStarted, setIsStarted] = useState(false); const [error, setError] = useState(null); @@ -50,8 +63,20 @@ export function RLNProvider({ children }: { children: ReactNode }) { const [isConnected, setIsConnected] = useState(false); const [rateMinLimit, setRateMinLimit] = useState(0); const [rateMaxLimit, setRateMaxLimit] = useState(0); + + // Token approval status + const [tokenApprovalStatus, setTokenApprovalStatus] = useState({ + isApproved: null as boolean | null, + isChecking: false, + needsApproval: false, + requiredAmount: null as string | null, + currentAllowance: null as string | null, + tokenBalance: null as string | null, + hasEnoughBalance: null as boolean | null, + }); const { saveCredentials: saveToKeystore, getDecryptedCredential } = useKeystore(); + const { wttBalance } = useWallet(); // Listen for wallet connection useEffect(() => { @@ -113,7 +138,7 @@ export function RLNProvider({ children }: { children: ReactNode }) { if (!currentRln) { console.log("Creating RLN instance..."); try { - currentRln = new RLNCredentialsManager(); + currentRln = await createRLN(); setRln(currentRln); setIsInitialized(true); console.log("RLN instance created successfully."); @@ -145,6 +170,31 @@ export function RLNProvider({ children }: { children: ReactNode }) { } else { console.warn("Could not fetch rate limits: undefined values returned."); } + + // Get and log the token address from the contract + try { + const priceInfo = await currentRln.contract.getPriceForRateLimit(300); + if (priceInfo && priceInfo.token) { + console.log("🪙 Token address from RLN contract:", priceInfo.token); + console.log("🪙 Hardcoded token address:", WAKU_TESTNET_TOKEN_ADDRESS); + console.log("🪙 Addresses match:", priceInfo.token.toLowerCase() === WAKU_TESTNET_TOKEN_ADDRESS.toLowerCase()); + + // Check balance using the RLN contract's token address + const userAddress = await signer.getAddress(); + const rlnTokenContract = new ethers.Contract(priceInfo.token, ERC20_ABI, signer); + const rlnTokenBalance = await rlnTokenContract.balanceOf(userAddress); + console.log("💰 Balance from RLN token contract:", ethers.utils.formatUnits(rlnTokenBalance, 18), "tokens"); + + // Also check balance using hardcoded address for comparison + const hardcodedTokenContract = new ethers.Contract(WAKU_TESTNET_TOKEN_ADDRESS, ERC20_ABI, signer); + const hardcodedTokenBalance = await hardcodedTokenContract.balanceOf(userAddress); + console.log("💰 Balance from hardcoded token contract:", ethers.utils.formatUnits(hardcodedTokenBalance, 18), "tokens"); + } else { + console.warn("Could not get token address from RLN contract"); + } + } catch (tokenErr) { + console.warn("Error getting token address from RLN contract:", tokenErr); + } } catch (limitErr) { console.warn("Could not fetch rate limits after start:", limitErr); // Don't fail initialization for this, but log it. @@ -155,7 +205,27 @@ export function RLNProvider({ children }: { children: ReactNode }) { } catch (startErr) { console.error("Error starting RLN:", startErr); - setError(startErr instanceof Error ? startErr.message : 'Failed to start RLN'); + + // Check if it's a network mismatch error + if (startErr instanceof Error && startErr.message.includes('chain ID of contract is different')) { + console.log("Network mismatch detected, attempting to switch to Linea Sepolia..."); + + try { + const switched = await ensureLineaSepoliaNetwork(signer); + if (switched) { + setError('Network switched to Linea Sepolia. Please try connecting again.'); + // Don't retry automatically to avoid loops, let user re-trigger + } else { + setError('Please manually switch to Linea Sepolia network in MetaMask and try again.'); + } + } catch (switchErr) { + console.error("Error switching network:", switchErr); + setError('Failed to switch to Linea Sepolia network. Please switch manually in MetaMask.'); + } + } else { + setError(startErr instanceof Error ? startErr.message : 'Failed to start RLN'); + } + setIsStarted(false); } } else if (isStarted) { @@ -245,6 +315,135 @@ export function RLNProvider({ children }: { children: ReactNode }) { } }; + const checkTokenApproval = useCallback(async (rateLimit: number) => { + if (!rln || !rln.contract || !signer || !isConnected) { + console.log("Cannot check token approval: RLN not ready or wallet not connected"); + return; + } + + setTokenApprovalStatus(prev => ({ ...prev, isChecking: true })); + + try { + const userAddress = await signer.getAddress(); + const contractAddress = rln.contract.address; + + // Use the hardcoded token address consistently + const tokenAddress = WAKU_TESTNET_TOKEN_ADDRESS; + + // Get price info from RLN contract + const priceInfo = await rln.contract.getPriceForRateLimit(rateLimit); + + // Create token contract instance + const tokenContract = new ethers.Contract( + tokenAddress, + ERC20_ABI, + signer + ); + if (!priceInfo.price) { + throw new Error("Unable to determine required deposit amount"); + } + + const requiredAmount = priceInfo.price; + const currentAllowance = await tokenContract.allowance(userAddress, contractAddress); + + // Check actual token balance directly from the contract + const actualTokenBalance = await tokenContract.balanceOf(userAddress); + const tokenBalanceStr = ethers.utils.formatUnits(actualTokenBalance, 18); + const tokenBalance = actualTokenBalance; + + console.log("Token approval check:", { + requiredAmount: ethers.utils.formatUnits(requiredAmount, 18), + currentAllowance: ethers.utils.formatUnits(currentAllowance, 18), + tokenBalance: tokenBalanceStr, + tokenAddress: tokenAddress, + userAddress: userAddress, + contractAddress: contractAddress + }); + + const isApproved = currentAllowance.gte(requiredAmount); + const needsApproval = !isApproved; + const hasEnoughBalance = tokenBalance.gte(requiredAmount); + + setTokenApprovalStatus({ + isApproved, + isChecking: false, + needsApproval, + requiredAmount: ethers.utils.formatUnits(requiredAmount, 18), + currentAllowance: ethers.utils.formatUnits(currentAllowance, 18), + tokenBalance: tokenBalanceStr, + hasEnoughBalance, + }); + + // Clear any existing errors when checking status + setError(null); + } catch (err) { + console.error("Error checking token approval:", err); + setTokenApprovalStatus(prev => ({ + ...prev, + isChecking: false, + isApproved: null, + needsApproval: false + })); + } + }, [rln, signer, isConnected, setError]); + + const approveTokens = useCallback(async (): Promise<{ success: boolean; error?: string }> => { + if (!rln || !rln.contract || !signer) { + return { success: false, error: "RLN not initialized or wallet not connected" }; + } + + try { + const userAddress = await signer.getAddress(); + const contractAddress = rln.contract.address; + + // Use the hardcoded token address consistently + const tokenAddress = WAKU_TESTNET_TOKEN_ADDRESS; + + // Create token contract instance + const tokenContract = new ethers.Contract( + tokenAddress, + ERC20_ABI, + signer + ); + + // Approve maximum amount for convenience + const approvalAmount = ethers.constants.MaxUint256; + + const approveTx = await tokenContract.approve(contractAddress, approvalAmount); + console.log("Approval transaction submitted:", approveTx.hash); + + // Update status to show approval in progress + setTokenApprovalStatus(prev => ({ ...prev, isChecking: true })); + + // Wait for the transaction to be mined + const receipt = await approveTx.wait(2); + console.log("Token approval confirmed in block:", receipt.blockNumber); + + // Update approval status + const newAllowance = await tokenContract.allowance(userAddress, contractAddress); + const isApproved = newAllowance.gt(0); + + setTokenApprovalStatus(prev => ({ + ...prev, + isApproved, + isChecking: false, + needsApproval: !isApproved, + currentAllowance: ethers.utils.formatUnits(newAllowance, 18), + })); + + return { success: true }; + } catch (err) { + console.error("Error approving tokens:", err); + setTokenApprovalStatus(prev => ({ ...prev, isChecking: false })); + + const errorMessage = err instanceof Error ? err.message : String(err); + return { + success: false, + error: `Failed to approve tokens: ${errorMessage}` + }; + } + }, [rln, signer]); + const registerMembership = async (rateLimit: number, saveOptions?: { password: string }) => { console.log("registerMembership called with rate limit:", rateLimit); @@ -280,7 +479,9 @@ export function RLNProvider({ children }: { children: ReactNode }) { } const contractAddress = rln.contract.address; - const tokenAddress = LINEA_SEPOLIA_CONFIG.tokenAddress; + + // Use the hardcoded token address consistently + const tokenAddress = WAKU_TESTNET_TOKEN_ADDRESS; // Create token contract instance const tokenContract = new ethers.Contract( @@ -289,27 +490,57 @@ export function RLNProvider({ children }: { children: ReactNode }) { signer ); - // Check token balance - const tokenBalance = await tokenContract.balanceOf(userAddress); + // Check balance from wallet context + const tokenBalanceStr = wttBalance || "0"; + const tokenBalance = ethers.utils.parseUnits(tokenBalanceStr, 18); + if (tokenBalance.isZero()) { - return { success: false, error: "You need tokens to register a membership. Your token balance is zero." }; + return { + success: false, + error: `You need tokens to register a membership. Your balance is ${tokenBalanceStr} WTT. Please get test tokens.` + }; } - // Check and approve token allowance if needed + // Get the required deposit amount first + let requiredDeposit; + try { + const priceInfo = await rln.contract.getPriceForRateLimit(rateLimit); + if (!priceInfo.price) { + return { success: false, error: "Unable to determine deposit amount for rate limit" }; + } + requiredDeposit = priceInfo.price; + console.log("Required deposit:", ethers.utils.formatUnits(requiredDeposit, 18), "WTT"); + } catch (priceErr) { + console.error("Error getting price for rate limit:", priceErr); + return { success: false, error: "Failed to determine required deposit amount" }; + } + + // Check and approve token allowance const currentAllowance = await tokenContract.allowance(userAddress, contractAddress); - if (currentAllowance.eq(0)) { - console.log("Requesting token approval..."); + console.log("Current allowance:", ethers.utils.formatUnits(currentAllowance, 18), "WTT"); + console.log("Required deposit:", ethers.utils.formatUnits(requiredDeposit, 18), "WTT"); + + if (currentAllowance.lt(requiredDeposit)) { + console.log("Insufficient allowance, requesting token approval..."); - // Approve a large amount (max uint256) - const maxUint256 = ethers.constants.MaxUint256; + // Approve the required amount plus a buffer (or max uint256 for simplicity) + const approvalAmount = ethers.constants.MaxUint256; try { - const approveTx = await tokenContract.approve(contractAddress, maxUint256); + const approveTx = await tokenContract.approve(contractAddress, approvalAmount); console.log("Approval transaction submitted:", approveTx.hash); - // Wait for the transaction to be mined - await approveTx.wait(1); - console.log("Token approval confirmed"); + // Wait for the transaction to be mined with more confirmations + const receipt = await approveTx.wait(2); + console.log("Token approval confirmed in block:", receipt.blockNumber); + + // Verify the approval was successful + const newAllowance = await tokenContract.allowance(userAddress, contractAddress); + console.log("New allowance:", ethers.utils.formatUnits(newAllowance, 18), "WTT"); + + if (newAllowance.lt(requiredDeposit)) { + return { success: false, error: "Token approval failed - insufficient allowance after approval" }; + } } catch (approvalErr) { console.error("Error during token approval:", approvalErr); return { @@ -328,10 +559,38 @@ export function RLNProvider({ children }: { children: ReactNode }) { // Register membership console.log("Registering membership..."); - const credentials = await rln.registerMembership({ - signature: signature - }); - console.log("Credentials:", credentials); + let credentials; + try { + credentials = await rln.registerMembership({ + signature: signature + }); + console.log("Credentials:", credentials); + } catch (registrationError) { + console.error("Registration error:", registrationError); + + // Check if it's an allowance issue + if (registrationError instanceof Error && registrationError.message.includes("insufficient allowance")) { + return { + success: false, + error: "Token approval failed. Please try approving tokens manually in MetaMask and try again." + }; + } + + // Check for other common errors + if (registrationError instanceof Error && registrationError.message.includes("user rejected")) { + return { + success: false, + error: "Transaction was rejected. Please try again and approve the transaction." + }; + } + + // Generic error handling + const errorMessage = registrationError instanceof Error ? registrationError.message : String(registrationError); + return { + success: false, + error: `Registration failed: ${errorMessage}` + }; + } // If we have save options, save to keystore let keystoreHash: string | undefined; @@ -446,8 +705,9 @@ export function RLNProvider({ children }: { children: ReactNode }) { throw new Error('Could not decrypt credential'); } - // Get token address from config - const tokenAddress = LINEA_SEPOLIA_CONFIG.tokenAddress; + // Use the hardcoded token address consistently + const tokenAddress = WAKU_TESTNET_TOKEN_ADDRESS; + const userAddress = await signer?.getAddress(); if (!userAddress) { @@ -472,7 +732,17 @@ export function RLNProvider({ children }: { children: ReactNode }) { throw new Error('RLN not initialized or contract not available'); } const result = await rln.contract.getPriceForRateLimit(rateLimit); + if (!result.price) { + throw new Error('Price not available'); + } + + console.log("💰 Price from RLN contract (raw BigNumber):", result.price); + console.log("💰 Price from RLN contract (toString):", result.price.toString()); + console.log("💰 Price from RLN contract (hex):", result.price.toHexString()); + const formatted = ethers.utils.formatUnits(result.price, 18); + console.log("💰 Price formatted to decimal:", formatted); + return { price: formatted }; } catch (err) { console.error('Error getting price for rate limit:', err); @@ -499,7 +769,10 @@ export function RLNProvider({ children }: { children: ReactNode }) { getRateLimitsBounds, saveCredentialsToKeystore: saveToKeystore, isLoading, - getPriceForRateLimit + getPriceForRateLimit, + tokenApprovalStatus, + checkTokenApproval, + approveTokens }} > {children} diff --git a/src/contexts/rln/types.ts b/src/contexts/rln/types.ts index 655f03d..43c382c 100644 --- a/src/contexts/rln/types.ts +++ b/src/contexts/rln/types.ts @@ -1,7 +1,7 @@ -import { DecryptedCredentials, RLNCredentialsManager, RLNInstance } from "@waku/rln"; +import { DecryptedCredentials, RLNInstance } from "@waku/rln"; export interface RLNContextType { - rln: RLNInstance | RLNCredentialsManager | null; + rln: RLNInstance | null; isInitialized: boolean; isStarted: boolean; error: string | null; diff --git a/src/contracts/constants.ts b/src/contracts/constants.ts index 7bdeca7..c8f0c64 100644 --- a/src/contracts/constants.ts +++ b/src/contracts/constants.ts @@ -1,2 +1,3 @@ -export const WAKU_TESTNET_TOKEN_ADDRESS = '0x185A0015aC462a0aECb81beCc0497b649a64B9ea'; -export const RLN_REGISTRATION_CONTRACT_ADDRESS = '0xB9cd878C90E49F797B4431fBF4fb333108CB90e6'; \ No newline at end of file +// Linea Sepolia testnet contract addresses +export const RLN_REGISTRATION_CONTRACT_ADDRESS = '0xB9cd878C90E49F797B4431fBF4fb333108CB90e6'; +export const WAKU_TESTNET_TOKEN_ADDRESS = '0xd28d1a688b1cBf5126fB8B034d0150C81ec0024c'; \ No newline at end of file diff --git a/src/utils/network.ts b/src/utils/network.ts index d98a43b..89f77f3 100644 --- a/src/utils/network.ts +++ b/src/utils/network.ts @@ -1,11 +1,12 @@ "use client"; import { ethers } from 'ethers'; +import { WAKU_TESTNET_TOKEN_ADDRESS } from '../contracts/constants'; // Linea Sepolia configuration export const LINEA_SEPOLIA_CONFIG = { chainId: 59141, - tokenAddress: '0x185A0015aC462a0aECb81beCc0497b649a64B9ea' + tokenAddress: WAKU_TESTNET_TOKEN_ADDRESS }; // Type for Ethereum provider in window @@ -19,10 +20,11 @@ export interface EthereumProvider { // Function to ensure the wallet is connected to Linea Sepolia network export const ensureLineaSepoliaNetwork = async (signer?: ethers.Signer): Promise => { try { - console.log("Current network: unknown", await signer?.getChainId()); + const currentChainId = await signer?.getChainId(); + console.log("Current network chain ID:", currentChainId); // Check if already on Linea Sepolia - if (await signer?.getChainId() === LINEA_SEPOLIA_CONFIG.chainId) { + if (currentChainId === LINEA_SEPOLIA_CONFIG.chainId) { console.log("Already on Linea Sepolia network"); return true; } @@ -38,18 +40,54 @@ export const ensureLineaSepoliaNetwork = async (signer?: ethers.Signer): Promise return false; } + const chainIdHex = `0x${LINEA_SEPOLIA_CONFIG.chainId.toString(16)}`; // 0xe705 + try { // Request network switch await provider.request({ method: 'wallet_switchEthereumChain', - params: [{ chainId: `0x${LINEA_SEPOLIA_CONFIG.chainId.toString(16)}` }], + params: [{ chainId: chainIdHex }], }); console.log("Successfully switched to Linea Sepolia"); return true; } catch (switchError: unknown) { - console.error("Error switching network:", switchError); - return false; + console.log("Switch error:", switchError); + + // Check if the error is because the network is not added to MetaMask + const error = switchError as { code?: number; message?: string }; + if (error?.code === 4902 || error?.message?.includes('Unrecognized chain ID')) { + console.log("Network not found, attempting to add Linea Sepolia..."); + + try { + // Add the network to MetaMask + await provider.request({ + method: 'wallet_addEthereumChain', + params: [ + { + chainId: chainIdHex, + chainName: 'Linea Sepolia Testnet', + nativeCurrency: { + name: 'ETH', + symbol: 'ETH', + decimals: 18, + }, + rpcUrls: ['https://rpc.sepolia.linea.build'], + blockExplorerUrls: ['https://sepolia.lineascan.build'], + }, + ], + }); + + console.log("Successfully added Linea Sepolia network"); + return true; + } catch (addError) { + console.error("Error adding network:", addError); + return false; + } + } else { + console.error("Error switching network:", switchError); + return false; + } } } catch (err) { console.error("Error checking or switching network:", err); diff --git a/yarn.lock b/yarn.lock index 7a833cb..ff3f99f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -568,16 +568,16 @@ resolved "https://registry.npmjs.org/@leichtgewicht/ip-codec/-/ip-codec-2.0.5.tgz" integrity sha512-Vo+PSpZG2/fmgmiNzYK9qWRh8h/CHrwD0mo1h1DzL4yzHNSfWYujGTYsWGreD000gcgmZ7K4Ys6Tx9TxtsKdDw== -"@libp2p/crypto@^5.1.6", "@libp2p/crypto@^5.1.7": - version "5.1.7" - resolved "https://registry.npmjs.org/@libp2p/crypto/-/crypto-5.1.7.tgz" - integrity sha512-7DO0piidLEKfCuNfS420BlHG0e2tH7W/zugdsPSiC/1Apa/s1B1dBkaIEgfDkGjrRP4S/8Or86Rtq7zXeEu67g== +"@libp2p/crypto@^5.1.6", "@libp2p/crypto@^5.1.8": + version "5.1.11" + resolved "https://registry.npmjs.org/@libp2p/crypto/-/crypto-5.1.11.tgz" + integrity sha512-J+C4bntXEhf43fJZbgyoa4XI8/kzwB5wE/2FoNQcwhIwgDd4YyRB1SHswgI0KWqF0pgKtFLE+sLnUBn/ZYUTjw== dependencies: - "@libp2p/interface" "^2.10.5" - "@noble/curves" "^1.9.1" - "@noble/hashes" "^1.8.0" - multiformats "^13.3.6" - protons-runtime "^5.5.0" + "@libp2p/interface" "^3.0.1" + "@noble/curves" "^2.0.1" + "@noble/hashes" "^2.0.1" + multiformats "^13.4.0" + protons-runtime "^5.6.0" uint8arraylist "^2.4.8" uint8arrays "^5.1.0" @@ -595,19 +595,19 @@ uint8arrays "^5.1.0" "@libp2p/interface-internal@^2.3.17": - version "2.3.18" - resolved "https://registry.npmjs.org/@libp2p/interface-internal/-/interface-internal-2.3.18.tgz" - integrity sha512-tnZ20IFASXLbDc2JxeUPZNIXDuN5Ge7be6BU458WLvmquf93NlSqZkWs6xFdi+0yXUrw7GGTgzIP5v+1LnDUmA== + version "2.3.19" + resolved "https://registry.npmjs.org/@libp2p/interface-internal/-/interface-internal-2.3.19.tgz" + integrity sha512-v335EB0i5CaNF+0SqT01CTBp0VyjJizpy46KprcshFFjX16UQ8+/QzoTZqmot9WiAmAzwR0b87oKmlAE9cpxzQ== dependencies: - "@libp2p/interface" "^2.10.5" - "@libp2p/peer-collections" "^6.0.34" + "@libp2p/interface" "^2.11.0" + "@libp2p/peer-collections" "^6.0.35" "@multiformats/multiaddr" "^12.4.4" progress-events "^1.0.1" -"@libp2p/interface@^2.10.4", "@libp2p/interface@^2.10.5": - version "2.10.5" - resolved "https://registry.npmjs.org/@libp2p/interface/-/interface-2.10.5.tgz" - integrity sha512-Z52n04Mph/myGdwyExbFi5S/HqrmZ9JOmfLc2v4r2Cik3GRdw98vrGH19PFvvwjLwAjaqsweCtlGaBzAz09YDw== +"@libp2p/interface@^2.10.4", "@libp2p/interface@^2.11.0": + version "2.11.0" + resolved "https://registry.npmjs.org/@libp2p/interface/-/interface-2.11.0.tgz" + integrity sha512-0MUFKoXWHTQW3oWIgSHApmYMUKWO/Y02+7Hpyp+n3z+geD4Xo2Rku2gYWmxcq+Pyjkz6Q9YjDWz3Yb2SoV2E8Q== dependencies: "@multiformats/dns" "^1.0.6" "@multiformats/multiaddr" "^12.4.4" @@ -618,34 +618,46 @@ progress-events "^1.0.1" uint8arraylist "^2.4.8" -"@libp2p/logger@^5.1.21": - version "5.1.21" - resolved "https://registry.npmjs.org/@libp2p/logger/-/logger-5.1.21.tgz" - integrity sha512-V1TWlZM5BuKkiGQ7En4qOnseVP82JwDIpIfNjceUZz1ArL32A5HXJjLQnJchkZ3VW8PVciJzUos/vP6slhPY6Q== +"@libp2p/interface@^3.0.1": + version "3.0.1" + resolved "https://registry.npmjs.org/@libp2p/interface/-/interface-3.0.1.tgz" + integrity sha512-Fc502I77E+vLiADk7PyydM3NwW6F1HCQGhhtbzi9jLb+X8KgVBL3wlPqWXVM8fyQ++4CpOcAyMel8UYhIXr26w== dependencies: - "@libp2p/interface" "^2.10.5" + "@multiformats/dns" "^1.0.6" + "@multiformats/multiaddr" "^13.0.1" + main-event "^1.0.1" + multiformats "^13.4.0" + progress-events "^1.0.1" + uint8arraylist "^2.4.8" + +"@libp2p/logger@^5.2.0": + version "5.2.0" + resolved "https://registry.npmjs.org/@libp2p/logger/-/logger-5.2.0.tgz" + integrity sha512-OEFS529CnIKfbWEHmuCNESw9q0D0hL8cQ8klQfjIVPur15RcgAEgc1buQ7Y6l0B6tCYg120bp55+e9tGvn8c0g== + dependencies: + "@libp2p/interface" "^2.11.0" "@multiformats/multiaddr" "^12.4.4" interface-datastore "^8.3.1" multiformats "^13.3.6" weald "^1.0.4" -"@libp2p/peer-collections@^6.0.34": - version "6.0.34" - resolved "https://registry.npmjs.org/@libp2p/peer-collections/-/peer-collections-6.0.34.tgz" - integrity sha512-rw8gDGhou4sF6W6i9ntmRARFePX19Dw9MMVpZHr6Kx9q2kvBJq91IXUzsXP06roexEOu1CUlZwxtUAqOBy+Eww== +"@libp2p/peer-collections@^6.0.35": + version "6.0.35" + resolved "https://registry.npmjs.org/@libp2p/peer-collections/-/peer-collections-6.0.35.tgz" + integrity sha512-QiloK3T7DXW7R2cpL38dBnALCHf5pMzs/TyFzlEK33WezA2YFVoj7CtOJKqbn29bmV9uspWOxMgfmLUXf8ALvA== dependencies: - "@libp2p/interface" "^2.10.5" - "@libp2p/peer-id" "^5.1.8" - "@libp2p/utils" "^6.7.1" + "@libp2p/interface" "^2.11.0" + "@libp2p/peer-id" "^5.1.9" + "@libp2p/utils" "^6.7.2" multiformats "^13.3.6" -"@libp2p/peer-id@^5.1.8": - version "5.1.8" - resolved "https://registry.npmjs.org/@libp2p/peer-id/-/peer-id-5.1.8.tgz" - integrity sha512-pGaM4BwjnXdGtAtd84L4/wuABpsnFYE+AQ+h3GxNFme0IsTaTVKWd1jBBE5YFeKHBHGUOhF3TlHsdjFfjQA7TA== +"@libp2p/peer-id@^5.1.9": + version "5.1.9" + resolved "https://registry.npmjs.org/@libp2p/peer-id/-/peer-id-5.1.9.tgz" + integrity sha512-cVDp7lX187Epmi/zr0Qq2RsEMmueswP9eIxYSFoMcHL/qcvRFhsxOfUGB8361E26s2WJvC9sXZ0oJS9XVueJhQ== dependencies: - "@libp2p/crypto" "^5.1.7" - "@libp2p/interface" "^2.10.5" + "@libp2p/crypto" "^5.1.8" + "@libp2p/interface" "^2.11.0" multiformats "^13.3.6" uint8arrays "^5.1.0" @@ -672,16 +684,16 @@ main-event "^1.0.1" uint8arrays "^5.1.0" -"@libp2p/utils@^6.7.1": - version "6.7.1" - resolved "https://registry.npmjs.org/@libp2p/utils/-/utils-6.7.1.tgz" - integrity sha512-x3WImvw4unmx1ZeAedj8AkRe4UImUlkw0ZItYAiKiekElMNUXwv+Yt48dI/LmB38JIof8sng29XvUeCVU3F6OA== +"@libp2p/utils@^6.7.2": + version "6.7.2" + resolved "https://registry.npmjs.org/@libp2p/utils/-/utils-6.7.2.tgz" + integrity sha512-yglVPcYErb4al3MMTdedVLLsdUvr5KaqrrxohxTl/FXMFBvBs0o3w8lo29nfnTUpnNSHFhWZ9at0ZGNnpT/C/w== dependencies: "@chainsafe/is-ip" "^2.1.0" "@chainsafe/netmask" "^2.0.0" - "@libp2p/crypto" "^5.1.7" - "@libp2p/interface" "^2.10.5" - "@libp2p/logger" "^5.1.21" + "@libp2p/crypto" "^5.1.8" + "@libp2p/interface" "^2.11.0" + "@libp2p/logger" "^5.2.0" "@multiformats/multiaddr" "^12.4.4" "@sindresorhus/fnv1a" "^3.1.0" any-signal "^4.1.1" @@ -702,11 +714,10 @@ uint8arrays "^5.1.0" "@multiformats/dns@^1.0.3", "@multiformats/dns@^1.0.6": - version "1.0.6" - resolved "https://registry.npmjs.org/@multiformats/dns/-/dns-1.0.6.tgz" - integrity sha512-nt/5UqjMPtyvkG9BQYdJ4GfLK3nMqGpFZOzf4hAmIa0sJh2LlS9YKXZ4FgwBDsaHvzZqR/rUFIywIc7pkHNNuw== + version "1.0.9" + resolved "https://registry.npmjs.org/@multiformats/dns/-/dns-1.0.9.tgz" + integrity sha512-Ja4hevWI9p96ICx11K3suFvFirnMmXILzS7FpsR2KG3FoKF/XJijm8ylf3vY6kRFGr98yfZYM+zIn18KaINs3A== dependencies: - "@types/dns-packet" "^5.6.5" buffer "^6.0.3" dns-packet "^5.6.1" hashlru "^2.3.0" @@ -727,6 +738,16 @@ uint8-varint "^2.0.1" uint8arrays "^5.0.0" +"@multiformats/multiaddr@^13.0.1": + version "13.0.1" + resolved "https://registry.npmjs.org/@multiformats/multiaddr/-/multiaddr-13.0.1.tgz" + integrity sha512-XToN915cnfr6Lr9EdGWakGJbPT0ghpg/850HvdC+zFX8XvpLZElwa8synCiwa8TuvKNnny6m8j8NVBNCxhIO3g== + dependencies: + "@chainsafe/is-ip" "^2.0.1" + multiformats "^13.0.0" + uint8-varint "^2.0.1" + uint8arrays "^5.0.0" + "@next/env@15.1.7": version "15.1.7" resolved "https://registry.npmjs.org/@next/env/-/env-15.1.7.tgz" @@ -750,12 +771,19 @@ integrity sha512-rONPWMC7PeExE077uLE4oqWrZ1IvAfz3oH9LibVAcVCopJiA9R62uavnbEzdkVmJYI6M6Zgkbeb07+tWjlq2XA== "@noble/curves@^1.9.1": - version "1.9.2" - resolved "https://registry.npmjs.org/@noble/curves/-/curves-1.9.2.tgz" - integrity sha512-HxngEd2XUcg9xi20JkwlLCtYwfoFw4JGkuZpT+WlsPD4gB/cxkvTD8fSsoAnphGZhFdZYKeQIPCuFlWPm1uE0g== + version "1.9.7" + resolved "https://registry.npmjs.org/@noble/curves/-/curves-1.9.7.tgz" + integrity sha512-gbKGcRUYIjA3/zCCNaWDciTMFI0dCkvou3TL8Zmy5Nc7sJ47a0jtOeZoTaMxkuqRo9cRhjOdZJXegxYE5FN/xw== dependencies: "@noble/hashes" "1.8.0" +"@noble/curves@^2.0.1": + version "2.0.1" + resolved "https://registry.npmjs.org/@noble/curves/-/curves-2.0.1.tgz" + integrity sha512-vs1Az2OOTBiP4q0pwjW5aF0xp9n4MxVrmkFBxc6EKZc6ddYx5gaZiAsZoq0uRRXWbi3AT/sBqn05eRPtn1JCPw== + dependencies: + "@noble/hashes" "2.0.1" + "@noble/curves@~1.8.1": version "1.8.2" resolved "https://registry.npmjs.org/@noble/curves/-/curves-1.8.2.tgz" @@ -780,6 +808,11 @@ resolved "https://registry.npmjs.org/@noble/hashes/-/hashes-1.8.0.tgz" integrity sha512-jCs9ldd7NwzpgXDIf6P3+NrHh9/sD6CQdxHyjQI+h/6rDNo88ypBxxz45UDuZHz9r3tNz7N/VInSVoVdtXEI4A== +"@noble/hashes@^2.0.1", "@noble/hashes@2.0.1": + version "2.0.1" + resolved "https://registry.npmjs.org/@noble/hashes/-/hashes-2.0.1.tgz" + integrity sha512-XlOlEbQcE9fmuXxrVTXCTlG2nlRXa9Rj3rr5Ue/+tX+nmkgbX720YHh0VR3hBF9xDvwnb8D2shVGOwNx+ulArw== + "@noble/hashes@~1.2.0", "@noble/hashes@1.2.0": version "1.2.0" resolved "https://registry.npmjs.org/@noble/hashes/-/hashes-1.2.0.tgz" @@ -1272,13 +1305,6 @@ dependencies: "@types/ms" "*" -"@types/dns-packet@^5.6.5": - version "5.6.5" - resolved "https://registry.npmjs.org/@types/dns-packet/-/dns-packet-5.6.5.tgz" - integrity sha512-qXOC7XLOEe43ehtWJCMnQXvgcIpv6rPmQ1jXT98Ad8A3TB1Ue50jsCbSSSyuazScEuZ/Q026vHbrOTVkmwA+7Q== - dependencies: - "@types/node" "*" - "@types/estree-jsx@^1.0.0": version "1.0.5" resolved "https://registry.npmjs.org/@types/estree-jsx/-/estree-jsx-1.0.5.tgz" @@ -1320,7 +1346,7 @@ resolved "https://registry.npmjs.org/@types/ms/-/ms-2.1.0.tgz" integrity sha512-GsCCIZDE/p3i96vtEqx+7dBUGXrc7zeSK3wwPHIaRThS+9OhWIXRqzs4d6k1SVU8g91DrNRWxWUGhp5KXQb2VA== -"@types/node@*", "@types/node@^20": +"@types/node@^20": version "20.17.30" resolved "https://registry.npmjs.org/@types/node/-/node-20.17.30.tgz" integrity sha512-7zf4YyHA+jvBNfVrk2Gtvs6x7E8V+YDW05bNfG2XkWDJfYRXrTiP/DsB2zSYTaHX0bGIujTBQdMVAhb+j7mwpg== @@ -1440,17 +1466,17 @@ resolved "https://registry.npmjs.org/@unrs/resolver-binding-darwin-arm64/-/resolver-binding-darwin-arm64-1.5.0.tgz" integrity sha512-YmocNlEcX/AgJv8gI41bhjMOTcKcea4D2nRIbZj+MhRtSH5+vEU8r/pFuTuoF+JjVplLsBueU+CILfBPVISyGQ== -"@waku/core@0.0.37-987c6cd.0": - version "0.0.37-987c6cd.0" - resolved "https://registry.npmjs.org/@waku/core/-/core-0.0.37-987c6cd.0.tgz" - integrity sha512-w3F/dzY/YA5T3l62YKKcza3fMLZNzprupoKScvtpWS8VymLIGZCMhzcKOij4lt6SWzHWyTEMa9qtcB6tZPIC+A== +"@waku/core@0.0.40-593bc45.0": + version "0.0.40-593bc45.0" + resolved "https://registry.npmjs.org/@waku/core/-/core-0.0.40-593bc45.0.tgz" + integrity sha512-STERLmw+lNFOUynRrdD33E4cwAEBTTobdaGcERJhfeeaipvQYmoQ5PQpnJLh34kV1wka1Jl+5EW4oj6SHFaRHw== dependencies: "@libp2p/ping" "2.0.35" "@noble/hashes" "^1.3.2" - "@waku/enr" "0.0.31-987c6cd.0" - "@waku/interfaces" "0.0.32-987c6cd.0" - "@waku/proto" "0.0.12-987c6cd.0" - "@waku/utils" "0.0.25-987c6cd.0" + "@waku/enr" "0.0.34-593bc45.0" + "@waku/interfaces" "0.0.35-593bc45.0" + "@waku/proto" "0.0.15-593bc45.0" + "@waku/utils" "0.0.28-593bc45.0" debug "^4.3.4" it-all "^3.0.4" it-length-prefixed "^9.0.4" @@ -1458,42 +1484,42 @@ uint8arraylist "^2.4.3" uuid "^9.0.0" -"@waku/enr@0.0.31-987c6cd.0": - version "0.0.31-987c6cd.0" - resolved "https://registry.npmjs.org/@waku/enr/-/enr-0.0.31-987c6cd.0.tgz" - integrity sha512-nStUXohULcatKLxCyzU7JJK2gKhMXYEAdN90uL1Ggl4tKA9uUrQ2YZC/WB61RmucnDlFNH6phFv47/WbARhhVA== +"@waku/enr@0.0.34-593bc45.0": + version "0.0.34-593bc45.0" + resolved "https://registry.npmjs.org/@waku/enr/-/enr-0.0.34-593bc45.0.tgz" + integrity sha512-59lJhBOUUXcIJJo6ApUz3ntUUn1PGSFs8dbfuN/0TRreexjzcmwrrX0TKX2hfUoJlY670D9YnbZuaeT3oCO/1Q== dependencies: "@ethersproject/rlp" "^5.7.0" "@libp2p/crypto" "5.1.6" "@libp2p/peer-id" "5.1.7" "@multiformats/multiaddr" "^12.0.0" "@noble/secp256k1" "^1.7.1" - "@waku/utils" "0.0.25-987c6cd.0" + "@waku/utils" "0.0.28-593bc45.0" debug "^4.3.4" js-sha3 "^0.9.2" -"@waku/interfaces@0.0.32-987c6cd.0": - version "0.0.32-987c6cd.0" - resolved "https://registry.npmjs.org/@waku/interfaces/-/interfaces-0.0.32-987c6cd.0.tgz" - integrity sha512-7dfGDx1bs+rs1nlMwAZYd0Di4gLyD9cWR0ApDJ+I0sU3enn1NT6hM1U3cp+LE6xqxXUoe2tfQi/4QhrECaGypQ== +"@waku/interfaces@0.0.35-593bc45.0": + version "0.0.35-593bc45.0" + resolved "https://registry.npmjs.org/@waku/interfaces/-/interfaces-0.0.35-593bc45.0.tgz" + integrity sha512-BAQs7Qbm3Vbb8ZMcH0b/7RaA0c39HChuU9aHrNYWemwcZ7ZmQbJPGGQmRqnQkPpWJs0eo0VRPTjZbnE9Vi6I+Q== -"@waku/proto@0.0.12-987c6cd.0": - version "0.0.12-987c6cd.0" - resolved "https://registry.npmjs.org/@waku/proto/-/proto-0.0.12-987c6cd.0.tgz" - integrity sha512-B0u7Qkm/U6mH0ZCGYvRfg4d44JboscYBmXifeOTwY0i4QH8nvrZcPIIsUqvNmzT2CjrAwpt8H+98fGp9l4fKow== +"@waku/proto@0.0.15-593bc45.0": + version "0.0.15-593bc45.0" + resolved "https://registry.npmjs.org/@waku/proto/-/proto-0.0.15-593bc45.0.tgz" + integrity sha512-fGYt25PvZBZv0EBjvLVzopFBkum3iUQs+1Kjyju3cA5zULA4FH2G8CMmBts81rH0EpGSi/eeUal119+kuctZHw== dependencies: protons-runtime "^5.4.0" -"@waku/rln@0.1.7-987c6cd.0": - version "0.1.7-987c6cd.0" - resolved "https://registry.npmjs.org/@waku/rln/-/rln-0.1.7-987c6cd.0.tgz" - integrity sha512-6w/17WpD7jdw5LyM6OX0c2mMxW3cRrXG7wxi7PzhoSb2celNWZYhnPR9UK+rgsP5opoBDXD7LAyaEEqA3afbgA== +"@waku/rln@0.1.10-593bc45.0": + version "0.1.10-593bc45.0" + resolved "https://registry.npmjs.org/@waku/rln/-/rln-0.1.10-593bc45.0.tgz" + integrity sha512-nkUcwfosKDXSsqzxBzTV+x9Iiuo0Ti5vVLQP8MnWttf4FuJxR8hKcde9+hvkzZZTZntn6TEQaYFzG3KOAC2kcA== dependencies: "@chainsafe/bls-keystore" "3.0.0" "@noble/hashes" "^1.2.0" - "@waku/core" "0.0.37-987c6cd.0" - "@waku/utils" "0.0.25-987c6cd.0" - "@waku/zerokit-rln-wasm" "^0.0.13" + "@waku/core" "0.0.40-593bc45.0" + "@waku/utils" "0.0.28-593bc45.0" + "@waku/zerokit-rln-wasm" "^0.2.1" chai "^5.1.2" chai-as-promised "^8.0.1" chai-spies "^1.1.0" @@ -1504,21 +1530,21 @@ sinon "^19.0.2" uuid "^11.0.5" -"@waku/utils@0.0.25-987c6cd.0": - version "0.0.25-987c6cd.0" - resolved "https://registry.npmjs.org/@waku/utils/-/utils-0.0.25-987c6cd.0.tgz" - integrity sha512-HaYkDnVtpfmsXfDBd0gB63CxidIeE9gKMRMCaaywy6W07HK32ZgMgnD/BoPbaREa4BpEZELvW3qbYUydm3AKzw== +"@waku/utils@0.0.28-593bc45.0": + version "0.0.28-593bc45.0" + resolved "https://registry.npmjs.org/@waku/utils/-/utils-0.0.28-593bc45.0.tgz" + integrity sha512-m4FEzl89cVx6dCQYd15VxRmeqT1DTodHEAS4st7UMdNwaURGWeADbw37NPRc0wHu6LocQYQshJEP1eXtbTkmwg== dependencies: "@noble/hashes" "^1.3.2" - "@waku/interfaces" "0.0.32-987c6cd.0" + "@waku/interfaces" "0.0.35-593bc45.0" chai "^4.3.10" debug "^4.3.4" uint8arrays "^5.0.1" -"@waku/zerokit-rln-wasm@^0.0.13": - version "0.0.13" - resolved "https://registry.npmjs.org/@waku/zerokit-rln-wasm/-/zerokit-rln-wasm-0.0.13.tgz" - integrity sha512-x7CRIIslmfCmTZc7yVp3dhLlKeLUs8ILIm9kv7+wVJ23H4pPw0Z+uH0ueLIYYfwODI6fDiwJj3S1vdFzM8D1zA== +"@waku/zerokit-rln-wasm@^0.2.1": + version "0.2.1" + resolved "https://registry.npmjs.org/@waku/zerokit-rln-wasm/-/zerokit-rln-wasm-0.2.1.tgz" + integrity sha512-2Xp7e92y4qZpsiTPGBSVr4gVJ9mJTLaudlo0DQxNpxJUBtoJKpxdH5xDCQDiorbkWZC2j9EId+ohhxHO/xC1QQ== abort-error@^1.0.1: version "1.0.1" @@ -3900,14 +3926,14 @@ ms@^2.1.1, ms@^2.1.3: integrity sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA== ms@^3.0.0-canary.1: - version "3.0.0-canary.1" - resolved "https://registry.npmjs.org/ms/-/ms-3.0.0-canary.1.tgz" - integrity sha512-kh8ARjh8rMN7Du2igDRO9QJnqCb2xYTJxyQYK7vJJS4TvLLmsbyhiKpSW+t+y26gyOyMd0riphX0GeWKU3ky5g== + version "3.0.0-canary.202508261828" + resolved "https://registry.npmjs.org/ms/-/ms-3.0.0-canary.202508261828.tgz" + integrity sha512-NotsCoUCIUkojWCzQff4ttdCfIPoA1UGZsyQbi7KmqkNRfKCrvga8JJi2PknHymHOuor0cJSn/ylj52Cbt2IrQ== -multiformats@^13.0.0, multiformats@^13.3.6: - version "13.3.7" - resolved "https://registry.npmjs.org/multiformats/-/multiformats-13.3.7.tgz" - integrity sha512-meL9DERHj+fFVWoOX9fXqfcYcSpUfSYJPcFvDPKrxitICbwAoWR+Ut4j5NO9zAT917HUHLQmqzQbAsGNHlDcxQ== +multiformats@^13.0.0, multiformats@^13.3.6, multiformats@^13.4.0: + version "13.4.1" + resolved "https://registry.npmjs.org/multiformats/-/multiformats-13.4.1.tgz" + integrity sha512-VqO6OSvLrFVAYYjgsr8tyv62/rCQhPgsZUXLTqoFLSgdkgiUYKYeArbt1uWLlEpkjxQe+P0+sHlbPEte1Bi06Q== mz@^2.7.0: version "2.7.0" @@ -4089,9 +4115,9 @@ p-locate@^5.0.0: p-limit "^3.0.2" p-queue@^8.0.1: - version "8.1.0" - resolved "https://registry.npmjs.org/p-queue/-/p-queue-8.1.0.tgz" - integrity sha512-mxLDbbGIBEXTJL0zEx8JIylaj3xQ7Z/7eEVjcF9fJX4DBiH9oqe+oahYnlKKxm0Ci9TlWTyhSHgygxMxjIB2jw== + version "8.1.1" + resolved "https://registry.npmjs.org/p-queue/-/p-queue-8.1.1.tgz" + integrity sha512-aNZ+VfjobsWryoiPnEApGGmf5WmNsCo9xu8dfaYamG5qaLP7ClhLN6NgsFe6SwJ2UbLEBK5dv9x8Mn5+RVhMWQ== dependencies: eventemitter3 "^5.0.1" p-timeout "^6.1.2" @@ -4280,7 +4306,7 @@ property-information@^7.0.0: resolved "https://registry.npmjs.org/property-information/-/property-information-7.1.0.tgz" integrity sha512-TwEZ+X+yCJmYfL7TPUOcvBZ4QfoT5YenQiJuX//0th53DE6w0xxLEtfK3iyryQFddXuvkIk51EEgrJQ0WJkOmQ== -protons-runtime@^5.4.0, protons-runtime@^5.5.0: +protons-runtime@^5.4.0, protons-runtime@^5.5.0, protons-runtime@^5.6.0: version "5.6.0" resolved "https://registry.npmjs.org/protons-runtime/-/protons-runtime-5.6.0.tgz" integrity sha512-/Kde+sB9DsMFrddJT/UZWe6XqvL7SL5dbag/DBCElFKhkwDj7XKt53S+mzLyaDP5OqS0wXjV5SA572uWDaT0Hg== @@ -4300,9 +4326,9 @@ queue-microtask@^1.2.2: integrity sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A== race-event@^1.3.0: - version "1.6.0" - resolved "https://registry.npmjs.org/race-event/-/race-event-1.6.0.tgz" - integrity sha512-hXkk3CDepWELBG2MsT/zIiTbjNNucMo49vwZEdjChJlxJivc8fWIu/Gh/4vEJdWsHDmnGCC6++ftP2Afep6RUg== + version "1.6.1" + resolved "https://registry.npmjs.org/race-event/-/race-event-1.6.1.tgz" + integrity sha512-vi7WH5g5KoTFpu2mme/HqZiWH14XSOtg5rfp6raBskBHl7wnmy3F/biAIyY5MsK+BHWhoPhxtZ1Y2R7OHHaWyQ== dependencies: abort-error "^1.0.1" @@ -4850,6 +4876,11 @@ sucrase@^3.35.0: pirates "^4.0.1" ts-interface-checker "^0.1.9" +supports-color@^10.0.0: + version "10.2.2" + resolved "https://registry.npmjs.org/supports-color/-/supports-color-10.2.2.tgz" + integrity sha512-SS+jx45GF1QjgEXQx4NJZV9ImqmO2NPz5FNsIHrsDjh2YsHnawpan7SNQ1o8NuhrbHZy9AZhIoCUiCeaW/C80g== + supports-color@^7.1.0, supports-color@^7.2.0: version "7.2.0" resolved "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz" @@ -4857,11 +4888,6 @@ supports-color@^7.1.0, supports-color@^7.2.0: dependencies: has-flag "^4.0.0" -supports-color@^9.4.0: - version "9.4.0" - resolved "https://registry.npmjs.org/supports-color/-/supports-color-9.4.0.tgz" - integrity sha512-VL+lNrEoIXww1coLPOmiEmK/0sGigko5COxI09KzHc2VJXJsQ37UaQ+8quuxjDeA7+KnLGTWRyOXSLLR2Wb4jw== - supports-preserve-symlinks-flag@^1.0.0: version "1.0.0" resolved "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz" @@ -5205,12 +5231,12 @@ vfile@^6.0.0: vfile-message "^4.0.0" weald@^1.0.4: - version "1.0.4" - resolved "https://registry.npmjs.org/weald/-/weald-1.0.4.tgz" - integrity sha512-+kYTuHonJBwmFhP1Z4YQK/dGi3jAnJGCYhyODFpHK73rbxnp9lnZQj7a2m+WVgn8fXr5bJaxUpF6l8qZpPeNWQ== + version "1.0.6" + resolved "https://registry.npmjs.org/weald/-/weald-1.0.6.tgz" + integrity sha512-sX1PzkcMJZUJ848JbFzB6aKHHglTxqACEnq2KgI75b7vWYvfXFBNbOuDKqFKwCT44CrP6c5r+L4+5GmPnb5/SQ== dependencies: ms "^3.0.0-canary.1" - supports-color "^9.4.0" + supports-color "^10.0.0" which-boxed-primitive@^1.1.0, which-boxed-primitive@^1.1.1: version "1.1.1"