diff --git a/.gitignore b/.gitignore index a547bf3..0fad054 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,7 @@ +README-task-master.md +.cursor +scripts + # Logs logs *.log @@ -22,3 +26,15 @@ dist-ssr *.njsproj *.sln *.sw? + +# Added by Claude Task Master +dev-debug.log +# Dependency directories +node_modules/ +# Environment variables +.env +.vscode +# OS specific +# Task files +tasks.json +tasks/ \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index fcb663d..98138f4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -37,6 +37,7 @@ "@radix-ui/react-toggle-group": "^1.1.0", "@radix-ui/react-tooltip": "^1.1.4", "@tanstack/react-query": "^5.56.2", + "@waku/sdk": "^0.0.30", "class-variance-authority": "^0.7.1", "clsx": "^2.1.1", "cmdk": "^1.0.0", @@ -152,6 +153,58 @@ "node": ">=6.9.0" } }, + "node_modules/@chainsafe/as-chacha20poly1305": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/@chainsafe/as-chacha20poly1305/-/as-chacha20poly1305-0.1.0.tgz", + "integrity": "sha512-BpNcL8/lji/GM3+vZ/bgRWqJ1q5kwvTFmGPk7pxm/QQZDbaMI98waOHjEymTjq2JmdD/INdNBFOVSyJofXg7ew==", + "license": "Apache-2.0" + }, + "node_modules/@chainsafe/as-sha256": { + "version": "0.4.2", + "resolved": "https://registry.npmjs.org/@chainsafe/as-sha256/-/as-sha256-0.4.2.tgz", + "integrity": "sha512-HJ8GZBRjLeWtRsAXf3EbNsNzmTGpzTFjfpSf4yHkLYC+E52DhT6hwz+7qpj6I/EmFzSUm5tYYvT9K8GZokLQCQ==", + "license": "Apache-2.0" + }, + "node_modules/@chainsafe/is-ip": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/@chainsafe/is-ip/-/is-ip-2.1.0.tgz", + "integrity": "sha512-KIjt+6IfysQ4GCv66xihEitBjvhU/bixbbbFxdJ1sqCp4uJ0wuZiYBPhksZoy4lfaF0k9cwNzY5upEW/VWdw3w==", + "license": "MIT" + }, + "node_modules/@chainsafe/libp2p-noise": { + "version": "16.0.0", + "resolved": "https://registry.npmjs.org/@chainsafe/libp2p-noise/-/libp2p-noise-16.0.0.tgz", + "integrity": "sha512-8rqr8V1RD2/lVbfL0Bb//N8iPOFof11cUe8v8z8xJT7fUhCAbtCCSM4jbwI4HCnw0MvHLmcpmAfDCFRwcWzoeA==", + "license": "Apache-2.0 OR MIT", + "dependencies": { + "@chainsafe/as-chacha20poly1305": "^0.1.0", + "@chainsafe/as-sha256": "^0.4.1", + "@libp2p/crypto": "^5.0.0", + "@libp2p/interface": "^2.0.0", + "@libp2p/peer-id": "^5.0.0", + "@noble/ciphers": "^0.6.0", + "@noble/curves": "^1.1.0", + "@noble/hashes": "^1.3.1", + "it-length-prefixed": "^9.0.1", + "it-length-prefixed-stream": "^1.0.0", + "it-pair": "^2.0.6", + "it-pipe": "^3.0.1", + "it-stream-types": "^2.0.1", + "protons-runtime": "^5.5.0", + "uint8arraylist": "^2.4.3", + "uint8arrays": "^5.0.0", + "wherearewe": "^2.0.1" + } + }, + "node_modules/@chainsafe/netmask": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@chainsafe/netmask/-/netmask-2.0.0.tgz", + "integrity": "sha512-I3Z+6SWUoaljh3TBzCnCxjlUyN8tA+NAk5L6m9IxvCf1BENQTePzPMis97CoN/iMW1St3WN+AWCCRp+TTBRiDg==", + "license": "MIT", + "dependencies": { + "@chainsafe/is-ip": "^2.0.1" + } + }, "node_modules/@esbuild/aix-ppc64": { "version": "0.21.5", "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.21.5.tgz", @@ -710,6 +763,61 @@ "node": "^18.18.0 || ^20.9.0 || >=21.1.0" } }, + "node_modules/@ethersproject/bytes": { + "version": "5.8.0", + "resolved": "https://registry.npmjs.org/@ethersproject/bytes/-/bytes-5.8.0.tgz", + "integrity": "sha512-vTkeohgJVCPVHu5c25XWaWQOZ4v+DkGoC42/TS2ond+PARCxTJvgTFUNDZovyQ/uAQ4EcpqqowKydcdmRKjg7A==", + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "license": "MIT", + "dependencies": { + "@ethersproject/logger": "^5.8.0" + } + }, + "node_modules/@ethersproject/logger": { + "version": "5.8.0", + "resolved": "https://registry.npmjs.org/@ethersproject/logger/-/logger-5.8.0.tgz", + "integrity": "sha512-Qe6knGmY+zPPWTC+wQrpitodgBfH7XoceCGL5bJVejmH+yCS3R8jJm8iiWuvWbG76RUmyEG53oqv6GMVWqunjA==", + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "license": "MIT" + }, + "node_modules/@ethersproject/rlp": { + "version": "5.8.0", + "resolved": "https://registry.npmjs.org/@ethersproject/rlp/-/rlp-5.8.0.tgz", + "integrity": "sha512-LqZgAznqDbiEunaUvykH2JAoXTT9NV0Atqk8rQN9nx9SEgThA/WMx5DnW8a9FOufo//6FZOCHZ+XiClzgbqV9Q==", + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "license": "MIT", + "dependencies": { + "@ethersproject/bytes": "^5.8.0", + "@ethersproject/logger": "^5.8.0" + } + }, "node_modules/@floating-ui/core": { "version": "1.6.8", "resolved": "https://registry.npmjs.org/@floating-ui/core/-/core-1.6.8.tgz", @@ -874,6 +982,420 @@ "@jridgewell/sourcemap-codec": "^1.4.14" } }, + "node_modules/@leichtgewicht/ip-codec": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@leichtgewicht/ip-codec/-/ip-codec-2.0.5.tgz", + "integrity": "sha512-Vo+PSpZG2/fmgmiNzYK9qWRh8h/CHrwD0mo1h1DzL4yzHNSfWYujGTYsWGreD000gcgmZ7K4Ys6Tx9TxtsKdDw==", + "license": "MIT" + }, + "node_modules/@libp2p/bootstrap": { + "version": "11.0.33", + "resolved": "https://registry.npmjs.org/@libp2p/bootstrap/-/bootstrap-11.0.33.tgz", + "integrity": "sha512-RQCHHlTx9jkZQY8k+qW/qkACmqBDD3Urzz/DwKLhnWubxz6ppG+QVnlQjfVArsH9jAUZ+t2m4RbklhdtcoZz2g==", + "license": "Apache-2.0 OR MIT", + "dependencies": { + "@libp2p/interface": "^2.8.0", + "@libp2p/interface-internal": "^2.3.10", + "@libp2p/peer-id": "^5.1.1", + "@multiformats/mafmt": "^12.1.6", + "@multiformats/multiaddr": "^12.3.3" + } + }, + "node_modules/@libp2p/crypto": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/@libp2p/crypto/-/crypto-5.1.0.tgz", + "integrity": "sha512-hcmScz9m7Ae7R7b/w3x9DX+i60ZIUVsMmsHyIo0vSlGsxO0+tyM4UKUia5EpSp/i1SB/W1IFXxlURwpiX7R5eQ==", + "license": "Apache-2.0 OR MIT", + "dependencies": { + "@libp2p/interface": "^2.8.0", + "@noble/curves": "^1.7.0", + "@noble/hashes": "^1.6.1", + "multiformats": "^13.3.1", + "protons-runtime": "^5.5.0", + "uint8arraylist": "^2.4.8", + "uint8arrays": "^5.1.0" + } + }, + "node_modules/@libp2p/identify": { + "version": "3.0.28", + "resolved": "https://registry.npmjs.org/@libp2p/identify/-/identify-3.0.28.tgz", + "integrity": "sha512-cD+cZAEqfoqGa25t9HfEjjSz/G/DVHpxF0C4dd8qC7bOuQl2ylSub5fqppbZGgHbolJ2nolTDG+8r3Vqh18Nhw==", + "license": "Apache-2.0 OR MIT", + "dependencies": { + "@libp2p/crypto": "^5.1.0", + "@libp2p/interface": "^2.8.0", + "@libp2p/interface-internal": "^2.3.10", + "@libp2p/peer-id": "^5.1.1", + "@libp2p/peer-record": "^8.0.26", + "@libp2p/utils": "^6.6.1", + "@multiformats/multiaddr": "^12.3.3", + "@multiformats/multiaddr-matcher": "^1.6.0", + "it-drain": "^3.0.7", + "it-parallel": "^3.0.8", + "it-protobuf-stream": "^2.0.1", + "protons-runtime": "^5.5.0", + "uint8arraylist": "^2.4.8", + "uint8arrays": "^5.1.0" + } + }, + "node_modules/@libp2p/interface": { + "version": "2.8.0", + "resolved": "https://registry.npmjs.org/@libp2p/interface/-/interface-2.8.0.tgz", + "integrity": "sha512-QnIjqqUv2aDiBho6OGcNNhLT3Ac4RKrh41qoQmqG6csMRkUUx/xZMkfFJx3j0wGCIP8GS4sGspkTt4wCpPbSWw==", + "license": "Apache-2.0 OR MIT", + "dependencies": { + "@multiformats/multiaddr": "^12.3.3", + "it-pushable": "^3.2.3", + "it-stream-types": "^2.0.2", + "multiformats": "^13.3.1", + "progress-events": "^1.0.1", + "uint8arraylist": "^2.4.8" + } + }, + "node_modules/@libp2p/interface-internal": { + "version": "2.3.10", + "resolved": "https://registry.npmjs.org/@libp2p/interface-internal/-/interface-internal-2.3.10.tgz", + "integrity": "sha512-ULUilEvRUVMy0qB7VWkW0v7Ceg66VqkZ0pheff3gkHj5tXaH4VNE0SSFKfK7b8dK1Wd/HBwS2QheX5uLrEt84w==", + "license": "Apache-2.0 OR MIT", + "dependencies": { + "@libp2p/interface": "^2.8.0", + "@libp2p/peer-collections": "^6.0.26", + "@multiformats/multiaddr": "^12.3.3", + "progress-events": "^1.0.1" + } + }, + "node_modules/@libp2p/logger": { + "version": "5.1.14", + "resolved": "https://registry.npmjs.org/@libp2p/logger/-/logger-5.1.14.tgz", + "integrity": "sha512-rJeEq7iuKMMjel0zzH10dXzcWn4Q2yywbv5vM9B1xTQpkD4uxTbBlQs+EL9+pmwaaQrrriEGqluZOTzHvUzJUg==", + "license": "Apache-2.0 OR MIT", + "dependencies": { + "@libp2p/interface": "^2.8.0", + "@multiformats/multiaddr": "^12.3.3", + "interface-datastore": "^8.3.1", + "multiformats": "^13.3.1", + "weald": "^1.0.4" + } + }, + "node_modules/@libp2p/mplex": { + "version": "11.0.33", + "resolved": "https://registry.npmjs.org/@libp2p/mplex/-/mplex-11.0.33.tgz", + "integrity": "sha512-JVD6qM7mvqZsmHBHPcSomJy/eMC8J98kOVzhHVO3IleVHZ5Iof7ilBEOAKxnpC+IG60CJYMaCC1kfv0c3u13zA==", + "license": "Apache-2.0 OR MIT", + "dependencies": { + "@libp2p/interface": "^2.8.0", + "@libp2p/utils": "^6.6.1", + "it-pipe": "^3.0.1", + "it-pushable": "^3.2.3", + "it-stream-types": "^2.0.2", + "uint8-varint": "^2.0.4", + "uint8arraylist": "^2.4.8", + "uint8arrays": "^5.1.0" + } + }, + "node_modules/@libp2p/multistream-select": { + "version": "6.0.21", + "resolved": "https://registry.npmjs.org/@libp2p/multistream-select/-/multistream-select-6.0.21.tgz", + "integrity": "sha512-l1c70p8ljrrqnm0y9m/3mvtkYhbGt5zPOpxRKVveWR2+OyqiPFa48uRktmpJcl4zwG5dHWMG/klhdHoNpetJpw==", + "license": "Apache-2.0 OR MIT", + "dependencies": { + "@libp2p/interface": "^2.8.0", + "it-length-prefixed": "^10.0.1", + "it-length-prefixed-stream": "^2.0.1", + "it-stream-types": "^2.0.2", + "p-defer": "^4.0.1", + "race-signal": "^1.1.2", + "uint8-varint": "^2.0.4", + "uint8arraylist": "^2.4.8", + "uint8arrays": "^5.1.0" + } + }, + "node_modules/@libp2p/multistream-select/node_modules/it-byte-stream": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/it-byte-stream/-/it-byte-stream-2.0.1.tgz", + "integrity": "sha512-WccB179tWRNjTyXJ9wLshQdKSLdVIexmnNjLfCT7UnsiLisTVUY092YqFhkL+da1WFR0paGzB24L+pAzFhRI4Q==", + "license": "Apache-2.0 OR MIT", + "dependencies": { + "abort-error": "^1.0.1", + "it-queueless-pushable": "^2.0.0", + "it-stream-types": "^2.0.2", + "race-signal": "^1.1.3", + "uint8arraylist": "^2.4.8" + } + }, + "node_modules/@libp2p/multistream-select/node_modules/it-length-prefixed": { + "version": "10.0.1", + "resolved": "https://registry.npmjs.org/it-length-prefixed/-/it-length-prefixed-10.0.1.tgz", + "integrity": "sha512-BhyluvGps26u9a7eQIpOI1YN7mFgi8lFwmiPi07whewbBARKAG9LE09Odc8s1Wtbt2MB6rNUrl7j9vvfXTJwdQ==", + "license": "Apache-2.0 OR MIT", + "dependencies": { + "it-reader": "^6.0.1", + "it-stream-types": "^2.0.1", + "uint8-varint": "^2.0.1", + "uint8arraylist": "^2.0.0", + "uint8arrays": "^5.0.1" + }, + "engines": { + "node": ">=16.0.0", + "npm": ">=7.0.0" + } + }, + "node_modules/@libp2p/multistream-select/node_modules/it-length-prefixed-stream": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/it-length-prefixed-stream/-/it-length-prefixed-stream-2.0.1.tgz", + "integrity": "sha512-TFohjVrQKRLQgRrPdVL9ARqP4CHUHnsRkbkX4nEhSOBjOvZtVV/pHh5Z2C8EH50MnfNDjVSKvEbaIFVLS3/QMA==", + "license": "Apache-2.0 OR MIT", + "dependencies": { + "abort-error": "^1.0.1", + "it-byte-stream": "^2.0.0", + "it-stream-types": "^2.0.2", + "uint8-varint": "^2.0.4", + "uint8arraylist": "^2.4.8" + } + }, + "node_modules/@libp2p/multistream-select/node_modules/it-queueless-pushable": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/it-queueless-pushable/-/it-queueless-pushable-2.0.0.tgz", + "integrity": "sha512-MlNnefWT/ntv5fesrHpxwVIu6ZdtlkN0A4aaJiE5wnmPMBv9ttiwX3UEMf78dFwIj5ZNaU9usYXg4swMEpUNJQ==", + "license": "Apache-2.0 OR MIT", + "dependencies": { + "abort-error": "^1.0.1", + "p-defer": "^4.0.1", + "race-signal": "^1.1.3" + } + }, + "node_modules/@libp2p/peer-collections": { + "version": "6.0.26", + "resolved": "https://registry.npmjs.org/@libp2p/peer-collections/-/peer-collections-6.0.26.tgz", + "integrity": "sha512-bpo4Oim+pvZh6AiIPjYDVb2Us6siJnRBWmyEzrV5t+EmGdLUjOKmRD3NnBp2WoO3RYAMESDyBrpxjnZo5ydHCA==", + "license": "Apache-2.0 OR MIT", + "dependencies": { + "@libp2p/interface": "^2.8.0", + "@libp2p/peer-id": "^5.1.1", + "@libp2p/utils": "^6.6.1", + "multiformats": "^13.3.1" + } + }, + "node_modules/@libp2p/peer-id": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/@libp2p/peer-id/-/peer-id-5.1.1.tgz", + "integrity": "sha512-dVpgln2gWybglCC8hiQqyGlyXU7F7ovoOqwnnMs8HxurGEH9QxgmCfxRP4p8s86bQwl1MFbyj0AqYPy/zbKLrA==", + "license": "Apache-2.0 OR MIT", + "dependencies": { + "@libp2p/crypto": "^5.1.0", + "@libp2p/interface": "^2.8.0", + "multiformats": "^13.3.1", + "uint8arrays": "^5.1.0" + } + }, + "node_modules/@libp2p/peer-record": { + "version": "8.0.26", + "resolved": "https://registry.npmjs.org/@libp2p/peer-record/-/peer-record-8.0.26.tgz", + "integrity": "sha512-uZrGsZ7JLwY2B60El60AGcYjdcB87J596vyY722adQshLLiTTafkEZeHDSVVC3k5R8EP0gwrIEidi3xtPYRT5w==", + "license": "Apache-2.0 OR MIT", + "dependencies": { + "@libp2p/crypto": "^5.1.0", + "@libp2p/interface": "^2.8.0", + "@libp2p/peer-id": "^5.1.1", + "@libp2p/utils": "^6.6.1", + "@multiformats/multiaddr": "^12.3.3", + "multiformats": "^13.3.1", + "protons-runtime": "^5.5.0", + "uint8-varint": "^2.0.4", + "uint8arraylist": "^2.4.8", + "uint8arrays": "^5.1.0" + } + }, + "node_modules/@libp2p/peer-store": { + "version": "11.1.3", + "resolved": "https://registry.npmjs.org/@libp2p/peer-store/-/peer-store-11.1.3.tgz", + "integrity": "sha512-RTSFHLXklOcGVXbuEZMfn4qFKxELGnSJkIRfh9RHxSWUbD8gwisrp9+Wecd9QYAu5sVeCmk2tPt/EhPdJDWCeQ==", + "license": "Apache-2.0 OR MIT", + "dependencies": { + "@libp2p/crypto": "^5.1.0", + "@libp2p/interface": "^2.8.0", + "@libp2p/peer-id": "^5.1.1", + "@libp2p/peer-record": "^8.0.26", + "@multiformats/multiaddr": "^12.3.3", + "interface-datastore": "^8.3.1", + "it-all": "^3.0.6", + "mortice": "^3.0.6", + "multiformats": "^13.3.1", + "protons-runtime": "^5.5.0", + "uint8arraylist": "^2.4.8", + "uint8arrays": "^5.1.0" + } + }, + "node_modules/@libp2p/ping": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/@libp2p/ping/-/ping-2.0.1.tgz", + "integrity": "sha512-KWbzFRDBJyZDd8FziW1N9UKHBcOm2RIVyX7sQh1tFeJ0XpWkNT3IcljOG1STikXTuCXIZmMgan/LrZ+SvJSIGw==", + "license": "Apache-2.0 OR MIT", + "dependencies": { + "@libp2p/crypto": "^5.0.1", + "@libp2p/interface": "^2.0.1", + "@libp2p/interface-internal": "^2.0.1", + "@multiformats/multiaddr": "^12.2.3", + "it-first": "^3.0.6", + "it-pipe": "^3.0.1", + "uint8arrays": "^5.1.0" + } + }, + "node_modules/@libp2p/utils": { + "version": "6.6.1", + "resolved": "https://registry.npmjs.org/@libp2p/utils/-/utils-6.6.1.tgz", + "integrity": "sha512-7/oJ+GX+pvM8bDe55VsmpuuBZS/HIYp/+DCyHqnm6o6d6rFSpF/yuVhKGK29P0MNgApzHeHrwfnvzPXrz64d3A==", + "license": "Apache-2.0 OR MIT", + "dependencies": { + "@chainsafe/is-ip": "^2.0.2", + "@chainsafe/netmask": "^2.0.0", + "@libp2p/crypto": "^5.1.0", + "@libp2p/interface": "^2.8.0", + "@libp2p/logger": "^5.1.14", + "@multiformats/multiaddr": "^12.3.3", + "@sindresorhus/fnv1a": "^3.1.0", + "any-signal": "^4.1.1", + "delay": "^6.0.0", + "get-iterator": "^2.0.1", + "is-loopback-addr": "^2.0.2", + "it-foreach": "^2.1.1", + "it-pipe": "^3.0.1", + "it-pushable": "^3.2.3", + "it-stream-types": "^2.0.2", + "netmask": "^2.0.2", + "p-defer": "^4.0.1", + "race-event": "^1.3.0", + "race-signal": "^1.1.2", + "uint8arraylist": "^2.4.8", + "uint8arrays": "^5.1.0" + } + }, + "node_modules/@libp2p/websockets": { + "version": "9.2.9", + "resolved": "https://registry.npmjs.org/@libp2p/websockets/-/websockets-9.2.9.tgz", + "integrity": "sha512-fXe/VmEuUCXseuJaUo9ZIK2LCIqxebWkg5kQOCFMt+HG2OeZ3uRNXKiCysoXDCmqb8iKnfGwbS3cf+14eI3UEQ==", + "license": "Apache-2.0 OR MIT", + "dependencies": { + "@libp2p/interface": "^2.8.0", + "@libp2p/utils": "^6.6.1", + "@multiformats/multiaddr": "^12.3.3", + "@multiformats/multiaddr-matcher": "^1.6.0", + "@multiformats/multiaddr-to-uri": "^11.0.0", + "@types/ws": "^8.5.13", + "it-ws": "^6.1.5", + "p-defer": "^4.0.1", + "p-event": "^6.0.1", + "progress-events": "^1.0.1", + "race-signal": "^1.1.2", + "ws": "^8.18.0" + } + }, + "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==", + "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", + "p-queue": "^8.0.1", + "progress-events": "^1.0.0", + "uint8arrays": "^5.0.2" + } + }, + "node_modules/@multiformats/mafmt": { + "version": "12.1.6", + "resolved": "https://registry.npmjs.org/@multiformats/mafmt/-/mafmt-12.1.6.tgz", + "integrity": "sha512-tlJRfL21X+AKn9b5i5VnaTD6bNttpSpcqwKVmDmSHLwxoz97fAHaepqFOk/l1fIu94nImIXneNbhsJx/RQNIww==", + "license": "Apache-2.0 OR MIT", + "dependencies": { + "@multiformats/multiaddr": "^12.0.0" + } + }, + "node_modules/@multiformats/multiaddr": { + "version": "12.4.0", + "resolved": "https://registry.npmjs.org/@multiformats/multiaddr/-/multiaddr-12.4.0.tgz", + "integrity": "sha512-FL7yBTLijJ5JkO044BGb2msf+uJLrwpD6jD6TkXlbjA9N12+18HT40jvd4o5vL4LOJMc86dPX6tGtk/uI9kYKg==", + "license": "Apache-2.0 OR MIT", + "dependencies": { + "@chainsafe/is-ip": "^2.0.1", + "@chainsafe/netmask": "^2.0.0", + "@multiformats/dns": "^1.0.3", + "multiformats": "^13.0.0", + "uint8-varint": "^2.0.1", + "uint8arrays": "^5.0.0" + } + }, + "node_modules/@multiformats/multiaddr-matcher": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/@multiformats/multiaddr-matcher/-/multiaddr-matcher-1.7.0.tgz", + "integrity": "sha512-WfobrJy7XLaYL7PQ3IcFoXdGN5jmdv5FsuKQkZIIreC1pSR4Q9PSOWu2ULxP/M2JT738Xny0PFoCke0ENbyfww==", + "license": "Apache-2.0 OR MIT", + "dependencies": { + "@chainsafe/is-ip": "^2.0.1", + "@multiformats/multiaddr": "^12.0.0", + "multiformats": "^13.0.0" + } + }, + "node_modules/@multiformats/multiaddr-to-uri": { + "version": "11.0.0", + "resolved": "https://registry.npmjs.org/@multiformats/multiaddr-to-uri/-/multiaddr-to-uri-11.0.0.tgz", + "integrity": "sha512-9RNmlIGwZbBLsHekT50dbt4o4u8Iciw9kGjv+WHiGxQdsJ6xKKjU1+C0Vbas6RilMbaVOAOnEyfNcXbUmTkLxQ==", + "license": "Apache-2.0 OR MIT", + "dependencies": { + "@multiformats/multiaddr": "^12.3.0" + } + }, + "node_modules/@noble/ciphers": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/@noble/ciphers/-/ciphers-0.6.0.tgz", + "integrity": "sha512-mIbq/R9QXk5/cTfESb1OKtyFnk7oc1Om/8onA1158K9/OZUQFDEVy55jVTato+xmp3XX6F6Qh0zz0Nc1AxAlRQ==", + "license": "MIT", + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/@noble/curves": { + "version": "1.8.2", + "resolved": "https://registry.npmjs.org/@noble/curves/-/curves-1.8.2.tgz", + "integrity": "sha512-vnI7V6lFNe0tLAuJMu+2sX+FcL14TaCWy1qiczg1VwRmPrpQCdq5ESXQMqUc2tluRNf6irBXrWbl1mGN8uaU/g==", + "license": "MIT", + "dependencies": { + "@noble/hashes": "1.7.2" + }, + "engines": { + "node": "^14.21.3 || >=16" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/@noble/hashes": { + "version": "1.7.2", + "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.7.2.tgz", + "integrity": "sha512-biZ0NUSxyjLLqo6KxEJ1b+C2NAx0wtDoFvCaXHGgUkeHzf3Xc1xKumFKREuT7f7DARNZ/slvYUwFG6B0f2b6hQ==", + "license": "MIT", + "engines": { + "node": "^14.21.3 || >=16" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/@noble/secp256k1": { + "version": "1.7.2", + "resolved": "https://registry.npmjs.org/@noble/secp256k1/-/secp256k1-1.7.2.tgz", + "integrity": "sha512-/qzwYl5eFLH8OWIecQWM31qld2g1NfjgylK+TNhqtaUKP37Nm+Y+z30Fjhw0Ct8p9yCQEm2N3W/AckdIb3SMcQ==", + "funding": [ + { + "type": "individual", + "url": "https://paulmillr.com/funding/" + } + ], + "license": "MIT" + }, "node_modules/@nodelib/fs.scandir": { "version": "2.1.5", "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", @@ -2542,6 +3064,18 @@ "win32" ] }, + "node_modules/@sindresorhus/fnv1a": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/@sindresorhus/fnv1a/-/fnv1a-3.1.0.tgz", + "integrity": "sha512-KV321z5m/0nuAg83W1dPLy85HpHDk7Sdi4fJbwvacWsEhAh+rZUW4ZfGcXmUIvjZg4ss2bcwNlRhJ7GBEUG08w==", + "license": "MIT", + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/@swc/core": { "version": "1.7.39", "resolved": "https://registry.npmjs.org/@swc/core/-/core-1.7.39.tgz", @@ -2885,6 +3419,15 @@ "integrity": "sha512-Ps3T8E8dZDam6fUyNiMkekK3XUsaUEik+idO9/YjPtfj2qruF8tFBXS7XhtE4iIXBLxhmLjP3SXpLhVf21I9Lw==", "license": "MIT" }, + "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.6", "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.6.tgz", @@ -2903,7 +3446,6 @@ "version": "22.7.9", "resolved": "https://registry.npmjs.org/@types/node/-/node-22.7.9.tgz", "integrity": "sha512-jrTfRC7FM6nChvU7X2KqcrgquofrWLFDeYC1hKfwNWomVvrn7JIksqf344WN2X/y8xrgqBd2dJATZV4GbatBfg==", - "dev": true, "license": "MIT", "dependencies": { "undici-types": "~6.19.2" @@ -2937,6 +3479,21 @@ "@types/react": "*" } }, + "node_modules/@types/retry": { + "version": "0.12.2", + "resolved": "https://registry.npmjs.org/@types/retry/-/retry-0.12.2.tgz", + "integrity": "sha512-XISRgDJ2Tc5q4TRqvgJtzsRkFYNJzZrhTdtMoGVBttwzzQJkPnS3WWTFc7kuDRoPtPakl+T+OfdEUjYJj7Jbow==", + "license": "MIT" + }, + "node_modules/@types/ws": { + "version": "8.18.1", + "resolved": "https://registry.npmjs.org/@types/ws/-/ws-8.18.1.tgz", + "integrity": "sha512-ThVF6DCVhA8kUGy+aazFQ4kXQ7E1Ty7A3ypFOe0IcJV8O/M511G99AW24irKrW56Wt44yG9+ij8FaqoBGkuBXg==", + "license": "MIT", + "dependencies": { + "@types/node": "*" + } + }, "node_modules/@typescript-eslint/eslint-plugin": { "version": "8.11.0", "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.11.0.tgz", @@ -3179,6 +3736,171 @@ "vite": "^4 || ^5" } }, + "node_modules/@waku/core": { + "version": "0.0.34", + "resolved": "https://registry.npmjs.org/@waku/core/-/core-0.0.34.tgz", + "integrity": "sha512-vkDE4KCN4hWops9JVaVQVzhMidzq4YhAqPJ2t2hrcbQ4uFwZznQSPxQI1hc3CoZ8WK8E2JYCCPfl0/RqEpauDQ==", + "license": "MIT OR Apache-2.0", + "dependencies": { + "@libp2p/ping": "2.0.1", + "@waku/enr": "^0.0.28", + "@waku/interfaces": "0.0.29", + "@waku/proto": "0.0.9", + "@waku/utils": "0.0.22", + "debug": "^4.3.4", + "it-all": "^3.0.4", + "it-length-prefixed": "^9.0.4", + "it-pipe": "^3.0.1", + "uint8arraylist": "^2.4.3", + "uuid": "^9.0.0" + }, + "engines": { + "node": ">=20" + }, + "peerDependencies": { + "@multiformats/multiaddr": "^12.0.0", + "libp2p": "2.1.8" + }, + "peerDependenciesMeta": { + "@multiformats/multiaddr": { + "optional": true + }, + "libp2p": { + "optional": true + } + } + }, + "node_modules/@waku/discovery": { + "version": "0.0.7", + "resolved": "https://registry.npmjs.org/@waku/discovery/-/discovery-0.0.7.tgz", + "integrity": "sha512-i0YNG5J8wh/S7/Dba+aJiHjrZ2NaxM6bX4/kRbXpZjMXqUYphH3C/x8FX5SzXnvqYKXQBNMN6ejCdNDsy4tyog==", + "license": "MIT OR Apache-2.0", + "dependencies": { + "@waku/core": "0.0.34", + "@waku/enr": "0.0.28", + "@waku/interfaces": "0.0.29", + "@waku/proto": "^0.0.9", + "@waku/utils": "0.0.22", + "debug": "^4.3.4", + "dns-over-http-resolver": "^3.0.8", + "hi-base32": "^0.5.1", + "uint8arrays": "^5.0.1" + }, + "engines": { + "node": ">=20" + } + }, + "node_modules/@waku/enr": { + "version": "0.0.28", + "resolved": "https://registry.npmjs.org/@waku/enr/-/enr-0.0.28.tgz", + "integrity": "sha512-wOTWW63SS/+8A+fA6H9Wfmq4lHA+v1y9hsyquN4rTodO2hvIn/nqnbnSJAnR+13PCaglhsG0nM1bo4hcGQcTAA==", + "license": "MIT OR Apache-2.0", + "dependencies": { + "@ethersproject/rlp": "^5.7.0", + "@libp2p/crypto": "^5.0.1", + "@libp2p/peer-id": "^5.0.1", + "@multiformats/multiaddr": "^12.0.0", + "@noble/secp256k1": "^1.7.1", + "@waku/utils": "0.0.22", + "debug": "^4.3.4", + "js-sha3": "^0.9.2" + }, + "engines": { + "node": ">=20" + }, + "peerDependencies": { + "@multiformats/multiaddr": "^12.0.0" + }, + "peerDependenciesMeta": { + "@multiformats/multiaddr": { + "optional": true + } + } + }, + "node_modules/@waku/interfaces": { + "version": "0.0.29", + "resolved": "https://registry.npmjs.org/@waku/interfaces/-/interfaces-0.0.29.tgz", + "integrity": "sha512-FO5rSMLMfnFiz17h8dyVlqc68lW/11FK0JzMtMu8oeYrfcT9jAj6fBzd9gD/gibaKVt68kbRf6CxoZUzk9qEKQ==", + "license": "MIT OR Apache-2.0", + "dependencies": { + "@waku/proto": "^0.0.9" + }, + "engines": { + "node": ">=20" + } + }, + "node_modules/@waku/message-hash": { + "version": "0.1.18", + "resolved": "https://registry.npmjs.org/@waku/message-hash/-/message-hash-0.1.18.tgz", + "integrity": "sha512-14bNu3+cgtjRoMm0BtC7/7/KP/pVBAuKeLa8Qe6WZ7tDX23YCiQkuMWXhBSq8KihO6la2chWpPAg48SGwrw+mA==", + "license": "MIT OR Apache-2.0", + "dependencies": { + "@noble/hashes": "^1.3.2", + "@waku/utils": "0.0.22" + }, + "engines": { + "node": ">=20" + } + }, + "node_modules/@waku/proto": { + "version": "0.0.9", + "resolved": "https://registry.npmjs.org/@waku/proto/-/proto-0.0.9.tgz", + "integrity": "sha512-bSZ1cQLqifxI5ifYsPrHHZT7iy5En5dMKw2hK4qp+x9+EcNeoz0wzlbFEo0RhIAkdaQ+w7nWMcfWr7iTbX8IUw==", + "license": "MIT OR Apache-2.0", + "dependencies": { + "protons-runtime": "^5.4.0" + }, + "engines": { + "node": ">=20" + } + }, + "node_modules/@waku/sdk": { + "version": "0.0.30", + "resolved": "https://registry.npmjs.org/@waku/sdk/-/sdk-0.0.30.tgz", + "integrity": "sha512-Z0cjfcab6kflZv5fDQnhcx4bt7K0D2R3uda4/IUqK1snRtrmGkJrFpTIfObl/37wWxyHowgctty4J9HY48Rg8A==", + "license": "MIT OR Apache-2.0", + "dependencies": { + "@chainsafe/libp2p-noise": "16.0.0", + "@libp2p/bootstrap": "^11.0.1", + "@libp2p/identify": "^3.0.1", + "@libp2p/mplex": "^11.0.1", + "@libp2p/ping": "2.0.1", + "@libp2p/websockets": "^9.0.1", + "@noble/hashes": "^1.3.3", + "@waku/core": "0.0.34", + "@waku/discovery": "0.0.7", + "@waku/interfaces": "0.0.29", + "@waku/message-hash": "0.1.18", + "@waku/proto": "^0.0.9", + "@waku/utils": "0.0.22", + "libp2p": "2.1.8" + }, + "engines": { + "node": ">=20" + } + }, + "node_modules/@waku/utils": { + "version": "0.0.22", + "resolved": "https://registry.npmjs.org/@waku/utils/-/utils-0.0.22.tgz", + "integrity": "sha512-LwhZQU4xXTv0yIWK+1prw7PdZHhiDV2s6ogx1n5f26OyF8amGTt2VcuMSNOAgVTR5ZBbZ5LzEDmQZUx3n5kTbw==", + "license": "MIT OR Apache-2.0", + "dependencies": { + "@noble/hashes": "^1.3.2", + "@waku/interfaces": "0.0.29", + "chai": "^4.3.10", + "debug": "^4.3.4", + "uint8arrays": "^5.0.1" + }, + "engines": { + "node": ">=20" + } + }, + "node_modules/abort-error": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/abort-error/-/abort-error-1.0.1.tgz", + "integrity": "sha512-fxqCblJiIPdSXIUrxI0PL+eJG49QdP9SQ70qtB65MVAoMr2rASlOyAbJFOylfB467F/f+5BCLJJq58RYi7mGfg==", + "license": "Apache-2.0 OR MIT" + }, "node_modules/acorn": { "version": "8.13.0", "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.13.0.tgz", @@ -3252,6 +3974,16 @@ "integrity": "sha512-7UvmKalWRt1wgjL1RrGxoSJW/0QZFIegpeGvZG9kjp8vrRu55XTHbwnqq2GpXm9uLbcuhxm3IqX9OB4MZR1b2A==", "license": "MIT" }, + "node_modules/any-signal": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/any-signal/-/any-signal-4.1.1.tgz", + "integrity": "sha512-iADenERppdC+A2YKbOXXB2WUeABLaM6qnpZ70kZbPZ1cZMMJ7eF+3CaYm+/PhBizgkzlvssC7QuHS30oOiQYWA==", + "license": "Apache-2.0 OR MIT", + "engines": { + "node": ">=16.0.0", + "npm": ">=7.0.0" + } + }, "node_modules/anymatch": { "version": "3.1.3", "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz", @@ -3290,6 +4022,15 @@ "node": ">=10" } }, + "node_modules/assertion-error": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-1.1.0.tgz", + "integrity": "sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw==", + "license": "MIT", + "engines": { + "node": "*" + } + }, "node_modules/autoprefixer": { "version": "10.4.20", "resolved": "https://registry.npmjs.org/autoprefixer/-/autoprefixer-10.4.20.tgz", @@ -3334,6 +4075,26 @@ "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", "license": "MIT" }, + "node_modules/base64-js": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", + "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT" + }, "node_modules/binary-extensions": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.3.0.tgz", @@ -3402,6 +4163,30 @@ "node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7" } }, + "node_modules/buffer": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz", + "integrity": "sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT", + "dependencies": { + "base64-js": "^1.3.1", + "ieee754": "^1.2.1" + } + }, "node_modules/callsites": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", @@ -3442,6 +4227,24 @@ ], "license": "CC-BY-4.0" }, + "node_modules/chai": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/chai/-/chai-4.5.0.tgz", + "integrity": "sha512-RITGBfijLkBddZvnn8jdqoTypxvqbOLYQkGGxXzeFjVHvudaPw0HNFD9x928/eUwYWd2dPCugVqspGALTZZQKw==", + "license": "MIT", + "dependencies": { + "assertion-error": "^1.1.0", + "check-error": "^1.0.3", + "deep-eql": "^4.1.3", + "get-func-name": "^2.0.2", + "loupe": "^2.3.6", + "pathval": "^1.1.1", + "type-detect": "^4.1.0" + }, + "engines": { + "node": ">=4" + } + }, "node_modules/chalk": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", @@ -3459,6 +4262,18 @@ "url": "https://github.com/chalk/chalk?sponsor=1" } }, + "node_modules/check-error": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/check-error/-/check-error-1.0.3.tgz", + "integrity": "sha512-iKEoDYaRmd1mxM90a2OEfWhjsjPpYPuQ+lMYsoxB126+t8fw7ySEO48nmDg5COTjxDI65/Y2OWpeEHk3ZOe8zg==", + "license": "MIT", + "dependencies": { + "get-func-name": "^2.0.2" + }, + "engines": { + "node": "*" + } + }, "node_modules/chokidar": { "version": "3.6.0", "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.6.0.tgz", @@ -4079,6 +4894,25 @@ "node": ">=12" } }, + "node_modules/datastore-core": { + "version": "10.0.2", + "resolved": "https://registry.npmjs.org/datastore-core/-/datastore-core-10.0.2.tgz", + "integrity": "sha512-B3WXxI54VxJkpXxnYibiF17si3bLXE1XOjrJB7wM5co9fx2KOEkiePDGiCCEtnapFHTnmAnYCPdA7WZTIpdn/A==", + "license": "Apache-2.0 OR MIT", + "dependencies": { + "@libp2p/logger": "^5.0.1", + "interface-datastore": "^8.0.0", + "interface-store": "^6.0.0", + "it-drain": "^3.0.7", + "it-filter": "^3.1.1", + "it-map": "^3.1.1", + "it-merge": "^3.0.5", + "it-pipe": "^3.0.1", + "it-pushable": "^3.2.3", + "it-sort": "^3.0.6", + "it-take": "^3.0.6" + } + }, "node_modules/date-fns": { "version": "3.6.0", "resolved": "https://registry.npmjs.org/date-fns/-/date-fns-3.6.0.tgz", @@ -4093,7 +4927,6 @@ "version": "4.3.7", "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz", "integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==", - "dev": true, "license": "MIT", "dependencies": { "ms": "^2.1.3" @@ -4113,6 +4946,18 @@ "integrity": "sha512-qIMFpTMZmny+MMIitAB6D7iVPEorVw6YQRWkvarTkT4tBeSLLiHzcwj6q0MmYSFCiVpiqPJTJEYIrpcPzVEIvg==", "license": "MIT" }, + "node_modules/deep-eql": { + "version": "4.1.4", + "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-4.1.4.tgz", + "integrity": "sha512-SUwdGfqdKOwxCPeVYjwSyRpJ7Z+fhpwIAtmCUdZIWZ/YP5R9WAsyuSgpLVDi9bjWoN2LXHNss/dk3urXtdQxGg==", + "license": "MIT", + "dependencies": { + "type-detect": "^4.0.0" + }, + "engines": { + "node": ">=6" + } + }, "node_modules/deep-is": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", @@ -4120,6 +4965,18 @@ "dev": true, "license": "MIT" }, + "node_modules/delay": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/delay/-/delay-6.0.0.tgz", + "integrity": "sha512-2NJozoOHQ4NuZuVIr5CWd0iiLVIRSDepakaovIN+9eIDHEhdCAEvSy2cuf1DCrPPQLvHmbqTHODlhHg8UCy4zw==", + "license": "MIT", + "engines": { + "node": ">=16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/detect-node-es": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/detect-node-es/-/detect-node-es-1.1.0.tgz", @@ -4138,6 +4995,28 @@ "integrity": "sha512-+HlytyjlPKnIG8XuRG8WvmBP8xs8P71y+SKKS6ZXWoEgLuePxtDoUEiH7WkdePWrQ5JBpE6aoVqfZfJUQkjXwA==", "license": "MIT" }, + "node_modules/dns-over-http-resolver": { + "version": "3.0.10", + "resolved": "https://registry.npmjs.org/dns-over-http-resolver/-/dns-over-http-resolver-3.0.10.tgz", + "integrity": "sha512-l2kMOLxK6f9ll+5sf2Ndl8WS/2eXhOf9ZSXZMPnTVyHsv1ktN1WX3FwcyYklMq3ORv2N1nhf0TsGKWBjhgn0ug==", + "license": "Apache-2.0 OR MIT", + "dependencies": { + "quick-lru": "^7.0.0", + "weald": "^1.0.2" + } + }, + "node_modules/dns-packet": { + "version": "5.6.1", + "resolved": "https://registry.npmjs.org/dns-packet/-/dns-packet-5.6.1.tgz", + "integrity": "sha512-l4gcSouhcgIKRvyy99RNVOgxXiicE+2jZoNmaNmZ6JXiGajBOJAesk1OBlJuM5k2c+eudGdLxDqXuPCKIj6kpw==", + "license": "MIT", + "dependencies": { + "@leichtgewicht/ip-codec": "^2.0.1" + }, + "engines": { + "node": ">=6" + } + }, "node_modules/dom-helpers": { "version": "5.2.1", "resolved": "https://registry.npmjs.org/dom-helpers/-/dom-helpers-5.2.1.tgz", @@ -4445,6 +5324,12 @@ "node": ">=0.10.0" } }, + "node_modules/event-iterator": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/event-iterator/-/event-iterator-2.0.0.tgz", + "integrity": "sha512-KGft0ldl31BZVV//jj+IAIGCxkvvUkkON+ScH6zfoX+l+omX6001ggyRSpI0Io2Hlro0ThXotswCtfzS8UkIiQ==", + "license": "MIT" + }, "node_modules/eventemitter3": { "version": "4.0.7", "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-4.0.7.tgz", @@ -4634,6 +5519,21 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/get-func-name": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.2.tgz", + "integrity": "sha512-8vXOvuE167CtIc3OyItco7N/dpRtBbYOsPsXCz7X/PMnlGjYjSGuZJgM1Y7mmew7BKf9BqvLX2tnOVy1BBUsxQ==", + "license": "MIT", + "engines": { + "node": "*" + } + }, + "node_modules/get-iterator": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/get-iterator/-/get-iterator-2.0.1.tgz", + "integrity": "sha512-7HuY/hebu4gryTDT7O/XY/fvY9wRByEGdK6QOa4of8npTcv0+NS6frFKABcf6S9EBAsveTuKTsZQQBFMMNILIg==", + "license": "MIT" + }, "node_modules/get-nonce": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/get-nonce/-/get-nonce-1.0.1.tgz", @@ -4729,6 +5629,12 @@ "node": ">=8" } }, + "node_modules/hashlru": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/hashlru/-/hashlru-2.3.0.tgz", + "integrity": "sha512-0cMsjjIC8I+D3M44pOQdsy0OHXGLVz6Z0beRuufhKa0KfaD2wGwAev6jILzXsd3/vpnNQJmWyZtIILqM1N+n5A==", + "license": "MIT" + }, "node_modules/hasown": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", @@ -4741,6 +5647,32 @@ "node": ">= 0.4" } }, + "node_modules/hi-base32": { + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/hi-base32/-/hi-base32-0.5.1.tgz", + "integrity": "sha512-EmBBpvdYh/4XxsnUybsPag6VikPYnN30td+vQk+GI3qpahVEG9+gTkG0aXVxTjBqQ5T6ijbWIu77O+C5WFWsnA==", + "license": "MIT" + }, + "node_modules/ieee754": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", + "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "BSD-3-Clause" + }, "node_modules/ignore": { "version": "5.3.2", "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.2.tgz", @@ -4788,6 +5720,22 @@ "react-dom": "^16.8 || ^17.0 || ^18.0" } }, + "node_modules/interface-datastore": { + "version": "8.3.1", + "resolved": "https://registry.npmjs.org/interface-datastore/-/interface-datastore-8.3.1.tgz", + "integrity": "sha512-3r0ETmHIi6HmvM5sc09QQiCD3gUfwtEM/AAChOyAd/UAKT69uk8LXfTSUBufbUIO/dU65Vj8nb9O6QjwW8vDSQ==", + "license": "Apache-2.0 OR MIT", + "dependencies": { + "interface-store": "^6.0.0", + "uint8arrays": "^5.1.0" + } + }, + "node_modules/interface-store": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/interface-store/-/interface-store-6.0.2.tgz", + "integrity": "sha512-KSFCXtBlNoG0hzwNa0RmhHtrdhzexp+S+UY2s0rWTBJyfdEIgn6i6Zl9otVqrcFYbYrneBT7hbmHQ8gE0C3umA==", + "license": "Apache-2.0 OR MIT" + }, "node_modules/internmap": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/internmap/-/internmap-2.0.3.tgz", @@ -4833,6 +5781,12 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/is-electron": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/is-electron/-/is-electron-2.2.2.tgz", + "integrity": "sha512-FO/Rhvz5tuw4MCWkpMzHFKWD2LsfHzIb7i6MdPYZ/KW7AlxawyLkqdy+jPZP1WubqEADE3O4FUENlJHDfQASRg==", + "license": "MIT" + }, "node_modules/is-extglob": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", @@ -4863,6 +5817,24 @@ "node": ">=0.10.0" } }, + "node_modules/is-loopback-addr": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/is-loopback-addr/-/is-loopback-addr-2.0.2.tgz", + "integrity": "sha512-26POf2KRCno/KTNL5Q0b/9TYnL00xEsSaLfiFRmjM7m7Lw7ZMmFybzzuX4CcsLAluZGd+niLUiMRxEooVE3aqg==", + "license": "MIT" + }, + "node_modules/is-network-error": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-network-error/-/is-network-error-1.1.0.tgz", + "integrity": "sha512-tUdRRAnhT+OtCZR/LxZelH/C7QtjtFrTu5tXCA8pl55eTUElUHT+GPYV8MBMBvea/j+NxQqVt3LbWMRir7Gx9g==", + "license": "MIT", + "engines": { + "node": ">=16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/is-number": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", @@ -4872,12 +5844,290 @@ "node": ">=0.12.0" } }, + "node_modules/is-plain-obj": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-2.1.0.tgz", + "integrity": "sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA==", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, "node_modules/isexe": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", "license": "ISC" }, + "node_modules/it-all": { + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/it-all/-/it-all-3.0.7.tgz", + "integrity": "sha512-PkuYtu6XhJzuPTKXImd6y0qE6H91MUPV/b9xotXMAI6GjmD2v3NoHj2g5L0lS2qZ0EzyGWZU1kp0UxW8POvNBQ==", + "license": "Apache-2.0 OR MIT" + }, + "node_modules/it-byte-stream": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/it-byte-stream/-/it-byte-stream-1.1.1.tgz", + "integrity": "sha512-OIOb8PvK9ZV7MHvyxIDNyN3jmrxrJdx99G0RIYYb3Tzo1OWv+O1C6mfg7nnlDuuTQz2POYFXe87AShKAEl+POw==", + "license": "Apache-2.0 OR MIT", + "dependencies": { + "it-queueless-pushable": "^1.0.0", + "it-stream-types": "^2.0.2", + "uint8arraylist": "^2.4.8" + } + }, + "node_modules/it-drain": { + "version": "3.0.8", + "resolved": "https://registry.npmjs.org/it-drain/-/it-drain-3.0.8.tgz", + "integrity": "sha512-eeOz+WwKc11ou1UuqZympcXPLCjpTn5ALcYFJiHeTEiYEZ2py/J1vq41XWYj88huCUiqp9iNHfObOKrbIk5Izw==", + "license": "Apache-2.0 OR MIT" + }, + "node_modules/it-filter": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/it-filter/-/it-filter-3.1.2.tgz", + "integrity": "sha512-2AozaGjIvBBiB7t7MpVNug9kwofqmKSpvgW7zhuyvCs6xxDd6FrfvqyfYtlQTKLNP+Io1WeXko1UQhdlK4M0gg==", + "license": "Apache-2.0 OR MIT", + "dependencies": { + "it-peekable": "^3.0.0" + } + }, + "node_modules/it-first": { + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/it-first/-/it-first-3.0.7.tgz", + "integrity": "sha512-e2dVSlOP+pAxPYPVJBF4fX7au8cvGfvLhIrGCMc5aWDnCvwgOo94xHbi3Da6eXQ2jPL5FGEM8sJMn5uE8Seu+g==", + "license": "Apache-2.0 OR MIT" + }, + "node_modules/it-foreach": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/it-foreach/-/it-foreach-2.1.2.tgz", + "integrity": "sha512-PvXs3v1FaeWDhWzRxnwB4vSKJngxdLgi0PddkfurCvIFBmKTBfWONLeyDk5dxrvtCzdE4y96KzEQynk4/bbI5A==", + "license": "Apache-2.0 OR MIT", + "dependencies": { + "it-peekable": "^3.0.0" + } + }, + "node_modules/it-length-prefixed": { + "version": "9.1.1", + "resolved": "https://registry.npmjs.org/it-length-prefixed/-/it-length-prefixed-9.1.1.tgz", + "integrity": "sha512-O88nBweT6M9ozsmok68/auKH7ik/slNM4pYbM9lrfy2z5QnpokW5SlrepHZDKtN71llhG2sZvd6uY4SAl+lAQg==", + "license": "Apache-2.0 OR MIT", + "dependencies": { + "it-reader": "^6.0.1", + "it-stream-types": "^2.0.1", + "uint8-varint": "^2.0.1", + "uint8arraylist": "^2.0.0", + "uint8arrays": "^5.0.1" + }, + "engines": { + "node": ">=16.0.0", + "npm": ">=7.0.0" + } + }, + "node_modules/it-length-prefixed-stream": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/it-length-prefixed-stream/-/it-length-prefixed-stream-1.2.1.tgz", + "integrity": "sha512-FYqlxc2toUoK+aPO5r3KDBIUG1mOvk2DzmjQcsfLUTHRWMJP4Va9855tVzg/22Bj+VUUaT7gxBg7HmbiCxTK4w==", + "license": "Apache-2.0 OR MIT", + "dependencies": { + "it-byte-stream": "^1.0.0", + "it-stream-types": "^2.0.2", + "uint8-varint": "^2.0.4", + "uint8arraylist": "^2.4.8" + } + }, + "node_modules/it-map": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/it-map/-/it-map-3.1.2.tgz", + "integrity": "sha512-G3dzFUjTYHKumJJ8wa9dSDS3yKm8L7qDUnAgzemOD0UMztwm54Qc2v97SuUCiAgbOz/aibkSLImfoFK09RlSFQ==", + "license": "Apache-2.0 OR MIT", + "dependencies": { + "it-peekable": "^3.0.0" + } + }, + "node_modules/it-merge": { + "version": "3.0.9", + "resolved": "https://registry.npmjs.org/it-merge/-/it-merge-3.0.9.tgz", + "integrity": "sha512-TjY4WTiwe4ONmaKScNvHDAJj6Tw0UeQFp4JrtC/3Mq7DTyhytes7mnv5OpZV4gItpZcs0AgRntpT2vAy2cnXUw==", + "license": "Apache-2.0 OR MIT", + "dependencies": { + "it-queueless-pushable": "^2.0.0" + } + }, + "node_modules/it-merge/node_modules/it-queueless-pushable": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/it-queueless-pushable/-/it-queueless-pushable-2.0.0.tgz", + "integrity": "sha512-MlNnefWT/ntv5fesrHpxwVIu6ZdtlkN0A4aaJiE5wnmPMBv9ttiwX3UEMf78dFwIj5ZNaU9usYXg4swMEpUNJQ==", + "license": "Apache-2.0 OR MIT", + "dependencies": { + "abort-error": "^1.0.1", + "p-defer": "^4.0.1", + "race-signal": "^1.1.3" + } + }, + "node_modules/it-pair": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/it-pair/-/it-pair-2.0.6.tgz", + "integrity": "sha512-5M0t5RAcYEQYNG5BV7d7cqbdwbCAp5yLdzvkxsZmkuZsLbTdZzah6MQySYfaAQjNDCq6PUnDt0hqBZ4NwMfW6g==", + "license": "Apache-2.0 OR MIT", + "dependencies": { + "it-stream-types": "^2.0.1", + "p-defer": "^4.0.0" + }, + "engines": { + "node": ">=16.0.0", + "npm": ">=7.0.0" + } + }, + "node_modules/it-parallel": { + "version": "3.0.9", + "resolved": "https://registry.npmjs.org/it-parallel/-/it-parallel-3.0.9.tgz", + "integrity": "sha512-FSg8T+pr7Z1VUuBxEzAAp/K1j8r1e9mOcyzpWMxN3mt33WFhroFjWXV1oYSSjNqcdYwxD/XgydMVMktJvKiDog==", + "license": "Apache-2.0 OR MIT", + "dependencies": { + "p-defer": "^4.0.1" + } + }, + "node_modules/it-peekable": { + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/it-peekable/-/it-peekable-3.0.6.tgz", + "integrity": "sha512-odk9wn8AwFQipy8+tFaZNRCM62riraKZJRysfbmOett9wgJumCwgZFzWUBUwMoiQapEcEVGwjDpMChZIi+zLuQ==", + "license": "Apache-2.0 OR MIT" + }, + "node_modules/it-pipe": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/it-pipe/-/it-pipe-3.0.1.tgz", + "integrity": "sha512-sIoNrQl1qSRg2seYSBH/3QxWhJFn9PKYvOf/bHdtCBF0bnghey44VyASsWzn5dAx0DCDDABq1hZIuzKmtBZmKA==", + "license": "Apache-2.0 OR MIT", + "dependencies": { + "it-merge": "^3.0.0", + "it-pushable": "^3.1.2", + "it-stream-types": "^2.0.1" + }, + "engines": { + "node": ">=16.0.0", + "npm": ">=7.0.0" + } + }, + "node_modules/it-protobuf-stream": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/it-protobuf-stream/-/it-protobuf-stream-2.0.1.tgz", + "integrity": "sha512-szhw8w2aIENUa1yv0vFgGZDs7e81dQ/7dM10c4Rf6+rs5tqzWVCSLbpgxIYM0cA8KlcI66XGdzu6lyYp6jKdvw==", + "license": "Apache-2.0 OR MIT", + "dependencies": { + "abort-error": "^1.0.1", + "it-length-prefixed-stream": "^2.0.0", + "it-stream-types": "^2.0.2", + "uint8arraylist": "^2.4.8" + } + }, + "node_modules/it-protobuf-stream/node_modules/it-byte-stream": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/it-byte-stream/-/it-byte-stream-2.0.1.tgz", + "integrity": "sha512-WccB179tWRNjTyXJ9wLshQdKSLdVIexmnNjLfCT7UnsiLisTVUY092YqFhkL+da1WFR0paGzB24L+pAzFhRI4Q==", + "license": "Apache-2.0 OR MIT", + "dependencies": { + "abort-error": "^1.0.1", + "it-queueless-pushable": "^2.0.0", + "it-stream-types": "^2.0.2", + "race-signal": "^1.1.3", + "uint8arraylist": "^2.4.8" + } + }, + "node_modules/it-protobuf-stream/node_modules/it-length-prefixed-stream": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/it-length-prefixed-stream/-/it-length-prefixed-stream-2.0.1.tgz", + "integrity": "sha512-TFohjVrQKRLQgRrPdVL9ARqP4CHUHnsRkbkX4nEhSOBjOvZtVV/pHh5Z2C8EH50MnfNDjVSKvEbaIFVLS3/QMA==", + "license": "Apache-2.0 OR MIT", + "dependencies": { + "abort-error": "^1.0.1", + "it-byte-stream": "^2.0.0", + "it-stream-types": "^2.0.2", + "uint8-varint": "^2.0.4", + "uint8arraylist": "^2.4.8" + } + }, + "node_modules/it-protobuf-stream/node_modules/it-queueless-pushable": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/it-queueless-pushable/-/it-queueless-pushable-2.0.0.tgz", + "integrity": "sha512-MlNnefWT/ntv5fesrHpxwVIu6ZdtlkN0A4aaJiE5wnmPMBv9ttiwX3UEMf78dFwIj5ZNaU9usYXg4swMEpUNJQ==", + "license": "Apache-2.0 OR MIT", + "dependencies": { + "abort-error": "^1.0.1", + "p-defer": "^4.0.1", + "race-signal": "^1.1.3" + } + }, + "node_modules/it-pushable": { + "version": "3.2.3", + "resolved": "https://registry.npmjs.org/it-pushable/-/it-pushable-3.2.3.tgz", + "integrity": "sha512-gzYnXYK8Y5t5b/BnJUr7glfQLO4U5vyb05gPx/TyTw+4Bv1zM9gFk4YsOrnulWefMewlphCjKkakFvj1y99Tcg==", + "license": "Apache-2.0 OR MIT", + "dependencies": { + "p-defer": "^4.0.0" + } + }, + "node_modules/it-queueless-pushable": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/it-queueless-pushable/-/it-queueless-pushable-1.0.2.tgz", + "integrity": "sha512-BFIm48C4O8+i+oVEPQpZ70+CaAsVUircvZtZCrpG2Q64933aLp+tDmas1mTBwqVBfIUUlg09d+e6SWW1CBuykQ==", + "license": "Apache-2.0 OR MIT", + "dependencies": { + "p-defer": "^4.0.1", + "race-signal": "^1.1.3" + } + }, + "node_modules/it-reader": { + "version": "6.0.4", + "resolved": "https://registry.npmjs.org/it-reader/-/it-reader-6.0.4.tgz", + "integrity": "sha512-XCWifEcNFFjjBHtor4Sfaj8rcpt+FkY0L6WdhD578SCDhV4VUm7fCkF3dv5a+fTcfQqvN9BsxBTvWbYO6iCjTg==", + "license": "Apache-2.0 OR MIT", + "dependencies": { + "it-stream-types": "^2.0.1", + "uint8arraylist": "^2.0.0" + }, + "engines": { + "node": ">=16.0.0", + "npm": ">=7.0.0" + } + }, + "node_modules/it-sort": { + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/it-sort/-/it-sort-3.0.7.tgz", + "integrity": "sha512-PsaKSd2Z0uhq8Mq5htdfsE/UagmdLCLWdBXPwi3FZGR4BTG180pFamhK+O+luFtBCNGRoqKAdtbZGTyGwA9uzw==", + "license": "Apache-2.0 OR MIT", + "dependencies": { + "it-all": "^3.0.0" + } + }, + "node_modules/it-stream-types": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/it-stream-types/-/it-stream-types-2.0.2.tgz", + "integrity": "sha512-Rz/DEZ6Byn/r9+/SBCuJhpPATDF9D+dz5pbgSUyBsCDtza6wtNATrz/jz1gDyNanC3XdLboriHnOC925bZRBww==", + "license": "Apache-2.0 OR MIT" + }, + "node_modules/it-take": { + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/it-take/-/it-take-3.0.7.tgz", + "integrity": "sha512-0+EbsTvH1XCpwhhFkjWdqJTjzS5XP3KL69woBqwANNhMLKn0j39jk/WHIlvbg9XW2vEm7cZz4p8w5DkBZR8LoA==", + "license": "Apache-2.0 OR MIT" + }, + "node_modules/it-ws": { + "version": "6.1.5", + "resolved": "https://registry.npmjs.org/it-ws/-/it-ws-6.1.5.tgz", + "integrity": "sha512-uWjMtpy5HqhSd/LlrlP3fhYrr7rUfJFFMABv0F5d6n13Q+0glhZthwUKpEAVhDrXY95Tb1RB5lLqqef+QbVNaw==", + "license": "Apache-2.0 OR MIT", + "dependencies": { + "@types/ws": "^8.2.2", + "event-iterator": "^2.0.0", + "it-stream-types": "^2.0.1", + "uint8arrays": "^5.0.0", + "ws": "^8.4.0" + }, + "engines": { + "node": ">=16.0.0", + "npm": ">=7.0.0" + } + }, "node_modules/jackspeak": { "version": "3.4.3", "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-3.4.3.tgz", @@ -4902,6 +6152,12 @@ "jiti": "bin/jiti.js" } }, + "node_modules/js-sha3": { + "version": "0.9.3", + "resolved": "https://registry.npmjs.org/js-sha3/-/js-sha3-0.9.3.tgz", + "integrity": "sha512-BcJPCQeLg6WjEx3FE591wVAevlli8lxsxm9/FzV4HXkV49TmBH38Yvrpce6fjbADGMKFrBMGTqrVz3qPIZ88Gg==", + "license": "MIT" + }, "node_modules/js-tokens": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", @@ -4966,6 +6222,40 @@ "node": ">= 0.8.0" } }, + "node_modules/libp2p": { + "version": "2.1.8", + "resolved": "https://registry.npmjs.org/libp2p/-/libp2p-2.1.8.tgz", + "integrity": "sha512-OzUUgAs6983lP2FDqc3oABeUAyvd3iJ/BlYjwmjddpUwQO6gemuJFpWujagj2Vtj+oPosGrrPGWqv+WPnTkHUA==", + "license": "Apache-2.0 OR MIT", + "dependencies": { + "@libp2p/crypto": "^5.0.5", + "@libp2p/interface": "^2.1.3", + "@libp2p/interface-internal": "^2.0.8", + "@libp2p/logger": "^5.1.1", + "@libp2p/multistream-select": "^6.0.6", + "@libp2p/peer-collections": "^6.0.8", + "@libp2p/peer-id": "^5.0.5", + "@libp2p/peer-store": "^11.0.8", + "@libp2p/utils": "^6.1.1", + "@multiformats/dns": "^1.0.6", + "@multiformats/multiaddr": "^12.2.3", + "@multiformats/multiaddr-matcher": "^1.2.1", + "any-signal": "^4.1.1", + "datastore-core": "^10.0.0", + "interface-datastore": "^8.3.0", + "it-byte-stream": "^1.0.12", + "it-merge": "^3.0.5", + "it-parallel": "^3.0.7", + "merge-options": "^3.0.4", + "multiformats": "^13.1.0", + "p-defer": "^4.0.1", + "p-retry": "^6.2.0", + "progress-events": "^1.0.0", + "race-event": "^1.3.0", + "race-signal": "^1.0.2", + "uint8arrays": "^5.1.0" + } + }, "node_modules/lilconfig": { "version": "3.1.3", "resolved": "https://registry.npmjs.org/lilconfig/-/lilconfig-3.1.3.tgz", @@ -5037,6 +6327,15 @@ "loose-envify": "cli.js" } }, + "node_modules/loupe": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/loupe/-/loupe-2.3.7.tgz", + "integrity": "sha512-zSMINGVYkdpYSOBmLi0D1Uo7JU9nVdQKrHxC8eYlV+9YKK9WePqAlL7lSlorG/U2Fw1w0hTBmaa/jrQ3UbPHtA==", + "license": "MIT", + "dependencies": { + "get-func-name": "^2.0.1" + } + }, "node_modules/lovable-tagger": { "version": "1.1.7", "resolved": "https://registry.npmjs.org/lovable-tagger/-/lovable-tagger-1.1.7.tgz", @@ -5511,6 +6810,18 @@ "@jridgewell/sourcemap-codec": "^1.5.0" } }, + "node_modules/merge-options": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/merge-options/-/merge-options-3.0.4.tgz", + "integrity": "sha512-2Sug1+knBjkaMsMgf1ctR1Ujx+Ayku4EdJN4Z+C2+JzoeF7A3OZ9KM2GY0CpQS51NR61LTurMJrRKPhSs3ZRTQ==", + "license": "MIT", + "dependencies": { + "is-plain-obj": "^2.1.0" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/merge2": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", @@ -5555,13 +6866,29 @@ "node": ">=16 || 14 >=14.17" } }, + "node_modules/mortice": { + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/mortice/-/mortice-3.0.6.tgz", + "integrity": "sha512-xUjsTQreX8rO3pHuGYDZ3PY/sEiONIzqzjLeog5akdY4bz9TlDDuvYlU8fm+6qnm4rnpa6AFxLhsfSBThLijdA==", + "license": "Apache-2.0 OR MIT", + "dependencies": { + "observable-webworkers": "^2.0.1", + "p-queue": "^8.0.1", + "p-timeout": "^6.0.0" + } + }, "node_modules/ms": { "version": "2.1.3", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", - "dev": true, "license": "MIT" }, + "node_modules/multiformats": { + "version": "13.3.2", + "resolved": "https://registry.npmjs.org/multiformats/-/multiformats-13.3.2.tgz", + "integrity": "sha512-qbB0CQDt3QKfiAzZ5ZYjLFOs+zW43vA4uyM8g27PeEuXZybUOFyjrVdP93HPBHMoglibwfkdVwbzfUq8qGcH6g==", + "license": "Apache-2.0 OR MIT" + }, "node_modules/mz": { "version": "2.7.0", "resolved": "https://registry.npmjs.org/mz/-/mz-2.7.0.tgz", @@ -5598,6 +6925,15 @@ "dev": true, "license": "MIT" }, + "node_modules/netmask": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/netmask/-/netmask-2.0.2.tgz", + "integrity": "sha512-dBpDMdxv9Irdq66304OLfEmQ9tbNRFnFTuZiLo+bD+r332bBmMJ8GBLXklIXXgxd3+v9+KUnZaUR5PJMa75Gsg==", + "license": "MIT", + "engines": { + "node": ">= 0.4.0" + } + }, "node_modules/next-themes": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/next-themes/-/next-themes-0.3.0.tgz", @@ -5652,6 +6988,16 @@ "node": ">= 6" } }, + "node_modules/observable-webworkers": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/observable-webworkers/-/observable-webworkers-2.0.1.tgz", + "integrity": "sha512-JI1vB0u3pZjoQKOK1ROWzp0ygxSi7Yb0iR+7UNsw4/Zn4cQ0P3R7XL38zac/Dy2tEA7Lg88/wIJTjF8vYXZ0uw==", + "license": "Apache-2.0 OR MIT", + "engines": { + "node": ">=16.0.0", + "npm": ">=7.0.0" + } + }, "node_modules/optionator": { "version": "0.9.4", "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.4.tgz", @@ -5670,6 +7016,33 @@ "node": ">= 0.8.0" } }, + "node_modules/p-defer": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/p-defer/-/p-defer-4.0.1.tgz", + "integrity": "sha512-Mr5KC5efvAK5VUptYEIopP1bakB85k2IWXaRC0rsh1uwn1L6M0LVml8OIQ4Gudg4oyZakf7FmeRLkMMtZW1i5A==", + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-event": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/p-event/-/p-event-6.0.1.tgz", + "integrity": "sha512-Q6Bekk5wpzW5qIyUP4gdMEujObYstZl6DMMOSenwBvV0BlE5LkDwkjs5yHbZmdCEq2o4RJx4tE1vwxFVf2FG1w==", + "license": "MIT", + "dependencies": { + "p-timeout": "^6.1.2" + }, + "engines": { + "node": ">=16.17" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/p-limit": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", @@ -5702,6 +7075,57 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "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==", + "license": "MIT", + "dependencies": { + "eventemitter3": "^5.0.1", + "p-timeout": "^6.1.2" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-queue/node_modules/eventemitter3": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-5.0.1.tgz", + "integrity": "sha512-GWkBvjiSZK87ELrYOSESUYeVIc9mvLLf/nXalMOS5dYrgZq9o5OVkbZAVM06CVxYsCwH9BDZFPlQTlPA1j4ahA==", + "license": "MIT" + }, + "node_modules/p-retry": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/p-retry/-/p-retry-6.2.1.tgz", + "integrity": "sha512-hEt02O4hUct5wtwg4H4KcWgDdm+l1bOaEy/hWzd8xtXB9BqxTWBBhb+2ImAtH4Cv4rPjV76xN3Zumqk3k3AhhQ==", + "license": "MIT", + "dependencies": { + "@types/retry": "0.12.2", + "is-network-error": "^1.0.0", + "retry": "^0.13.1" + }, + "engines": { + "node": ">=16.17" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-timeout": { + "version": "6.1.4", + "resolved": "https://registry.npmjs.org/p-timeout/-/p-timeout-6.1.4.tgz", + "integrity": "sha512-MyIV3ZA/PmyBN/ud8vV9XzwTrNtR4jFrObymZYnZqMmW0zA8Z17vnT0rBgFE/TlohB+YCHqXMgZzb3Csp49vqg==", + "license": "MIT", + "engines": { + "node": ">=14.16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/package-json-from-dist": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/package-json-from-dist/-/package-json-from-dist-1.0.1.tgz", @@ -5762,6 +7186,15 @@ "url": "https://github.com/sponsors/isaacs" } }, + "node_modules/pathval": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/pathval/-/pathval-1.1.1.tgz", + "integrity": "sha512-Dp6zGqpTdETdR63lehJYPeIOqpiNBNtc7BpWSLrOje7UaIsE5aY92r/AunQA7rsXvet3lrJ3JnZX29UPTKXyKQ==", + "license": "MIT", + "engines": { + "node": "*" + } + }, "node_modules/picocolors": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", @@ -5951,6 +7384,12 @@ "node": ">= 0.8.0" } }, + "node_modules/progress-events": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/progress-events/-/progress-events-1.0.1.tgz", + "integrity": "sha512-MOzLIwhpt64KIVN64h1MwdKWiyKFNc/S6BoYKPIVUHFg0/eIEyBulhWCgn678v/4c0ri3FdGuzXymNCv02MUIw==", + "license": "Apache-2.0 OR MIT" + }, "node_modules/prop-types": { "version": "15.8.1", "resolved": "https://registry.npmjs.org/prop-types/-/prop-types-15.8.1.tgz", @@ -5968,6 +7407,17 @@ "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==", "license": "MIT" }, + "node_modules/protons-runtime": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/protons-runtime/-/protons-runtime-5.5.0.tgz", + "integrity": "sha512-EsALjF9QsrEk6gbCx3lmfHxVN0ah7nG3cY7GySD4xf4g8cr7g543zB88Foh897Sr1RQJ9yDCUsoT1i1H/cVUFA==", + "license": "Apache-2.0 OR MIT", + "dependencies": { + "uint8-varint": "^2.0.2", + "uint8arraylist": "^2.4.3", + "uint8arrays": "^5.0.1" + } + }, "node_modules/punycode": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", @@ -5998,6 +7448,30 @@ ], "license": "MIT" }, + "node_modules/quick-lru": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/quick-lru/-/quick-lru-7.0.1.tgz", + "integrity": "sha512-kLjThirJMkWKutUKbZ8ViqFc09tDQhlbQo2MNuVeLWbRauqYP96Sm6nzlQ24F0HFjUNZ4i9+AgldJ9H6DZXi7g==", + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/race-event": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/race-event/-/race-event-1.3.0.tgz", + "integrity": "sha512-kaLm7axfOnahIqD3jQ4l1e471FIFcEGebXEnhxyLscuUzV8C94xVHtWEqDDXxll7+yu/6lW0w1Ff4HbtvHvOHg==", + "license": "Apache-2.0 OR MIT" + }, + "node_modules/race-signal": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/race-signal/-/race-signal-1.1.3.tgz", + "integrity": "sha512-Mt2NznMgepLfORijhQMncE26IhkmjEphig+/1fKC0OtaKwys/gpvpmswSjoN01SS+VO951mj0L4VIDXdXsjnfA==", + "license": "Apache-2.0 OR MIT" + }, "node_modules/react": { "version": "18.3.1", "resolved": "https://registry.npmjs.org/react/-/react-18.3.1.tgz", @@ -6288,6 +7762,15 @@ "node": ">=4" } }, + "node_modules/retry": { + "version": "0.13.1", + "resolved": "https://registry.npmjs.org/retry/-/retry-0.13.1.tgz", + "integrity": "sha512-XQBQ3I8W1Cge0Seh+6gjj03LbmRFWuoszgK9ooCpwYIrhhoO80pfq4cUkU5DkknwfOfFteRwlZ56PYOGYyFWdg==", + "license": "MIT", + "engines": { + "node": ">= 4" + } + }, "node_modules/reusify": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", @@ -6727,6 +8210,15 @@ "node": ">= 0.8.0" } }, + "node_modules/type-detect": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.1.0.tgz", + "integrity": "sha512-Acylog8/luQ8L7il+geoSxhEkazvkslg7PSNKOX59mbB9cOveP5aq9h74Y7YU8yDpJwetzQQrfIwtf4Wp4LKcw==", + "license": "MIT", + "engines": { + "node": ">=4" + } + }, "node_modules/typescript": { "version": "5.6.3", "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.6.3.tgz", @@ -6765,11 +8257,38 @@ } } }, + "node_modules/uint8-varint": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/uint8-varint/-/uint8-varint-2.0.4.tgz", + "integrity": "sha512-FwpTa7ZGA/f/EssWAb5/YV6pHgVF1fViKdW8cWaEarjB8t7NyofSWBdOTyFPaGuUG4gx3v1O3PQ8etsiOs3lcw==", + "license": "Apache-2.0 OR MIT", + "dependencies": { + "uint8arraylist": "^2.0.0", + "uint8arrays": "^5.0.0" + } + }, + "node_modules/uint8arraylist": { + "version": "2.4.8", + "resolved": "https://registry.npmjs.org/uint8arraylist/-/uint8arraylist-2.4.8.tgz", + "integrity": "sha512-vc1PlGOzglLF0eae1M8mLRTBivsvrGsdmJ5RbK3e+QRvRLOZfZhQROTwH/OfyF3+ZVUg9/8hE8bmKP2CvP9quQ==", + "license": "Apache-2.0 OR MIT", + "dependencies": { + "uint8arrays": "^5.0.1" + } + }, + "node_modules/uint8arrays": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/uint8arrays/-/uint8arrays-5.1.0.tgz", + "integrity": "sha512-vA6nFepEmlSKkMBnLBaUMVvAC4G3CTmO58C12y4sq6WPDOR7mOFYOi7GlrQ4djeSbP6JG9Pv9tJDM97PedRSww==", + "license": "Apache-2.0 OR MIT", + "dependencies": { + "multiformats": "^13.0.0" + } + }, "node_modules/undici-types": { "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/update-browserslist-db": { @@ -6862,6 +8381,19 @@ "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==", "license": "MIT" }, + "node_modules/uuid": { + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.1.tgz", + "integrity": "sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA==", + "funding": [ + "https://github.com/sponsors/broofa", + "https://github.com/sponsors/ctavan" + ], + "license": "MIT", + "bin": { + "uuid": "dist/bin/uuid" + } + }, "node_modules/vaul": { "version": "0.9.9", "resolved": "https://registry.npmjs.org/vaul/-/vaul-0.9.9.tgz", @@ -6957,6 +8489,50 @@ } } }, + "node_modules/weald": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/weald/-/weald-1.0.4.tgz", + "integrity": "sha512-+kYTuHonJBwmFhP1Z4YQK/dGi3jAnJGCYhyODFpHK73rbxnp9lnZQj7a2m+WVgn8fXr5bJaxUpF6l8qZpPeNWQ==", + "license": "Apache-2.0 OR MIT", + "dependencies": { + "ms": "^3.0.0-canary.1", + "supports-color": "^9.4.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==", + "license": "MIT", + "engines": { + "node": ">=12.13" + } + }, + "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==", + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/supports-color?sponsor=1" + } + }, + "node_modules/wherearewe": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/wherearewe/-/wherearewe-2.0.1.tgz", + "integrity": "sha512-XUguZbDxCA2wBn2LoFtcEhXL6AXo+hVjGonwhSTTTU9SzbWG8Xu3onNIpzf9j/mYUcJQ0f+m37SzG77G851uFw==", + "license": "Apache-2.0 OR MIT", + "dependencies": { + "is-electron": "^2.2.0" + }, + "engines": { + "node": ">=16.0.0", + "npm": ">=7.0.0" + } + }, "node_modules/which": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", @@ -7070,6 +8646,27 @@ "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, + "node_modules/ws": { + "version": "8.18.1", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.18.1.tgz", + "integrity": "sha512-RKW2aJZMXeMxVpnZ6bck+RswznaxmzdULiBr6KY7XkTnW8uvt0iT9H5DkHUChXrc+uurzwa0rVI16n/Xzjdz1w==", + "license": "MIT", + "engines": { + "node": ">=10.0.0" + }, + "peerDependencies": { + "bufferutil": "^4.0.1", + "utf-8-validate": ">=5.0.2" + }, + "peerDependenciesMeta": { + "bufferutil": { + "optional": true + }, + "utf-8-validate": { + "optional": true + } + } + }, "node_modules/yaml": { "version": "2.6.0", "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.6.0.tgz", diff --git a/package.json b/package.json index 95aad28..7f6f1c3 100644 --- a/package.json +++ b/package.json @@ -40,6 +40,7 @@ "@radix-ui/react-toggle-group": "^1.1.0", "@radix-ui/react-tooltip": "^1.1.4", "@tanstack/react-query": "^5.56.2", + "@waku/sdk": "^0.0.30", "class-variance-authority": "^0.7.1", "clsx": "^2.1.1", "cmdk": "^1.0.0", diff --git a/src/lib/waku/codec.ts b/src/lib/waku/codec.ts new file mode 100644 index 0000000..f2bc9e9 --- /dev/null +++ b/src/lib/waku/codec.ts @@ -0,0 +1,51 @@ +import { MessageType } from './types'; +import { OpchanMessage, CellMessage, PostMessage, CommentMessage, VoteMessage } from './types'; + +/** + * Encode a message object into a Uint8Array for transmission + */ +export function encodeMessage(message: OpchanMessage): Uint8Array { + // Convert the message to a JSON string + const messageJson = JSON.stringify(message); + + // Convert the string to a Uint8Array + return new TextEncoder().encode(messageJson); +} + +/** + * Decode a message from a Uint8Array based on its type + */ +export function decodeMessage(payload: Uint8Array, type?: MessageType): OpchanMessage { + // Convert the Uint8Array to a string + const messageJson = new TextDecoder().decode(payload); + + // Parse the JSON string to an object + const message = JSON.parse(messageJson) as OpchanMessage; + + // Validate the message type if specified + if (type && message.type !== type) { + throw new Error(`Expected message of type ${type}, but got ${message.type}`); + } + + // Return the decoded message + return message; +} + +/** + * Type-specific decoders + */ +export function decodeCellMessage(payload: Uint8Array): CellMessage { + return decodeMessage(payload, MessageType.CELL) as CellMessage; +} + +export function decodePostMessage(payload: Uint8Array): PostMessage { + return decodeMessage(payload, MessageType.POST) as PostMessage; +} + +export function decodeCommentMessage(payload: Uint8Array): CommentMessage { + return decodeMessage(payload, MessageType.COMMENT) as CommentMessage; +} + +export function decodeVoteMessage(payload: Uint8Array): VoteMessage { + return decodeMessage(payload, MessageType.VOTE) as VoteMessage; +} \ No newline at end of file diff --git a/src/lib/waku/constants.ts b/src/lib/waku/constants.ts new file mode 100644 index 0000000..303563e --- /dev/null +++ b/src/lib/waku/constants.ts @@ -0,0 +1,30 @@ +import { MessageType } from "./types"; +import type { QueryRequestParams } from '@waku/sdk' + +/** + * Content topics for different message types + */ +export const CONTENT_TOPICS: Record = { + [MessageType.CELL]: '/opchan/1/cell/proto', + [MessageType.POST]: '/opchan/1/post/proto', + [MessageType.COMMENT]: '/opchan/1/comment/proto', + [MessageType.VOTE]: '/opchan/1/vote/proto' +}; + +/** + * Bootstrap nodes for the Waku network + * These are public Waku nodes that our node will connect to on startup + */ +export const BOOTSTRAP_NODES = [ + '/dns4/node-01.ac-cn-hongkong-c.wakuv2.test.statusim.net/tcp/443/wss/p2p/16Uiu2HAkykgaECHswi3YKJ5dMLbq2kPVCo89fcyTd2Hz8tHPeV4y', + '/dns4/node-01.do-ams3.wakuv2.test.statusim.net/tcp/443/wss/p2p/16Uiu2HAmPLe7Mzm8TsYUubgCAW1aJoeFScxrLj8ppHFivPo97bUZ', + '/dns4/node-01.gc-us-central1-a.wakuv2.test.statusim.net/tcp/443/wss/p2p/16Uiu2HAmJb2e28qLXxT5kZxVUUoJt72EMzNGXB47Rxx5hw3q4YjS' +]; + +// Default store query options +// export const DEFAULT_STORE_QUERY_OPTIONS: QueryRequestParams = { +// contentTopics: [CONTENT_TOPICS[MessageType.CELL], CONTENT_TOPICS[MessageType.POST], CONTENT_TOPICS[MessageType.COMMENT], CONTENT_TOPICS[MessageType.VOTE]], +// includeData: true, +// paginationForward: false, +// pubsubTopic: "" +// }; \ No newline at end of file diff --git a/src/lib/waku/index.ts b/src/lib/waku/index.ts new file mode 100644 index 0000000..00e6b4d --- /dev/null +++ b/src/lib/waku/index.ts @@ -0,0 +1,108 @@ +import { createDecoder, createLightNode, LightNode } from "@waku/sdk"; +import { BOOTSTRAP_NODES } from "./constants"; +import StoreManager from "./store"; +import { CommentCache, MessageType, VoteCache } from "./types"; +import { PostCache } from "./types"; +import { CellCache } from "./types"; +import { OpchanMessage } from "@/types"; +import { EphemeralProtocolsManager } from "./lightpush_filter"; +import { NETWORK_CONFIG } from "./constants"; + +class MessageManager { + private node: LightNode; + //TODO: implement SDS? + private ephemeralProtocolsManager: EphemeralProtocolsManager; + private storeManager: StoreManager; + + + public readonly messageCache: { + cells: CellCache; + posts: PostCache; + comments: CommentCache; + votes: VoteCache; + } = { + cells: {}, + posts: {}, + comments: {}, + votes: {} + } + + public static async create(): Promise { + const node = await createLightNode({ + defaultBootstrap: false, + networkConfig: NETWORK_CONFIG, + autoStart: true, + bootstrapPeers: BOOTSTRAP_NODES, + lightPush:{autoRetry: true, retryIntervalMs: 1000} + }); + return new MessageManager(node); + } + + public async stop() { + await this.node.stop(); + } + + private constructor(node: LightNode) { + this.node = node; + this.ephemeralProtocolsManager = new EphemeralProtocolsManager(node); + this.storeManager = new StoreManager(node); + } + + private updateCache(message: OpchanMessage) { + switch (message.type) { + case MessageType.CELL: + this.messageCache.cells[message.id] = message; + break; + case MessageType.POST: + this.messageCache.posts[message.id] = message; + break; + case MessageType.COMMENT: + this.messageCache.comments[message.id] = message; + break; + case MessageType.VOTE: { + // For votes, we use a composite key of targetId + author to handle multiple votes from same user + const voteKey = `${message.targetId}:${message.author}`; + this.messageCache.votes[voteKey] = message; + break; + } + default: + // TypeScript should ensure we don't reach this case with proper OpchanMessage types + console.warn("Received message with unknown type"); + break; + } + } + + public async queryStore() { + const messages = await this.storeManager.queryStore(); + + // Populate cache from store messages + for (const message of messages) { + this.updateCache(message); + } + + return messages; + } + + public async sendMessage(message: OpchanMessage) { + await this.ephemeralProtocolsManager.sendMessage(message); + // Also update local cache with the message we just sent + this.updateCache(message); + } + + public async subscribeToMessages(types: MessageType[] = [MessageType.CELL, MessageType.POST, MessageType.COMMENT, MessageType.VOTE]) { + const { result, subscription } = await this.ephemeralProtocolsManager.subscribeToMessages(types); + + // Set up a callback that will be triggered for new messages + // New messages from the subscription will be processed directly by the ephemeralProtocolsManager + // and returned via the result array, so we just need to add them to the cache + for (const message of result) { + this.updateCache(message); + } + + // Return result and subscription for any external processing + return { messages: result, subscription }; + } +} + +const messageManager = await MessageManager.create(); +export default messageManager; diff --git a/src/lib/waku/messages.ts b/src/lib/waku/messages.ts new file mode 100644 index 0000000..0760b55 --- /dev/null +++ b/src/lib/waku/messages.ts @@ -0,0 +1,142 @@ +import { MessageType } from './constants'; +import { DecodedMessage } from '@waku/sdk'; +import { Cell, Post, Comment } from '@/types/forum'; + +// Base structure for all messages +export interface WakuMessageBase { + messageType: MessageType; + timestamp: number; + sender: string; // Bitcoin address of sender + signature?: string; // Signature to verify sender +} + +// Message structures for different content types +export interface CellMessage extends WakuMessageBase { + messageType: MessageType.CELL; + cellId: string; + name: string; + description: string; + icon: string; +} + +export interface PostMessage extends WakuMessageBase { + messageType: MessageType.POST; + postId: string; + cellId: string; + content: string; +} + +export interface CommentMessage extends WakuMessageBase { + messageType: MessageType.COMMENT; + commentId: string; + postId: string; + content: string; +} + +export interface VoteMessage extends WakuMessageBase { + messageType: MessageType.VOTE; + targetId: string; // postId or commentId + isUpvote: boolean; +} + +// Type for all possible messages +export type WakuMessage = + | CellMessage + | PostMessage + | CommentMessage + | VoteMessage; + +// Utility functions for converting between message types and application models +export function cellToMessage(cell: Cell, sender: string): CellMessage { + return { + messageType: MessageType.CELL, + timestamp: Date.now(), + sender, + cellId: cell.id, + name: cell.name, + description: cell.description, + icon: cell.icon + }; +} + +export function messageToCell(message: CellMessage): Cell { + return { + id: message.cellId, + name: message.name, + description: message.description, + icon: message.icon + }; +} + +export function postToMessage(post: Post, sender: string): PostMessage { + return { + messageType: MessageType.POST, + timestamp: Date.now(), + sender, + postId: post.id, + cellId: post.cellId, + content: post.content + }; +} + +export function messageToPost(message: PostMessage): Post { + return { + id: message.postId, + cellId: message.cellId, + authorAddress: message.sender, + content: message.content, + timestamp: message.timestamp, + upvotes: [], + downvotes: [] + }; +} + +export function commentToMessage(comment: Comment, sender: string): CommentMessage { + return { + messageType: MessageType.COMMENT, + timestamp: Date.now(), + sender, + commentId: comment.id, + postId: comment.postId, + content: comment.content + }; +} + +export function messageToComment(message: CommentMessage): Comment { + return { + id: message.commentId, + postId: message.postId, + authorAddress: message.sender, + content: message.content, + timestamp: message.timestamp, + upvotes: [], + downvotes: [] + }; +} + +// Parse message from decoded waku message +export function parseMessage(decodedMessage: DecodedMessage): WakuMessage | null { + try { + if (!decodedMessage.payload) return null; + + const messageString = new TextDecoder().decode(decodedMessage.payload); + const message = JSON.parse(messageString) as WakuMessage; + + // Validate message has required fields + if (!message.messageType || !message.timestamp || !message.sender) { + console.error('Invalid message format:', message); + return null; + } + + return message; + } catch (error) { + console.error('Error parsing message:', error); + return null; + } +} + +// Serialize message to payload bytes +export function serializeMessage(message: WakuMessage): Uint8Array { + const messageString = JSON.stringify(message); + return new TextEncoder().encode(messageString); +} \ No newline at end of file diff --git a/src/lib/waku/types.ts b/src/lib/waku/types.ts new file mode 100644 index 0000000..10c01bb --- /dev/null +++ b/src/lib/waku/types.ts @@ -0,0 +1,96 @@ +/** + * Message types for Waku communication + */ +export enum MessageType { + CELL = 'cell', + POST = 'post', + COMMENT = 'comment', + VOTE = 'vote' +} + +/** + * Base interface for all message types + */ +export interface BaseMessage { + type: MessageType; + timestamp: number; + author: string; +} + +/** + * Represents a cell message + */ +export interface CellMessage extends BaseMessage { + type: MessageType.CELL; + id: string; + name: string; + description: string; +} + +/** + * Represents a post message + */ +export interface PostMessage extends BaseMessage { + type: MessageType.POST; + id: string; + cellId: string; + title: string; + content: string; +} + +/** + * Represents a comment message + */ +export interface CommentMessage extends BaseMessage { + type: MessageType.COMMENT; + id: string; + postId: string; + parentId?: string; // Optional for nested comments + content: string; +} + +/** + * Represents a vote message + */ +export interface VoteMessage extends BaseMessage { + type: MessageType.VOTE; + id: string; + targetId: string; // ID of the post or comment being voted on + value: number; // 1 for upvote, -1 for downvote +} + +/** + * Union type of all possible message types + */ +export type OpchanMessage = CellMessage | PostMessage | CommentMessage | VoteMessage; + +/** + * Listener function type for Waku service events + */ +export type MessageListener = (message: T) => void; + +/** + * Subscription object returned when registering listeners + */ +export interface Subscription { + unsubscribe: () => void; +} + +/** + * Cache objects for storing messages + */ +export interface CellCache { + [cellId: string]: CellMessage; +} + +export interface PostCache { + [postId: string]: PostMessage; +} + +export interface CommentCache { + [commentId: string]: CommentMessage; +} + +export interface VoteCache { + [key: string]: VoteMessage; // key = targetId + authorAddress +} \ No newline at end of file