diff --git a/package-lock.json b/package-lock.json index a9e0319..fe5f1dd 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,6 +9,7 @@ "version": "1.0.0", "dependencies": { "@graphile-contrib/pg-simplify-inflector": "^6.1.0", + "@helia/verified-fetch": "^1.3.14", "chainsauce": "github:boudra/chainsauce#main", "cors": "^2.8.5", "dotenv": "^16.4.5", @@ -48,6 +49,19 @@ "node": ">=6.9.0" } }, + "node_modules/@chainsafe/is-ip": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/@chainsafe/is-ip/-/is-ip-2.0.2.tgz", + "integrity": "sha512-ndGqEMG1W5WkGagaqOZHpPU172AGdxr+LD15sv3WIUvT5oCFUrG1Y0CW/v2Egwj4JXEvSibaIIIqImsm98y1nA==" + }, + "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==", + "dependencies": { + "@chainsafe/is-ip": "^2.0.1" + } + }, "node_modules/@esbuild/aix-ppc64": { "version": "0.20.2", "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.20.2.tgz", @@ -480,6 +494,308 @@ "node": ">=8.6" } }, + "node_modules/@helia/bitswap": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@helia/bitswap/-/bitswap-1.1.0.tgz", + "integrity": "sha512-/RF3vxEHM6KWliLYYvukf+z388SWkJU1NJkdXdbzU7W0YjyCmanYAusOXVf5sfHIiOtK+YFO6oJzy+kcp+eySQ==", + "dependencies": { + "@helia/interface": "^4.3.0", + "@helia/utils": "^0.3.0", + "@libp2p/interface": "^1.1.2", + "@libp2p/logger": "^4.0.5", + "@libp2p/peer-collections": "^5.1.6", + "@libp2p/utils": "^5.2.3", + "@multiformats/multiaddr": "^12.1.14", + "any-signal": "^4.1.1", + "interface-blockstore": "^5.2.9", + "interface-store": "^5.1.7", + "it-drain": "^3.0.5", + "it-length-prefixed": "^9.0.0", + "it-length-prefixed-stream": "^1.1.6", + "it-map": "^3.0.5", + "it-pipe": "^3.0.1", + "it-take": "^3.0.1", + "multiformats": "^13.0.1", + "p-defer": "^4.0.0", + "progress-events": "^1.0.0", + "protons-runtime": "^5.0.0", + "race-event": "^1.2.0", + "uint8-varint": "^2.0.3", + "uint8arraylist": "^2.4.3", + "uint8arrays": "^5.0.1" + } + }, + "node_modules/@helia/bitswap/node_modules/@helia/utils": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/@helia/utils/-/utils-0.3.0.tgz", + "integrity": "sha512-lCOd5DsimmUrp9+TyxWDkvhDFvI+Hgn7PevQHGya3AwmJXxsuCY6FtRgd7YkdaoqAm4+q7L710UnUtp5AmHlVA==", + "dependencies": { + "@helia/interface": "^4.3.0", + "@ipld/dag-cbor": "^9.2.0", + "@ipld/dag-json": "^10.2.0", + "@ipld/dag-pb": "^4.1.0", + "@libp2p/crypto": "^4.0.6", + "@libp2p/interface": "^1.1.4", + "@libp2p/logger": "^4.0.7", + "@libp2p/utils": "^5.2.6", + "@multiformats/dns": "^1.0.1", + "@types/murmurhash3js-revisited": "^3.0.3", + "any-signal": "^4.1.1", + "blockstore-core": "^4.4.1", + "cborg": "^4.0.9", + "interface-blockstore": "^5.2.10", + "interface-datastore": "^8.2.11", + "interface-store": "^5.1.8", + "it-drain": "^3.0.5", + "it-filter": "^3.0.4", + "it-foreach": "^2.0.6", + "it-merge": "^3.0.3", + "mortice": "^3.0.4", + "multiformats": "^13.1.0", + "murmurhash3js-revisited": "^3.0.0", + "p-defer": "^4.0.1", + "progress-events": "^1.0.0", + "uint8arraylist": "^2.4.8", + "uint8arrays": "^5.0.2" + } + }, + "node_modules/@helia/block-brokers": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/@helia/block-brokers/-/block-brokers-2.1.3.tgz", + "integrity": "sha512-RW76CztfcDRHxbukArI2iMuJBgkLlQ2GsW5PuU5yATgHcERRJaDr0dSwmGtySMfMn7WweF+3RbiRw196eYxM4w==", + "dependencies": { + "@helia/bitswap": "^1.0.1", + "@helia/interface": "^4.2.0", + "@helia/utils": "^0.2.0", + "@libp2p/interface": "^1.1.4", + "@libp2p/utils": "^5.2.6", + "@multiformats/multiaddr": "^12.2.1", + "@multiformats/multiaddr-matcher": "^1.2.0", + "@multiformats/multiaddr-to-uri": "^10.0.1", + "interface-blockstore": "^5.2.10", + "interface-store": "^5.1.8", + "multiformats": "^13.1.0", + "progress-events": "^1.0.0" + } + }, + "node_modules/@helia/car": { + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/@helia/car/-/car-3.1.5.tgz", + "integrity": "sha512-3vlkSsIt/QD2CSnuGOjjx2tCEZ9Dxss/PohqXTiXdHeFeTAXoLEgX5f25jyYUHErLt7tdgMrO6ayACVPFpjHVQ==", + "dependencies": { + "@helia/interface": "^4.3.0", + "@ipld/car": "^5.3.0", + "@libp2p/interfaces": "^3.3.2", + "interface-blockstore": "^5.2.10", + "it-drain": "^3.0.5", + "it-map": "^3.0.5", + "multiformats": "^13.1.0", + "p-defer": "^4.0.0", + "p-queue": "^8.0.1", + "progress-events": "^1.0.0" + } + }, + "node_modules/@helia/delegated-routing-v1-http-api-client": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@helia/delegated-routing-v1-http-api-client/-/delegated-routing-v1-http-api-client-3.0.1.tgz", + "integrity": "sha512-Gkaw3B8IjgCCXtasa17j8wQaFdzph2s0RiLyrJTS2htmwVFWZEjLNLUDJeWsMHBoLBza8SrVGvQ9fiN3XD3rfg==", + "dependencies": { + "@libp2p/interface": "^1.1.1", + "@libp2p/logger": "^4.0.4", + "@libp2p/peer-id": "^4.0.4", + "@multiformats/multiaddr": "^12.1.3", + "any-signal": "^4.1.1", + "browser-readablestream-to-it": "^2.0.3", + "ipns": "^9.0.0", + "it-first": "^3.0.3", + "it-map": "^3.0.4", + "it-ndjson": "^1.0.4", + "multiformats": "^13.0.0", + "p-defer": "^4.0.0", + "p-queue": "^8.0.1", + "uint8arrays": "^5.0.1" + } + }, + "node_modules/@helia/http": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/@helia/http/-/http-1.0.7.tgz", + "integrity": "sha512-79mui6ZlcgzDiOl+Nz+cje8NUTOcJE1lMmh4D4Ryxd80gDGlHk2ZY8d4w468LvyJ9mm2ZJJuboSwLvPDHm0UJw==", + "dependencies": { + "@helia/block-brokers": "^3.0.0", + "@helia/interface": "^4.3.0", + "@helia/routers": "^1.1.0", + "@helia/utils": "^0.3.0", + "blockstore-core": "^4.4.0", + "datastore-core": "^9.2.9" + } + }, + "node_modules/@helia/http/node_modules/@helia/block-brokers": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@helia/block-brokers/-/block-brokers-3.0.0.tgz", + "integrity": "sha512-f93Lklv+ZyySxIAiZDG6p2kRF+OV3hdhVUAyWNK6TWpyxuFNj45cYQci9nz/ZTmEHqg2ylswwiq4lEGml3WS7Q==", + "dependencies": { + "@helia/bitswap": "^1.1.0", + "@helia/interface": "^4.3.0", + "@helia/utils": "^0.3.0", + "@libp2p/interface": "^1.1.4", + "@libp2p/utils": "^5.2.6", + "@multiformats/multiaddr": "^12.2.1", + "@multiformats/multiaddr-matcher": "^1.2.0", + "@multiformats/multiaddr-to-uri": "^10.0.1", + "interface-blockstore": "^5.2.10", + "interface-store": "^5.1.8", + "multiformats": "^13.1.0", + "progress-events": "^1.0.0" + } + }, + "node_modules/@helia/http/node_modules/@helia/utils": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/@helia/utils/-/utils-0.3.0.tgz", + "integrity": "sha512-lCOd5DsimmUrp9+TyxWDkvhDFvI+Hgn7PevQHGya3AwmJXxsuCY6FtRgd7YkdaoqAm4+q7L710UnUtp5AmHlVA==", + "dependencies": { + "@helia/interface": "^4.3.0", + "@ipld/dag-cbor": "^9.2.0", + "@ipld/dag-json": "^10.2.0", + "@ipld/dag-pb": "^4.1.0", + "@libp2p/crypto": "^4.0.6", + "@libp2p/interface": "^1.1.4", + "@libp2p/logger": "^4.0.7", + "@libp2p/utils": "^5.2.6", + "@multiformats/dns": "^1.0.1", + "@types/murmurhash3js-revisited": "^3.0.3", + "any-signal": "^4.1.1", + "blockstore-core": "^4.4.1", + "cborg": "^4.0.9", + "interface-blockstore": "^5.2.10", + "interface-datastore": "^8.2.11", + "interface-store": "^5.1.8", + "it-drain": "^3.0.5", + "it-filter": "^3.0.4", + "it-foreach": "^2.0.6", + "it-merge": "^3.0.3", + "mortice": "^3.0.4", + "multiformats": "^13.1.0", + "murmurhash3js-revisited": "^3.0.0", + "p-defer": "^4.0.1", + "progress-events": "^1.0.0", + "uint8arraylist": "^2.4.8", + "uint8arrays": "^5.0.2" + } + }, + "node_modules/@helia/interface": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/@helia/interface/-/interface-4.3.0.tgz", + "integrity": "sha512-gaWQSVGIcOkK0Wx12qUiUMFLPI8AjQCYaf4dpZdciSYPNfKOtPpW54QGzgrQYBcvBgPzg16hnnvDGwLeL2WlAQ==", + "dependencies": { + "@libp2p/interface": "^1.1.4", + "@multiformats/dns": "^1.0.1", + "interface-blockstore": "^5.2.10", + "interface-datastore": "^8.2.11", + "interface-store": "^5.1.8", + "multiformats": "^13.1.0", + "progress-events": "^1.0.0" + } + }, + "node_modules/@helia/ipns": { + "version": "7.2.2", + "resolved": "https://registry.npmjs.org/@helia/ipns/-/ipns-7.2.2.tgz", + "integrity": "sha512-9FX0/93nT5ueaFMFzhbS+YWx/YHoqVnr11ZIfDMOIleU7WC0U84W/J7n1k21yNDajFIHqXQJNFm68geJaP42Ig==", + "dependencies": { + "@helia/interface": "^4.3.0", + "@libp2p/interface": "^1.1.4", + "@libp2p/kad-dht": "^12.0.8", + "@libp2p/logger": "^4.0.7", + "@libp2p/peer-id": "^4.0.7", + "@multiformats/dns": "^1.0.1", + "interface-datastore": "^8.2.11", + "ipns": "^9.1.0", + "multiformats": "^13.1.0", + "progress-events": "^1.0.0", + "uint8arrays": "^5.0.2" + } + }, + "node_modules/@helia/routers": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@helia/routers/-/routers-1.1.0.tgz", + "integrity": "sha512-WwHcvN8No6+3alTrxNXtTJdqfyX0Ymm41u5yL+1YFdsvRKKy5RLxNlgla34kFJaHuQGPFdROYP/9X4UaHpvcIQ==", + "dependencies": { + "@helia/delegated-routing-v1-http-api-client": "^3.0.0", + "@helia/interface": "^4.3.0", + "@libp2p/interface": "^1.1.4", + "@multiformats/uri-to-multiaddr": "^8.0.0", + "ipns": "^9.0.0", + "it-first": "^3.0.4", + "it-map": "^3.0.5", + "multiformats": "^13.1.0", + "uint8arrays": "^5.0.2" + } + }, + "node_modules/@helia/utils": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/@helia/utils/-/utils-0.2.0.tgz", + "integrity": "sha512-osC2VIozCfXpZyuoIm5Tor2eYD5zfW/OPiziJPnpInKM4hXD6QLexM+Zx3cz2T4X7zWRG9pLrHFJpAsKoRfJqg==", + "dependencies": { + "@helia/interface": "^4.2.0", + "@ipld/dag-cbor": "^9.2.0", + "@ipld/dag-json": "^10.2.0", + "@ipld/dag-pb": "^4.1.0", + "@libp2p/crypto": "^4.0.6", + "@libp2p/interface": "^1.1.4", + "@libp2p/logger": "^4.0.7", + "@libp2p/utils": "^5.2.6", + "@multiformats/dns": "^1.0.1", + "@types/murmurhash3js-revisited": "^3.0.3", + "any-signal": "^4.1.1", + "blockstore-core": "^4.4.1", + "cborg": "^4.0.9", + "interface-blockstore": "^5.2.10", + "interface-datastore": "^8.2.11", + "interface-store": "^5.1.8", + "it-drain": "^3.0.5", + "it-filter": "^3.0.4", + "it-foreach": "^2.0.6", + "it-merge": "^3.0.3", + "mortice": "^3.0.4", + "multiformats": "^13.1.0", + "murmurhash3js-revisited": "^3.0.0", + "p-defer": "^4.0.1", + "progress-events": "^1.0.0", + "uint8arraylist": "^2.4.8", + "uint8arrays": "^5.0.2" + } + }, + "node_modules/@helia/verified-fetch": { + "version": "1.3.14", + "resolved": "https://registry.npmjs.org/@helia/verified-fetch/-/verified-fetch-1.3.14.tgz", + "integrity": "sha512-UK2mMMIZpgDIH5MfsBdlRtrBfx9wjGZL1xqIWmA91Fuk+DovQN12jui7zpfaARe4S1B4QyYHNhggUADGRx0UHA==", + "dependencies": { + "@helia/block-brokers": "^2.1.0", + "@helia/car": "^3.1.3", + "@helia/http": "^1.0.4", + "@helia/interface": "^4.2.0", + "@helia/ipns": "^7.2.1", + "@helia/routers": "^1.0.3", + "@ipld/dag-cbor": "^9.2.0", + "@ipld/dag-json": "^10.2.0", + "@ipld/dag-pb": "^4.1.0", + "@libp2p/interface": "^1.1.6", + "@libp2p/kad-dht": "^12.0.11", + "@libp2p/peer-id": "^4.0.9", + "@multiformats/dns": "^1.0.6", + "cborg": "^4.2.0", + "hashlru": "^2.3.0", + "interface-blockstore": "^5.2.10", + "interface-datastore": "^8.2.11", + "ipfs-unixfs-exporter": "^13.5.0", + "it-map": "^3.0.5", + "it-pipe": "^3.0.1", + "it-tar": "^6.0.5", + "it-to-browser-readablestream": "^2.0.6", + "multiformats": "^13.1.0", + "progress-events": "^1.0.0", + "uint8arrays": "^5.0.3" + } + }, "node_modules/@humanwhocodes/config-array": { "version": "0.11.14", "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.14.tgz", @@ -513,6 +829,59 @@ "integrity": "sha512-93zYdMES/c1D69yZiKDBj0V24vqNzB/koF26KPaagAfd3P/4gUlh3Dys5ogAK+Exi9QyzlD8x/08Zt7wIKcDcA==", "dev": true }, + "node_modules/@ipld/car": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/@ipld/car/-/car-5.3.0.tgz", + "integrity": "sha512-OB8LVvJeVAFFGluNIkZeDZ/aGeoekFKsuIvNT9I5sJIb5WekQuW5+lekjQ7Z7mZ7DBKuke/kI4jBT1j0/akU1w==", + "dependencies": { + "@ipld/dag-cbor": "^9.0.7", + "cborg": "^4.0.5", + "multiformats": "^13.0.0", + "varint": "^6.0.0" + }, + "engines": { + "node": ">=16.0.0", + "npm": ">=7.0.0" + } + }, + "node_modules/@ipld/dag-cbor": { + "version": "9.2.0", + "resolved": "https://registry.npmjs.org/@ipld/dag-cbor/-/dag-cbor-9.2.0.tgz", + "integrity": "sha512-N14oMy0q4gM6OuZkIpisKe0JBSjf1Jb39VI+7jMLiWX9124u1Z3Fdj/Tag1NA0cVxxqWDh0CqsjcVfOKtelPDA==", + "dependencies": { + "cborg": "^4.0.0", + "multiformats": "^13.1.0" + }, + "engines": { + "node": ">=16.0.0", + "npm": ">=7.0.0" + } + }, + "node_modules/@ipld/dag-json": { + "version": "10.2.0", + "resolved": "https://registry.npmjs.org/@ipld/dag-json/-/dag-json-10.2.0.tgz", + "integrity": "sha512-O9YLUrl3d3WbVz7v1WkajFkyfOLEe2Fep+wor4fgVe0ywxzrivrj437NiPcVyB+2EDdFn/Q7tCHFf8YVhDf8ZA==", + "dependencies": { + "cborg": "^4.0.0", + "multiformats": "^13.1.0" + }, + "engines": { + "node": ">=16.0.0", + "npm": ">=7.0.0" + } + }, + "node_modules/@ipld/dag-pb": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/@ipld/dag-pb/-/dag-pb-4.1.0.tgz", + "integrity": "sha512-LJU451Drqs5zjFm7jI4Hs3kHlilOqkjcSfPiQgVsZnWaYb2C7YdfhnclrVn/X+ucKejlU9BL3+gXFCZUXkMuCg==", + "dependencies": { + "multiformats": "^13.1.0" + }, + "engines": { + "node": ">=16.0.0", + "npm": ">=7.0.0" + } + }, "node_modules/@jest/schemas": { "version": "29.6.3", "resolved": "https://registry.npmjs.org/@jest/schemas/-/schemas-29.6.3.tgz", @@ -529,6 +898,279 @@ "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz", "integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==" }, + "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==" + }, + "node_modules/@libp2p/crypto": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/@libp2p/crypto/-/crypto-4.1.1.tgz", + "integrity": "sha512-ju7P18Swd0CAa4ud31PBQdxPN++6dFl49RrH4F4yh5HYA3hXL18nbioH18iJ4WAahzjNQsdRMYzTQLWAUZPAkg==", + "dependencies": { + "@libp2p/interface": "^1.3.1", + "@noble/curves": "^1.4.0", + "@noble/hashes": "^1.4.0", + "asn1js": "^3.0.5", + "multiformats": "^13.1.0", + "protons-runtime": "^5.4.0", + "uint8arraylist": "^2.4.8", + "uint8arrays": "^5.0.3" + } + }, + "node_modules/@libp2p/crypto/node_modules/@noble/curves": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/@noble/curves/-/curves-1.4.0.tgz", + "integrity": "sha512-p+4cb332SFCrReJkCYe8Xzm0OWi4Jji5jVdIZRL/PmacmDkFNw6MrrV+gGpiPxLHbV+zKFRywUWbaseT+tZRXg==", + "dependencies": { + "@noble/hashes": "1.4.0" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/@libp2p/crypto/node_modules/@noble/hashes": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.4.0.tgz", + "integrity": "sha512-V1JJ1WTRUqHHrOSh597hURcMqVKVGL/ea3kv0gSnEdsEZ0/+VyPghM1lMNGc00z7CIQorSvbKpuJkxvuHbvdbg==", + "engines": { + "node": ">= 16" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/@libp2p/interface": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/@libp2p/interface/-/interface-1.3.1.tgz", + "integrity": "sha512-KJoYP6biAgIHUU3pxaixaaYCvIHZshzXetxfoNigadAZ3hCGuwpdFhk7IABEaI3RgadOOYUwW3MXPbL+cxnXVQ==", + "dependencies": { + "@multiformats/multiaddr": "^12.2.1", + "it-pushable": "^3.2.3", + "it-stream-types": "^2.0.1", + "multiformats": "^13.1.0", + "progress-events": "^1.0.0", + "uint8arraylist": "^2.4.8" + } + }, + "node_modules/@libp2p/interface-internal": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@libp2p/interface-internal/-/interface-internal-1.2.0.tgz", + "integrity": "sha512-7jrVw3I9B7l6TiKIq199sn0y1BlPVfFGrYE8h02RLLEEuq64q4Gx+/UGmCo7aD3E4+wCcrCLP37O4LZxjAhWUQ==", + "dependencies": { + "@libp2p/interface": "^1.3.1", + "@libp2p/peer-collections": "^5.2.0", + "@multiformats/multiaddr": "^12.2.1", + "uint8arraylist": "^2.4.8" + } + }, + "node_modules/@libp2p/interfaces": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/@libp2p/interfaces/-/interfaces-3.3.2.tgz", + "integrity": "sha512-p/M7plbrxLzuQchvNwww1Was7ZeGE2NaOFulMaZBYIihU8z3fhaV+a033OqnC/0NTX/yhfdNOG7znhYq3XoR/g==", + "engines": { + "node": ">=16.0.0", + "npm": ">=7.0.0" + } + }, + "node_modules/@libp2p/kad-dht": { + "version": "12.0.15", + "resolved": "https://registry.npmjs.org/@libp2p/kad-dht/-/kad-dht-12.0.15.tgz", + "integrity": "sha512-BY4/0hok8PhvaOL31AvX0CkQC3j0yUgahzMNr2gqLI9wbCiuiOqzo4FSuJ0gIkv8I9XcGS6L+CfZ44SpsUZPEA==", + "dependencies": { + "@libp2p/crypto": "^4.1.1", + "@libp2p/interface": "^1.3.1", + "@libp2p/interface-internal": "^1.2.0", + "@libp2p/peer-collections": "^5.2.0", + "@libp2p/peer-id": "^4.1.1", + "@libp2p/record": "^4.0.1", + "@libp2p/utils": "^5.4.0", + "@multiformats/multiaddr": "^12.2.1", + "any-signal": "^4.1.1", + "hashlru": "^2.3.0", + "interface-datastore": "^8.2.11", + "it-drain": "^3.0.5", + "it-length": "^3.0.4", + "it-length-prefixed": "^9.0.4", + "it-map": "^3.0.5", + "it-merge": "^3.0.3", + "it-parallel": "^3.0.6", + "it-pipe": "^3.0.1", + "it-protobuf-stream": "^1.1.2", + "it-pushable": "^3.2.3", + "it-take": "^3.0.4", + "multiformats": "^13.1.0", + "p-defer": "^4.0.1", + "p-event": "^6.0.1", + "p-queue": "^8.0.1", + "progress-events": "^1.0.0", + "protons-runtime": "^5.4.0", + "race-signal": "^1.0.2", + "uint8-varint": "^2.0.4", + "uint8arraylist": "^2.4.8", + "uint8arrays": "^5.0.3" + } + }, + "node_modules/@libp2p/logger": { + "version": "4.0.12", + "resolved": "https://registry.npmjs.org/@libp2p/logger/-/logger-4.0.12.tgz", + "integrity": "sha512-eSiHY06Zijq6b1rMBob/ZuGBEavFm8IPNPEzeOU3JrBU7v/OV8Da0FesbemtkudZVPRi8mqRoOiIwmWn0mObng==", + "dependencies": { + "@libp2p/interface": "^1.3.1", + "@multiformats/multiaddr": "^12.2.1", + "debug": "^4.3.4", + "interface-datastore": "^8.2.11", + "multiformats": "^13.1.0" + } + }, + "node_modules/@libp2p/peer-collections": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@libp2p/peer-collections/-/peer-collections-5.2.0.tgz", + "integrity": "sha512-I8fXe+3ToYJaXXodddEtj1Ix2gyfz46NzL5i47e776wwCZhtQqjA1kbhTkO8bQogHYSub0SEWxsjm1HL9dtSYw==", + "dependencies": { + "@libp2p/interface": "^1.3.1", + "@libp2p/peer-id": "^4.1.1", + "@libp2p/utils": "^5.4.0" + } + }, + "node_modules/@libp2p/peer-id": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/@libp2p/peer-id/-/peer-id-4.1.1.tgz", + "integrity": "sha512-Fu25drhhdc5JDWb3x33u+5p9I3F2tmYrlx2aiwD5Kv70RLKC9k7B1m4iywBkFE82QKUPtT21IrVYlwsm46znqQ==", + "dependencies": { + "@libp2p/interface": "^1.3.1", + "multiformats": "^13.1.0", + "uint8arrays": "^5.0.3" + } + }, + "node_modules/@libp2p/record": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@libp2p/record/-/record-4.0.1.tgz", + "integrity": "sha512-hflqTiuuMI7GzmTyvycv7y9wvR/xePD/06gcY2ePnWkA1jWlIuebegEbs6+E6MSHQRnmnfecpeZDVRFOQVUSEw==", + "dependencies": { + "protons-runtime": "^5.4.0", + "uint8arraylist": "^2.4.8", + "uint8arrays": "^5.0.3" + } + }, + "node_modules/@libp2p/utils": { + "version": "5.4.0", + "resolved": "https://registry.npmjs.org/@libp2p/utils/-/utils-5.4.0.tgz", + "integrity": "sha512-tEBhg5g06vQbR+x51U2N5xAWFNrQpVIVnJZX8urrKcxTRQnJk57Uka2eTEtBj8AxgQ0DDC7a5r2km2X50ja/EA==", + "dependencies": { + "@chainsafe/is-ip": "^2.0.2", + "@libp2p/crypto": "^4.1.1", + "@libp2p/interface": "^1.3.1", + "@libp2p/logger": "^4.0.12", + "@multiformats/multiaddr": "^12.2.1", + "@multiformats/multiaddr-matcher": "^1.2.0", + "@sindresorhus/fnv1a": "^3.1.0", + "@types/murmurhash3js-revisited": "^3.0.3", + "delay": "^6.0.0", + "get-iterator": "^2.0.1", + "is-loopback-addr": "^2.0.2", + "it-pushable": "^3.2.3", + "it-stream-types": "^2.0.1", + "murmurhash3js-revisited": "^3.0.0", + "netmask": "^2.0.2", + "p-defer": "^4.0.1", + "race-event": "^1.2.0", + "race-signal": "^1.0.2", + "uint8arraylist": "^2.4.8", + "uint8arrays": "^5.0.3" + } + }, + "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==", + "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/dns/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" + } + ], + "dependencies": { + "base64-js": "^1.3.1", + "ieee754": "^1.2.1" + } + }, + "node_modules/@multiformats/multiaddr": { + "version": "12.2.1", + "resolved": "https://registry.npmjs.org/@multiformats/multiaddr/-/multiaddr-12.2.1.tgz", + "integrity": "sha512-UwjoArBbv64FlaetV4DDwh+PUMfzXUBltxQwdh+uTYnGFzVa8ZfJsn1vt1RJlJ6+Xtrm3RMekF/B+K338i2L5Q==", + "dependencies": { + "@chainsafe/is-ip": "^2.0.1", + "@chainsafe/netmask": "^2.0.0", + "@libp2p/interface": "^1.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.2.1", + "resolved": "https://registry.npmjs.org/@multiformats/multiaddr-matcher/-/multiaddr-matcher-1.2.1.tgz", + "integrity": "sha512-rcf8RSsvOkJcMoNaGgEPXgoCyvorGBOyNfj1TYX2IHcI8FhqDcuzuYwzuHz6wlsTwi4ADDNU2azGcOXftCnfYA==", + "dependencies": { + "@chainsafe/is-ip": "^2.0.1", + "@multiformats/multiaddr": "^12.0.0", + "multiformats": "^13.0.0" + } + }, + "node_modules/@multiformats/multiaddr-to-uri": { + "version": "10.0.1", + "resolved": "https://registry.npmjs.org/@multiformats/multiaddr-to-uri/-/multiaddr-to-uri-10.0.1.tgz", + "integrity": "sha512-RtOBRJucMCzINPytvt1y7tJ2jr4aSKJmv3DF7/C515RJO9+nu9sZHdsk9vn251OtN8k21rAGlIHESt/BSJWAnQ==", + "dependencies": { + "@multiformats/multiaddr": "^12.0.0" + } + }, + "node_modules/@multiformats/murmur3": { + "version": "2.1.8", + "resolved": "https://registry.npmjs.org/@multiformats/murmur3/-/murmur3-2.1.8.tgz", + "integrity": "sha512-6vId1C46ra3R1sbJUOFCZnsUIveR9oF20yhPmAFxPm0JfrX3/ZRCgP3YDrBzlGoEppOXnA9czHeYc0T9mB6hbA==", + "dependencies": { + "multiformats": "^13.0.0", + "murmurhash3js-revisited": "^3.0.0" + }, + "engines": { + "node": ">=16.0.0", + "npm": ">=7.0.0" + } + }, + "node_modules/@multiformats/uri-to-multiaddr": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/@multiformats/uri-to-multiaddr/-/uri-to-multiaddr-8.0.0.tgz", + "integrity": "sha512-86O+gY6JTnCv0O/IxTKV+1+GACoEBTr5Cfyh+FdzStWneviz2AZwLK8Hsys5dbfMgT//Vs7FolMiEHURlCel8w==", + "dependencies": { + "@multiformats/multiaddr": "^12.1.14", + "is-ip": "^5.0.0" + } + }, "node_modules/@noble/curves": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/@noble/curves/-/curves-1.2.0.tgz", @@ -816,6 +1458,17 @@ "resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.27.8.tgz", "integrity": "sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA==" }, + "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==", + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/@types/body-parser": { "version": "1.19.5", "resolved": "https://registry.npmjs.org/@types/body-parser/-/body-parser-1.19.5.tgz", @@ -857,6 +1510,14 @@ "@types/node": "*" } }, + "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==", + "dependencies": { + "@types/node": "*" + } + }, "node_modules/@types/estree": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.5.tgz", @@ -917,6 +1578,11 @@ "integrity": "sha512-/pyBZWSLD2n0dcHE3hq8s8ZvcETHtEuF+3E7XVt0Ig2nvsVQXdghHVcEkIWjy9A0wKfTn97a/PSDYohKIlnP/w==", "dev": true }, + "node_modules/@types/murmurhash3js-revisited": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/@types/murmurhash3js-revisited/-/murmurhash3js-revisited-3.0.3.tgz", + "integrity": "sha512-QvlqvYtGBYIDeO8dFdY4djkRubcrc+yTJtBc7n8VZPlJDUS/00A+PssbvERM8f9bYRmcaSEHPZgZojeQj7kzAA==" + }, "node_modules/@types/node": { "version": "20.12.8", "resolved": "https://registry.npmjs.org/@types/node/-/node-20.12.8.tgz", @@ -1486,6 +2152,15 @@ "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, + "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==", + "engines": { + "node": ">=16.0.0", + "npm": ">=7.0.0" + } + }, "node_modules/argparse": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", @@ -1506,6 +2181,19 @@ "node": ">=8" } }, + "node_modules/asn1js": { + "version": "3.0.5", + "resolved": "https://registry.npmjs.org/asn1js/-/asn1js-3.0.5.tgz", + "integrity": "sha512-FVnvrKJwpt9LP2lAMl8qZswRNm3T4q9CON+bxldk2iwk3FFpuwhx2FfinyitizWHsVYyaY+y5JzDR0rCMV5yTQ==", + "dependencies": { + "pvtsutils": "^1.3.2", + "pvutils": "^1.1.3", + "tslib": "^2.4.0" + }, + "engines": { + "node": ">=12.0.0" + } + }, "node_modules/assertion-error": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-1.1.0.tgz", @@ -1580,6 +2268,22 @@ "readable-stream": "^3.4.0" } }, + "node_modules/blockstore-core": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/blockstore-core/-/blockstore-core-4.4.1.tgz", + "integrity": "sha512-peXfL9ZLx1cb84QALocMjhT8CsQ4JsreI/AitlN1inipSdC/G+jcYVJCqeCD5ecSTv/0LMpg8NlAPH/eBYZLjA==", + "dependencies": { + "@libp2p/logger": "^4.0.6", + "err-code": "^3.0.1", + "interface-blockstore": "^5.0.0", + "interface-store": "^5.0.0", + "it-drain": "^3.0.5", + "it-filter": "^3.0.4", + "it-merge": "^3.0.3", + "it-pushable": "^3.2.3", + "multiformats": "^13.0.1" + } + }, "node_modules/body-parser": { "version": "1.20.2", "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.2.tgz", @@ -1638,6 +2342,11 @@ "node": ">=8" } }, + "node_modules/browser-readablestream-to-it": { + "version": "2.0.7", + "resolved": "https://registry.npmjs.org/browser-readablestream-to-it/-/browser-readablestream-to-it-2.0.7.tgz", + "integrity": "sha512-g1Aznml3HmqTLSXylZhGwdfnAa67+vlNAYhT9ROJZkAxY7yYmWusND10olvCMPe4sVhZyVwn5tPkRzOg85kBEg==" + }, "node_modules/buffer": { "version": "5.7.1", "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz", @@ -1709,6 +2418,14 @@ "node": ">=6" } }, + "node_modules/cborg": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/cborg/-/cborg-4.2.0.tgz", + "integrity": "sha512-q6cFW5m3KxfP/9xGI3yGLaC1l5DP6DWM9IvjiJojnIwohL5CQDl02EXViPV852mOfQo+7PJGPN01MI87vFGzyA==", + "bin": { + "cborg": "lib/bin.js" + } + }, "node_modules/chai": { "version": "4.4.1", "resolved": "https://registry.npmjs.org/chai/-/chai-4.4.1.tgz", @@ -1874,6 +2591,20 @@ "node": ">=12" } }, + "node_modules/clone-regexp": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/clone-regexp/-/clone-regexp-3.0.0.tgz", + "integrity": "sha512-ujdnoq2Kxb8s3ItNBtnYeXdm07FcU0u8ARAT1lQ2YdMwQC+cdiXX8KoqMVuglztILivceTtp4ivqGSmEmhBUJw==", + "dependencies": { + "is-regexp": "^3.0.0" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/color-convert": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", @@ -1951,6 +2682,17 @@ "node": ">= 0.6" } }, + "node_modules/convert-hrtime": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/convert-hrtime/-/convert-hrtime-5.0.0.tgz", + "integrity": "sha512-lOETlkIeYSJWcbbcvjRKGxVMXJR+8+OQb/mTPbA4ObPMytYIsUbuOE0Jzy60hjARYszq1id0j8KgVhC+WGZVTg==", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/cookie": { "version": "0.6.0", "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.6.0.tgz", @@ -1990,6 +2732,25 @@ "node": ">= 8" } }, + "node_modules/datastore-core": { + "version": "9.2.9", + "resolved": "https://registry.npmjs.org/datastore-core/-/datastore-core-9.2.9.tgz", + "integrity": "sha512-wraWTPsbtdE7FFaVo3pwPuTB/zXsgwGGAm8BgBYwYAuzZCTS0MfXmd/HH1vR9s0/NFFjOVmBkGiWCvKxZ+QjVw==", + "dependencies": { + "@libp2p/logger": "^4.0.6", + "err-code": "^3.0.1", + "interface-datastore": "^8.0.0", + "interface-store": "^5.0.0", + "it-drain": "^3.0.5", + "it-filter": "^3.0.4", + "it-map": "^3.0.5", + "it-merge": "^3.0.3", + "it-pipe": "^3.0.1", + "it-pushable": "^3.2.3", + "it-sort": "^3.0.4", + "it-take": "^3.0.4" + } + }, "node_modules/date-fns": { "version": "2.30.0", "resolved": "https://registry.npmjs.org/date-fns/-/date-fns-2.30.0.tgz", @@ -2076,6 +2837,17 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/delay": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/delay/-/delay-6.0.0.tgz", + "integrity": "sha512-2NJozoOHQ4NuZuVIr5CWd0iiLVIRSDepakaovIN+9eIDHEhdCAEvSy2cuf1DCrPPQLvHmbqTHODlhHg8UCy4zw==", + "engines": { + "node": ">=16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/depd": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", @@ -2121,6 +2893,17 @@ "node": ">=8" } }, + "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==", + "dependencies": { + "@leichtgewicht/ip-codec": "^2.0.1" + }, + "engines": { + "node": ">=6" + } + }, "node_modules/doctrine": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", @@ -2189,6 +2972,11 @@ "once": "^1.4.0" } }, + "node_modules/err-code": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/err-code/-/err-code-3.0.1.tgz", + "integrity": "sha512-GiaH0KJUewYok+eeY05IIgjtAe4Yltygk9Wqp1V5yVWLdhf0hYZchRjNIT9bb0mSwRcIusT3cx7PJUf3zEIfUA==" + }, "node_modules/es-define-property": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.0.tgz", @@ -2708,6 +3496,17 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/function-timeout": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/function-timeout/-/function-timeout-0.1.1.tgz", + "integrity": "sha512-0NVVC0TaP7dSTvn1yMiy6d6Q8gifzbvQafO46RtLG/kHJUBNd+pVRGOBoK44wNBvtSPUJRfdVvkFdD3p0xvyZg==", + "engines": { + "node": ">=14.16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/get-caller-file": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", @@ -2742,6 +3541,11 @@ "url": "https://github.com/sponsors/ljharb" } }, + "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==" + }, "node_modules/github-from-package": { "version": "0.0.0", "resolved": "https://registry.npmjs.org/github-from-package/-/github-from-package-0.0.0.tgz", @@ -3067,6 +3871,15 @@ "graphql": ">=0.11 <=16" } }, + "node_modules/hamt-sharding": { + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/hamt-sharding/-/hamt-sharding-3.0.6.tgz", + "integrity": "sha512-nZeamxfymIWLpVcAN0CRrb7uVq3hCOGj9IcL6NMA6VVCVWqj+h9Jo/SmaWuS92AEDf1thmHsM5D5c70hM3j2Tg==", + "dependencies": { + "sparse-array": "^1.3.1", + "uint8arrays": "^5.0.1" + } + }, "node_modules/has-flag": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", @@ -3108,6 +3921,11 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/hashlru": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/hashlru/-/hashlru-2.3.0.tgz", + "integrity": "sha512-0cMsjjIC8I+D3M44pOQdsy0OHXGLVz6Z0beRuufhKa0KfaD2wGwAev6jILzXsd3/vpnNQJmWyZtIILqM1N+n5A==" + }, "node_modules/hasown": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", @@ -3218,6 +4036,40 @@ "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz", "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==" }, + "node_modules/interface-blockstore": { + "version": "5.2.10", + "resolved": "https://registry.npmjs.org/interface-blockstore/-/interface-blockstore-5.2.10.tgz", + "integrity": "sha512-9K48hTvBCGsKVD3pF4ILgDcf+W2P/gq0oxLcsHGB6E6W6nDutYkzR+7k7bCs9REHrBEfKzcVDEKieiuNM9WRZg==", + "dependencies": { + "interface-store": "^5.0.0", + "multiformats": "^13.0.1" + } + }, + "node_modules/interface-datastore": { + "version": "8.2.11", + "resolved": "https://registry.npmjs.org/interface-datastore/-/interface-datastore-8.2.11.tgz", + "integrity": "sha512-9E0iXehfp/j0UbZ2mvlYB4K9pP7uQBCppfuy8WHs1EHF6wLQrM9+zwyX+8Qt6HnH4GKZRyXX/CNXm6oD4+QYgA==", + "dependencies": { + "interface-store": "^5.0.0", + "uint8arrays": "^5.0.2" + } + }, + "node_modules/interface-store": { + "version": "5.1.8", + "resolved": "https://registry.npmjs.org/interface-store/-/interface-store-5.1.8.tgz", + "integrity": "sha512-7na81Uxkl0vqk0CBPO5PvyTkdaJBaezwUJGsMOz7riPOq0rJt+7W31iaopaMICWea/iykUsvNlPx/Tc+MxC3/w==" + }, + "node_modules/ip-regex": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/ip-regex/-/ip-regex-5.0.0.tgz", + "integrity": "sha512-fOCG6lhoKKakwv+C6KdsOnGvgXnmgfmp0myi3bcNwj3qfwPAxRKWEuFhvEFF7ceYIz6+1jRZ+yguLFAmUNPEfw==", + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/ipaddr.js": { "version": "1.9.1", "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz", @@ -3226,6 +4078,59 @@ "node": ">= 0.10" } }, + "node_modules/ipfs-unixfs": { + "version": "11.1.4", + "resolved": "https://registry.npmjs.org/ipfs-unixfs/-/ipfs-unixfs-11.1.4.tgz", + "integrity": "sha512-RE4nyx5qgG2w7JOLj0Y0D7SfAR1ZkEdramNaBx0OSD4DlQ2Y2NORgc4FHfej3Pgy31v+QISDVP1pQJhdv3bUUg==", + "dependencies": { + "err-code": "^3.0.1", + "protons-runtime": "^5.4.0", + "uint8arraylist": "^2.4.8" + } + }, + "node_modules/ipfs-unixfs-exporter": { + "version": "13.5.0", + "resolved": "https://registry.npmjs.org/ipfs-unixfs-exporter/-/ipfs-unixfs-exporter-13.5.0.tgz", + "integrity": "sha512-s1eWXzoyhQFNEAB1p+QE3adjhW+lBdgpORmmjiCLiruHs5z7T5zsAgRVcWpM8LWYhq2flRtJHObb7Hg73J+oLQ==", + "dependencies": { + "@ipld/dag-cbor": "^9.0.0", + "@ipld/dag-json": "^10.1.7", + "@ipld/dag-pb": "^4.0.0", + "@multiformats/murmur3": "^2.0.0", + "err-code": "^3.0.1", + "hamt-sharding": "^3.0.0", + "interface-blockstore": "^5.0.0", + "ipfs-unixfs": "^11.0.0", + "it-filter": "^3.0.2", + "it-last": "^3.0.2", + "it-map": "^3.0.3", + "it-parallel": "^3.0.0", + "it-pipe": "^3.0.1", + "it-pushable": "^3.1.0", + "multiformats": "^13.0.0", + "p-queue": "^8.0.1", + "progress-events": "^1.0.0" + } + }, + "node_modules/ipns": { + "version": "9.1.0", + "resolved": "https://registry.npmjs.org/ipns/-/ipns-9.1.0.tgz", + "integrity": "sha512-up2o1Qx9tSSfh73k69j3/Acacua6JbffTe5xA8+/fv6ibkQyhriMPHlgae1896DwmQkJrusKgBs7EAOi3yrO2w==", + "dependencies": { + "@libp2p/crypto": "^4.0.0", + "@libp2p/interface": "^1.1.0", + "@libp2p/logger": "^4.0.3", + "@libp2p/peer-id": "^4.0.3", + "cborg": "^4.0.1", + "err-code": "^3.0.1", + "interface-datastore": "^8.1.0", + "multiformats": "^13.0.0", + "protons-runtime": "^5.2.1", + "timestamp-nano": "^1.0.0", + "uint8arraylist": "^2.4.8", + "uint8arrays": "^5.0.1" + } + }, "node_modules/is-extglob": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", @@ -3255,6 +4160,26 @@ "node": ">=0.10.0" } }, + "node_modules/is-ip": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/is-ip/-/is-ip-5.0.1.tgz", + "integrity": "sha512-FCsGHdlrOnZQcp0+XT5a+pYowf33itBalCl+7ovNXC/7o5BhIpG14M3OrpPPdBSIQJCm+0M5+9mO7S9VVTTCFw==", + "dependencies": { + "ip-regex": "^5.0.0", + "super-regex": "^0.2.0" + }, + "engines": { + "node": ">=14.16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "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==" + }, "node_modules/is-number": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", @@ -3273,12 +4198,32 @@ "node": ">=8" } }, + "node_modules/is-regexp": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/is-regexp/-/is-regexp-3.1.0.tgz", + "integrity": "sha512-rbku49cWloU5bSMI+zaRaXdQHXnthP6DZ/vLnfdSKyL4zUzuWnomtOEiZZOd+ioQ+avFo/qau3KPTc7Fjy1uPA==", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/isexe": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", "dev": true }, + "node_modules/iso-constants": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/iso-constants/-/iso-constants-0.1.2.tgz", + "integrity": "sha512-OTCM5ZCQsHBCI4Wdu4tSxvDIkmDHd5EwJDps5mKqnQnWJSKlnwMs3EDZ4n3Fh1tmkWkDlyd2vCDbEYuPbyrUNQ==", + "hasInstallScript": true, + "engines": { + "node": ">=10" + } + }, "node_modules/isows": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/isows/-/isows-1.0.3.tgz", @@ -3293,6 +4238,221 @@ "ws": "*" } }, + "node_modules/it-all": { + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/it-all/-/it-all-3.0.6.tgz", + "integrity": "sha512-HXZWbxCgQZJfrv5rXvaVeaayXED8nTKx9tj9fpBhmcUJcedVZshMMMqTj0RG2+scGypb9Ut1zd1ifbf3lA8L+Q==" + }, + "node_modules/it-byte-stream": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/it-byte-stream/-/it-byte-stream-1.0.10.tgz", + "integrity": "sha512-wjEADMuCS7PtnAGDjLGZ9n2+J+c6F/3a64ZfLVw2DCSKJWxwEQv+kQ2GUqArQVwkF+cKL6p7ka5cfbm+rwkwzg==", + "dependencies": { + "it-stream-types": "^2.0.1", + "p-defer": "^4.0.1", + "race-signal": "^1.0.2", + "uint8arraylist": "^2.4.8" + } + }, + "node_modules/it-drain": { + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/it-drain/-/it-drain-3.0.7.tgz", + "integrity": "sha512-vy6S1JKjjHSIFHgBpLpD1zhkCRl3z1zYWUxE14+kAYf+BL9ssWSFImJfhl361IIcwr0ofw8etzg11VqqB+ntUA==" + }, + "node_modules/it-filter": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/it-filter/-/it-filter-3.1.0.tgz", + "integrity": "sha512-FiYuzdsUhmMZJTJQ8YLdgX3ArjQmAtCG1lyrtZd+92/2eC6YO9UoybdrwVj/yyZkuXAPykrSipLuZ+KSKpt29A==", + "dependencies": { + "it-peekable": "^3.0.0" + } + }, + "node_modules/it-first": { + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/it-first/-/it-first-3.0.6.tgz", + "integrity": "sha512-ExIewyK9kXKNAplg2GMeWfgjUcfC1FnUXz/RPfAvIXby+w7U4b3//5Lic0NV03gXT8O/isj5Nmp6KiY0d45pIQ==" + }, + "node_modules/it-foreach": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/it-foreach/-/it-foreach-2.1.0.tgz", + "integrity": "sha512-nobWUecq9E2ED1kcXz2o27yN6KePauSdmxJNMwCduWByrF4WNB2UgBHjr9QV2jPXpEWPDuzxZas9fVhQj1Vovg==", + "dependencies": { + "it-peekable": "^3.0.0" + } + }, + "node_modules/it-last": { + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/it-last/-/it-last-3.0.6.tgz", + "integrity": "sha512-M4/get95O85u2vWvWQinF8SJUc/RPC5bWTveBTYXvlP2q5TF9Y+QhT3nz+CRCyS2YEc66VJkyl/da6WrJ0wKhw==" + }, + "node_modules/it-length": { + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/it-length/-/it-length-3.0.6.tgz", + "integrity": "sha512-R7bxHAzpRzYz7vghc2DDH7x4KXvEkeLfN/h316++jzbkEHIRXbEPLbE20p5yrqqBdOeK6/FRUDuHlTJ0H1hysw==" + }, + "node_modules/it-length-prefixed": { + "version": "9.0.4", + "resolved": "https://registry.npmjs.org/it-length-prefixed/-/it-length-prefixed-9.0.4.tgz", + "integrity": "sha512-lz28fykbG0jq7s5XtvlzGxO5BeSOw6ikymkRllxjL21V5VKLcvB4pHr9wPvEnsAJ2et1xpOk3BRTMq9XrhgKsg==", + "dependencies": { + "err-code": "^3.0.1", + "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.1.7", + "resolved": "https://registry.npmjs.org/it-length-prefixed-stream/-/it-length-prefixed-stream-1.1.7.tgz", + "integrity": "sha512-tH38h/wChpR6As/PD6yWZlpoMuB4wDW2Rxf3QbSt4+O1HTsLYbyZasNhTyIuvQqhebQ30OYrdM0yr9ig5qUvYQ==", + "dependencies": { + "it-byte-stream": "^1.0.0", + "it-stream-types": "^2.0.1", + "uint8-varint": "^2.0.4", + "uint8arraylist": "^2.4.8" + } + }, + "node_modules/it-map": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/it-map/-/it-map-3.1.0.tgz", + "integrity": "sha512-B7zNmHYRE0qes8oTiNYU7jXEF5WvKZNAUosskCks1JT9Z4DNwRClrQyd+C/hgITG8ewDbVZMGx9VXAx3KMY2kA==", + "dependencies": { + "it-peekable": "^3.0.0" + } + }, + "node_modules/it-merge": { + "version": "3.0.5", + "resolved": "https://registry.npmjs.org/it-merge/-/it-merge-3.0.5.tgz", + "integrity": "sha512-2l7+mPf85pyRF5pqi0dKcA54E5Jm/2FyY5GsOaN51Ta0ipC7YZ3szuAsH8wOoB6eKY4XsU4k2X+mzPmFBMayEA==", + "dependencies": { + "it-pushable": "^3.2.3" + } + }, + "node_modules/it-ndjson": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/it-ndjson/-/it-ndjson-1.0.6.tgz", + "integrity": "sha512-44QB+rmfB2C8L2WDv03+J3kcOQYuIPBP3KBN+szZTEsvvNyoQEQSnOXoGouNpRfgMA1rEqqoK6roenCJaBeYSQ==" + }, + "node_modules/it-parallel": { + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/it-parallel/-/it-parallel-3.0.7.tgz", + "integrity": "sha512-aIIc2t8knfER/mQu4uEHaAYZrnj/2Tdp+Vj6BA94Gi7xghx1kblvpyrLkCYO9K+eDyPS1cE3Vfhh9a20MEmzXA==", + "dependencies": { + "p-defer": "^4.0.1" + } + }, + "node_modules/it-peekable": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/it-peekable/-/it-peekable-3.0.4.tgz", + "integrity": "sha512-Bb4xyMX5xAveFyh9ySbCrHMCpIF0+fIbl+0ZkcxP94JVofLe5j/mSBK0gjrrISsSVURVyey8X4L/IqrekOxjiA==" + }, + "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==", + "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": "1.1.3", + "resolved": "https://registry.npmjs.org/it-protobuf-stream/-/it-protobuf-stream-1.1.3.tgz", + "integrity": "sha512-96n+e6X8CXL0JerxTJuEnfivmfLzGKpIGAlJLoH7HEGo2nPRrMe+HxeWGwDF4Un3FphI/Z62JNxSvq/5DxfiQw==", + "dependencies": { + "it-length-prefixed-stream": "^1.0.0", + "it-stream-types": "^2.0.1", + "uint8arraylist": "^2.4.8" + } + }, + "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==", + "dependencies": { + "p-defer": "^4.0.0" + } + }, + "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==", + "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.5", + "resolved": "https://registry.npmjs.org/it-sort/-/it-sort-3.0.5.tgz", + "integrity": "sha512-vFo3wYR+aRDwklp8iH8LKeePmWqXGQrS8JqEdZmbJ58DIGj67n0RT/t5BR8iYps/C/v5IdWsbow1bOCEUfY+hA==", + "dependencies": { + "it-all": "^3.0.0" + } + }, + "node_modules/it-stream-types": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/it-stream-types/-/it-stream-types-2.0.1.tgz", + "integrity": "sha512-6DmOs5r7ERDbvS4q8yLKENcj6Yecr7QQTqWApbZdfAUTEC947d+PEha7PCqhm//9oxaLYL7TWRekwhoXl2s6fg==", + "engines": { + "node": ">=16.0.0", + "npm": ">=7.0.0" + } + }, + "node_modules/it-take": { + "version": "3.0.5", + "resolved": "https://registry.npmjs.org/it-take/-/it-take-3.0.5.tgz", + "integrity": "sha512-4CzqXzx7FAeXsRYBTH0GhkxerH8Sv0nEGIXrO0ZIpECHth59Dm9ZYZ161VPrCQccWIL/Vu6M9YptlbMiEpCIlQ==" + }, + "node_modules/it-tar": { + "version": "6.0.5", + "resolved": "https://registry.npmjs.org/it-tar/-/it-tar-6.0.5.tgz", + "integrity": "sha512-GxKBamsX2EZA6jrNh6xoeKmRpbOELgYhCk1ojhN0TFSBdxwkRBqBRc3sI43vTHRpI7i2o6ptrSxK3LLKWNvudg==", + "dependencies": { + "iso-constants": "^0.1.2", + "it-reader": "^6.0.1", + "it-stream-types": "^2.0.1", + "it-to-buffer": "^4.0.5", + "p-defer": "^4.0.0", + "uint8arraylist": "^2.3.2", + "uint8arrays": "^5.0.2" + }, + "engines": { + "node": ">=16.0.0", + "npm": ">=7.0.0" + } + }, + "node_modules/it-to-browser-readablestream": { + "version": "2.0.9", + "resolved": "https://registry.npmjs.org/it-to-browser-readablestream/-/it-to-browser-readablestream-2.0.9.tgz", + "integrity": "sha512-Q/0OXLOMgZ4Fk62Mrqp3x9QqN/UH9fotftr3dEfqr74Bt8ceClLOTmhkMyrk53R/gRcxdM6tBjzHGBeSjhmPeQ==", + "dependencies": { + "get-iterator": "^2.0.1" + } + }, + "node_modules/it-to-buffer": { + "version": "4.0.7", + "resolved": "https://registry.npmjs.org/it-to-buffer/-/it-to-buffer-4.0.7.tgz", + "integrity": "sha512-c7JXrFg8xntJTPzhg7Dg6WJYm+XW0wBUebvEBrc6zrL/QukGRXclw1OBz6M9Qmqkiorgb3qpsRwKlI/4Q3tmkQ==", + "dependencies": { + "uint8arrays": "^5.0.3" + } + }, "node_modules/iterall": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/iterall/-/iterall-1.3.0.tgz", @@ -3655,11 +4815,34 @@ "ufo": "^1.5.3" } }, + "node_modules/mortice": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/mortice/-/mortice-3.0.4.tgz", + "integrity": "sha512-MUHRCAztSl4v/dAmK8vbYi5u1n9NZtQu4H3FsqS7qgMFQIAFw9lTpHiErd9kJpapqmvEdD1L3dUmiikifAvLsQ==", + "dependencies": { + "observable-webworkers": "^2.0.1", + "p-queue": "^8.0.1", + "p-timeout": "^6.0.0" + } + }, "node_modules/ms": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" }, + "node_modules/multiformats": { + "version": "13.1.0", + "resolved": "https://registry.npmjs.org/multiformats/-/multiformats-13.1.0.tgz", + "integrity": "sha512-HzdtdBwxsIkzpeXzhQ5mAhhuxcHbjEHH+JQoxt7hG/2HGFjjwyolLo7hbaexcnhoEuV4e0TNJ8kkpMjiEYY4VQ==" + }, + "node_modules/murmurhash3js-revisited": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/murmurhash3js-revisited/-/murmurhash3js-revisited-3.0.0.tgz", + "integrity": "sha512-/sF3ee6zvScXMb1XFJ8gDsSnY+X8PbOyjIuBhtgis10W2Jx4ZjIhikUCIF9c4gpJxVnQIsPAFrSwTCuAjicP6g==", + "engines": { + "node": ">=8.0.0" + } + }, "node_modules/nanoid": { "version": "3.3.7", "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.7.tgz", @@ -3696,6 +4879,14 @@ "node": ">= 0.6" } }, + "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==", + "engines": { + "node": ">= 0.4.0" + } + }, "node_modules/node-abi": { "version": "3.62.0", "resolved": "https://registry.npmjs.org/node-abi/-/node-abi-3.62.0.tgz", @@ -3753,6 +4944,15 @@ "url": "https://github.com/sponsors/ljharb" } }, + "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==", + "engines": { + "node": ">=16.0.0", + "npm": ">=7.0.0" + } + }, "node_modules/obuf": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/obuf/-/obuf-1.1.2.tgz", @@ -3794,6 +4994,31 @@ "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==", + "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==", + "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", @@ -3824,6 +5049,37 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/p-queue": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/p-queue/-/p-queue-8.0.1.tgz", + "integrity": "sha512-NXzu9aQJTAzbBqOt2hwsR63ea7yvxJc0PwN/zobNAudYfb1B7R08SzB4TsLeSbUCuG467NhnoT0oO6w1qRO+BA==", + "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==" + }, + "node_modules/p-timeout": { + "version": "6.1.2", + "resolved": "https://registry.npmjs.org/p-timeout/-/p-timeout-6.1.2.tgz", + "integrity": "sha512-UbD77BuZ9Bc9aABo74gfXhNvzC9Tx7SxtHSh1fxvx3jTLLYvmVhiQZZrJzqqU0jKbN32kb5VOKiLEQI/3bIjgQ==", + "engines": { + "node": ">=14.16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/parent-module": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", @@ -4391,6 +5647,25 @@ "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, + "node_modules/progress-events": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/progress-events/-/progress-events-1.0.0.tgz", + "integrity": "sha512-zIB6QDrSbPfRg+33FZalluFIowkbV5Xh1xSuetjG+rlC5he6u2dc6VQJ0TbMdlN3R1RHdpOqxEFMKTnQ+itUwA==", + "engines": { + "node": ">=16.0.0", + "npm": ">=7.0.0" + } + }, + "node_modules/protons-runtime": { + "version": "5.4.0", + "resolved": "https://registry.npmjs.org/protons-runtime/-/protons-runtime-5.4.0.tgz", + "integrity": "sha512-XfA++W/WlQOSyjUyuF5lgYBfXZUEMP01Oh1C2dSwZAlF2e/ZrMRPfWonXj6BGM+o8Xciv7w0tsRMKYwYEuQvaw==", + "dependencies": { + "uint8-varint": "^2.0.2", + "uint8arraylist": "^2.4.3", + "uint8arrays": "^5.0.1" + } + }, "node_modules/proxy-addr": { "version": "2.0.7", "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz", @@ -4426,6 +5701,22 @@ "node": ">=6" } }, + "node_modules/pvtsutils": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/pvtsutils/-/pvtsutils-1.3.5.tgz", + "integrity": "sha512-ARvb14YB9Nm2Xi6nBq1ZX6dAM0FsJnuk+31aUp4TrcZEdKUlSqOqsxJHUPJDNE3qiIp+iUPEIeR6Je/tgV7zsA==", + "dependencies": { + "tslib": "^2.6.1" + } + }, + "node_modules/pvutils": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/pvutils/-/pvutils-1.1.3.tgz", + "integrity": "sha512-pMpnA0qRdFp32b1sJl1wOJNxZLQ2cbQx+k6tjNtZ8CpvVhNqEPRgivZ2WOUev2YMajecdH7ctUPDvEe87nariQ==", + "engines": { + "node": ">=6.0.0" + } + }, "node_modules/qs": { "version": "6.11.0", "resolved": "https://registry.npmjs.org/qs/-/qs-6.11.0.tgz", @@ -4460,6 +5751,16 @@ } ] }, + "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==" + }, + "node_modules/race-signal": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/race-signal/-/race-signal-1.0.2.tgz", + "integrity": "sha512-o3xNv0iTcIDQCXFlF6fPAMEBRjFxssgGoRqLbg06m+AdzEXXLUmoNOoUHTVz2NoBI8hHwKFKoC6IqyNtWr2bww==" + }, "node_modules/range-parser": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", @@ -4860,6 +6161,11 @@ "node": ">=0.10.0" } }, + "node_modules/sparse-array": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/sparse-array/-/sparse-array-1.3.2.tgz", + "integrity": "sha512-ZT711fePGn3+kQyLuv1fpd3rNSkNF8vd5Kv2D+qnOANeyKs3fx6bUMGWRPvgTTcYV64QMqZKZwcuaQSP3AZ0tg==" + }, "node_modules/spawn-command": { "version": "0.0.2", "resolved": "https://registry.npmjs.org/spawn-command/-/spawn-command-0.0.2.tgz", @@ -4962,6 +6268,22 @@ "graphql": ">=0.10.0" } }, + "node_modules/super-regex": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/super-regex/-/super-regex-0.2.0.tgz", + "integrity": "sha512-WZzIx3rC1CvbMDloLsVw0lkZVKJWbrkJ0k1ghKFmcnPrW1+jWbgTkTEWVtD9lMdmI4jZEz40+naBxl1dCUhXXw==", + "dependencies": { + "clone-regexp": "^3.0.0", + "function-timeout": "^0.1.0", + "time-span": "^5.1.0" + }, + "engines": { + "node": ">=14.16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/supports-color": { "version": "8.1.1", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", @@ -5016,6 +6338,28 @@ "integrity": "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==", "dev": true }, + "node_modules/time-span": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/time-span/-/time-span-5.1.0.tgz", + "integrity": "sha512-75voc/9G4rDIJleOo4jPvN4/YC4GRZrY8yy1uU4lwrB3XEQbWve8zXoO5No4eFrGcTAMYyoY67p8jRQdtA1HbA==", + "dependencies": { + "convert-hrtime": "^5.0.0" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/timestamp-nano": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/timestamp-nano/-/timestamp-nano-1.0.1.tgz", + "integrity": "sha512-4oGOVZWTu5sl89PtCDnhQBSt7/vL1zVEwAfxH1p49JhTosxzVQWYBYFRFZ8nJmo0G6f824iyP/44BFAwIoKvIA==", + "engines": { + "node": ">= 4.5.0" + } + }, "node_modules/tiny-typed-emitter": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/tiny-typed-emitter/-/tiny-typed-emitter-2.1.0.tgz", @@ -5193,6 +6537,31 @@ "resolved": "https://registry.npmjs.org/ufo/-/ufo-1.5.3.tgz", "integrity": "sha512-Y7HYmWaFwPUmkoQCUIAYpKqkOf+SbVj/2fJJZ4RJMCfZp0rTGwRbzQD+HghfnhKOjL9E01okqz+ncJskGYfBNw==" }, + "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==", + "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==", + "dependencies": { + "uint8arrays": "^5.0.1" + } + }, + "node_modules/uint8arrays": { + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/uint8arrays/-/uint8arrays-5.0.3.tgz", + "integrity": "sha512-6LBuKji28kHjgPJMkQ6GDaBb1lRwIhyOYq6pDGwYMoDPfImE9SkuYENVmR0yu9yGgs2clHUSY9fKDukR+AXfqQ==", + "dependencies": { + "multiformats": "^13.0.0" + } + }, "node_modules/undici-types": { "version": "5.26.5", "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", @@ -5240,6 +6609,11 @@ "uuid": "dist/bin/uuid" } }, + "node_modules/varint": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/varint/-/varint-6.0.0.tgz", + "integrity": "sha512-cXEIW6cfr15lFv563k4GuVuW/fiwjknytD37jIOLSdSWuOI6WnO/oKwmP2FQTU2l01LP8/M5TSAJpzUaGe3uWg==" + }, "node_modules/vary": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", diff --git a/package.json b/package.json index 0d283eb..9e4a1c5 100644 --- a/package.json +++ b/package.json @@ -11,6 +11,7 @@ }, "dependencies": { "@graphile-contrib/pg-simplify-inflector": "^6.1.0", + "@helia/verified-fetch": "^1.3.14", "chainsauce": "github:boudra/chainsauce#main", "cors": "^2.8.5", "dotenv": "^16.4.5", diff --git a/src/db/index.ts b/src/db/index.ts index 3c5c697..64f8474 100644 --- a/src/db/index.ts +++ b/src/db/index.ts @@ -10,27 +10,62 @@ import { } from "kysely"; import { schemaName, migrate } from "./migrate.js"; -type Database = { +export type Database = { + profiles: ProfilesTable; pools: PoolsTable; recipients: RecipientsTable; + pendingProfileRoles: PendingProfileRolesTable; + profileRoles: ProfileRolesTable; + pendingPoolRoles: PendingPoolRolesTable; + poolRoles: PoolRolesTable; }; -type PoolsTable = { +export type ProfilesTable = { + id: string; + chainId: number; + name: string; + anchorAddress: string; + metadataCid: string; + metadata: unknown; + createdAtBlock: bigint; + updatedAtBlock: bigint; + tags: string[]; +}; + +export type PendingProfileRolesTable = { + id?: number; + chainId: number; + role: string; + address: string; + createdAtBlock: bigint; +}; + +export type ProfileRolesTable = { + chainId: number; + profileId: string; + address: string; + role: "owner" | "member"; + createdAtBlock: bigint; +}; + +export type PoolsTable = { id: string; chainId: number; token: string; metadataCid: string; + metadata: unknown; createdAtBlock: bigint; updatedAtBlock: bigint; + managerRole: string; + adminRole: string; strategyAddress: string; strategyId: string; strategyName: string; - projectId: string; - managers: string[]; + profileId: string; tags: string[]; }; -type RecipientsTable = { +export type RecipientsTable = { id: string; chainId: number; poolId: string; @@ -44,12 +79,49 @@ type RecipientsTable = { tags: string[]; }; -type Pool = Selectable; -type PoolNew = Insertable; -type PoolUpdate = Updateable; -type Recipient = Selectable; -type RecipientNew = Insertable; -type RecipientUpdate = Updateable; +export type PendingPoolRolesTable = { + id?: number; + chainId: number; + role: string; + address: string; + createdAtBlock: bigint; +}; + +export type PoolRolesTable = { + chainId: number; + poolId: string; + address: string; + role: "admin" | "manager"; + createdAtBlock: bigint; +}; + +export type Profile = Selectable; +export type ProfileNew = Insertable; +export type ProfileUpdate = Updateable; + +export type Pool = Selectable; +export type PoolNew = Insertable; +export type PoolUpdate = Updateable; + +export type Recipient = Selectable; +export type RecipientNew = Insertable; +export type RecipientUpdate = Updateable; + +export type ProfileRole = Selectable; +export type NewProfileRole = Insertable; +export type ProfileRoleUpdate = Updateable; + +export type PendingProfileRole = Selectable; +export type NewPendingProfileRole = Insertable; +export type PendingProfileRoleUpdate = Updateable; + +export type PendingPoolRole = Selectable; +export type NewPendingPoolRole = Insertable; +export type UpdatePendingPoolRole = Updateable; + +export type PoolRole = Selectable; +export type NewPoolRole = Insertable; +export type UpdatePoolRole = Updateable; const pool = new pg.Pool({ connectionString: process.env.DATABASE_URI, @@ -59,12 +131,12 @@ const dialect = new PostgresDialect({ pool, }); -const db = new Kysely({ +export const db = new Kysely({ dialect, plugins: [new CamelCasePlugin()], }).withSchema(schemaName); -async function createSchemaIfNotExists() { +export async function createSchemaIfNotExists() { const exists = await sql<{ exists: boolean }>` SELECT EXISTS ( SELECT 1 FROM information_schema.schemata @@ -85,15 +157,61 @@ async function createSchemaIfNotExists() { }); } -export { - db, - createSchemaIfNotExists, - Database, - PoolsTable, - Pool, - PoolNew, - PoolUpdate, - Recipient, - RecipientNew, - RecipientUpdate, -}; +export async function getProfile(chainId: number, id: string) { + const profile = await db + .selectFrom("profiles") + .where("chainId", "=", chainId) + .where("id", "=", id) + .selectAll() + .executeTakeFirst(); + + return profile ?? null; +} + +export async function getPool(chainId: number, strategyAddress: string) { + const pool = await db + .selectFrom("pools") + .select("id") + .where("chainId", "=", chainId) + .where("strategyAddress", "=", strategyAddress) + .executeTakeFirst(); + + return pool ?? null; +} + +export async function getPoolByRole( + chainId: number, + roleName: "admin" | "manager", + role: string, +) { + const pool = await db + .selectFrom("pools") + .where("chainId", "=", chainId) + .where(`${roleName}Role`, "=", role) + .selectAll() + .executeTakeFirst(); + + return pool ?? null; +} + +export async function getPendingProfileRoles(chainId: number, role: string) { + const pendingProfileRoles = await db + .selectFrom("pendingProfileRoles") + .where("chainId", "=", chainId) + .where("role", "=", role) + .selectAll() + .execute(); + + return pendingProfileRoles ?? null; +} + +export async function getPendingPoolRoles(chainId: number, role: string) { + const pendingPoolRoles = await db + .selectFrom("pendingPoolRoles") + .where("chainId", "=", chainId) + .where("role", "=", role) + .selectAll() + .execute(); + + return pendingPoolRoles ?? null; +} diff --git a/src/db/migrate.ts b/src/db/migrate.ts index df51c8f..66844f2 100644 --- a/src/db/migrate.ts +++ b/src/db/migrate.ts @@ -7,6 +7,55 @@ async function migrate(db: Kysely) { const schema = db.withSchema(schemaName).schema; + await schema + .createTable("profiles") + .addColumn("id", "text") + .addColumn("chainId", "integer") + .addColumn("name", "text") + .addColumn("anchorAddress", "text") + .addColumn("metadataCid", "text") + .addColumn("metadata", "jsonb") + .addColumn("createdAtBlock", "bigint") + .addColumn("updatedAtBlock", "bigint") + .addColumn("tags", sql`text[]`) + .addPrimaryKeyConstraint("profiles_pkey", ["id", "chainId"]) + .execute(); + + await schema + .createTable("pending_profile_roles") + .addColumn("id", "serial", (col) => col.primaryKey()) + .addColumn("chainId", "integer") + .addColumn("role", "text") + .addColumn("address", "text") + .addColumn("createdAtBlock", "bigint") + .execute(); + + await schema + .createType("profile_role_name") + .asEnum(["owner", "member"]) + .execute(); + + await schema + .createTable("profile_roles") + .addColumn("chainId", "integer") + .addColumn("profileId", "text") + .addColumn("address", "text") + .addColumn("role", ref("profile_role_name")) + .addColumn("createdAtBlock", "bigint") + .addPrimaryKeyConstraint("profile_roles_pkey", [ + "chainId", + "profileId", + "address", + "role", + ]) + .addForeignKeyConstraint( + "profile_roles_profiles_fkey", + ["chainId", "profileId"], + "profiles", + ["chainId", "id"], + ) + .execute(); + await schema .createTable("pools") .addColumn("id", "text") @@ -14,14 +63,22 @@ async function migrate(db: Kysely) { .addColumn("token", "text") .addColumn("tags", sql`text[]`) .addColumn("metadataCid", "text") + .addColumn("metadata", "jsonb") + .addColumn("managerRole", "text") + .addColumn("adminRole", "text") .addColumn("createdAtBlock", "bigint") .addColumn("updatedAtBlock", "bigint") .addColumn("strategyAddress", "text") .addColumn("strategyId", "text") .addColumn("strategyName", "text") - .addColumn("projectId", "text") - .addColumn("managers", sql`text[]`) + .addColumn("profileId", "text") .addPrimaryKeyConstraint("pools_pkey", ["id", "chainId"]) + .addForeignKeyConstraint( + "pools_profiles_fkey", + ["chainId", "profileId"], + "profiles", + ["chainId", "id"], + ) .execute(); await schema @@ -51,6 +108,53 @@ async function migrate(db: Kysely) { (cb) => cb.onDelete("cascade"), ) .execute(); + + await schema + .createIndex("idx_pools_manager_role") + .on("pools") + .columns(["managerRole"]) + .execute(); + + await schema + .createIndex("idx_pools_admin_role") + .on("pools") + .columns(["adminRole"]) + .execute(); + + await schema + .createTable("pending_pool_roles") + .addColumn("id", "serial", (col) => col.primaryKey()) + .addColumn("chainId", "integer") + .addColumn("role", "text") + .addColumn("address", "text") + .addColumn("createdAtBlock", "bigint") + .execute(); + + await schema + .createType("pool_role_name") + .asEnum(["admin", "manager"]) + .execute(); + + await schema + .createTable("pool_roles") + .addColumn("chainId", "integer") + .addColumn("poolId", "text") + .addColumn("address", "text") + .addColumn("role", ref("pool_role_name")) + .addColumn("createdAtBlock", "bigint") + .addPrimaryKeyConstraint("pool_roles_pkey", [ + "chainId", + "poolId", + "address", + "role", + ]) + .addForeignKeyConstraint( + "pool_roles_pools_fkey", + ["chainId", "poolId"], + "pools", + ["chainId", "id"], + ) + .execute(); } export { schemaName, migrate }; diff --git a/src/indexer/events/handlePoolCreated.ts b/src/indexer/events/handlePoolCreated.ts new file mode 100644 index 0000000..035c390 --- /dev/null +++ b/src/indexer/events/handlePoolCreated.ts @@ -0,0 +1,137 @@ +import { EventHandlerArgs, Indexer } from "chainsauce"; +import { pad, encodePacked, keccak256 } from "viem"; +import { getPendingPoolRoles } from "../../db/index.js"; +import { IndexerContext } from "../handleEvent.js"; +import { fetchIpfs } from "../ipfs.js"; +import { abis } from "../../lib/abi/index.js"; +import { ALLO_STRATEGY_ID } from "../../lib/constants.js"; + +export async function handlePoolCreated( + args: EventHandlerArgs< + Indexer, + "Allo", + "PoolCreated" + >, +) { + const { + event, + chainId, + readContract, + subscribeToContract, + context: { db }, + } = args; + + const { params } = event; + + const strategyId = await readContract({ + contract: "AlloStrategy", + address: params.strategy, + functionName: "getStrategyId", + }); + + if (strategyId === ALLO_STRATEGY_ID) { + const { + poolId, + token, + profileId, + strategy, + metadata: { pointer: metadataCid }, + } = params; + + subscribeToContract({ + contract: "AlloStrategy", + address: strategy, + }); + + const strategyAddress = strategy.toLowerCase(); + const strategyName = "SQFSuperfluidv1"; + const managerRole = pad(`0x${poolId.toString(16)}`); + const adminRole = keccak256( + encodePacked(["uint256", "string"], [poolId, "admin"]), + ); + const metadata = await fetchIpfs(metadataCid); + + try { + await db + .insertInto("pools") + .values({ + id: poolId.toString(), + chainId, + token: token.toLowerCase(), + metadataCid, + metadata, + managerRole, + adminRole, + createdAtBlock: event.blockNumber, + updatedAtBlock: event.blockNumber, + strategyAddress, + strategyId, + strategyName, + profileId, + tags: ["allo"], + }) + .execute(); + + const pendingAdminRoles = await getPendingPoolRoles(chainId, adminRole); + + if (pendingAdminRoles.length > 0) { + await db + .insertInto("poolRoles") + .values( + pendingAdminRoles.map((pendingAdminRole) => { + return { + chainId, + poolId: poolId.toString(), + address: pendingAdminRole.address, + role: "admin", + createdAtBlock: event.blockNumber, + }; + }), + ) + .execute(); + + await db + .deleteFrom("pendingPoolRoles") + .where( + "id", + "in", + pendingAdminRoles.map((role) => role.id), + ) + .execute(); + } + + const pendingManagerRoles = await getPendingPoolRoles( + chainId, + managerRole, + ); + + if (pendingManagerRoles.length > 0) { + await db + .insertInto("poolRoles") + .values( + pendingManagerRoles.map((pendingManagerRole) => { + return { + chainId, + poolId: poolId.toString(), + address: pendingManagerRole.address, + role: "admin", + createdAtBlock: event.blockNumber, + }; + }), + ) + .execute(); + + await db + .deleteFrom("pendingPoolRoles") + .where( + "id", + "in", + pendingManagerRoles.map((role) => role.id), + ) + .execute(); + } + } catch (err) { + console.warn("DB write error"); + } + } +} diff --git a/src/indexer/events/handleProfileCreated.ts b/src/indexer/events/handleProfileCreated.ts new file mode 100644 index 0000000..40fc5ca --- /dev/null +++ b/src/indexer/events/handleProfileCreated.ts @@ -0,0 +1,89 @@ +import { EventHandlerArgs, Indexer } from "chainsauce"; +import { IndexerContext } from "../handleEvent.js"; +import { fetchIpfs } from "../ipfs.js"; +import { getPendingProfileRoles } from "../../db/index.js"; +import { abis } from "../../lib/abi/index.js"; + +export async function handleProfileCreated( + args: EventHandlerArgs< + Indexer, + "AlloRegistry", + "ProfileCreated" + >, +) { + const { + event, + chainId, + context: { db }, + } = args; + + const { + params: { profileId, name, metadata, owner, anchor }, + } = event; + + const metadataContent = await fetchIpfs(metadata.pointer); + + try { + await db + .insertInto("profiles") + .values({ + id: profileId, + chainId, + name, + anchorAddress: anchor.toLowerCase(), + metadataCid: metadata.pointer, + metadata: metadataContent, + createdAtBlock: event.blockNumber, + updatedAtBlock: event.blockNumber, + tags: [ + "allo", + metadataContent?.type === "program" ? "program" : "project", + ], + }) + .execute(); + + await db + .insertInto("profileRoles") + .values({ + chainId, + profileId, + address: owner.toLowerCase(), + role: "owner", + createdAtBlock: event.blockNumber, + }) + .execute(); + + const pendingProfileRoles = await getPendingProfileRoles( + chainId, + profileId, + ); + + if (pendingProfileRoles.length > 0) { + await db + .insertInto("profileRoles") + .values( + pendingProfileRoles.map((pendingProfileRole) => { + return { + chainId, + profileId, + address: pendingProfileRole.address, + role: "member", + createdAtBlock: event.blockNumber, + }; + }), + ) + .execute(); + + await db + .deleteFrom("pendingProfileRoles") + .where( + "id", + "in", + pendingProfileRoles.map((role) => role.id), + ) + .execute(); + } + } catch (err) { + console.warn("DB write error"); + } +} diff --git a/src/indexer/events/handleProfileMetadataUpdated.ts b/src/indexer/events/handleProfileMetadataUpdated.ts new file mode 100644 index 0000000..5afbfe6 --- /dev/null +++ b/src/indexer/events/handleProfileMetadataUpdated.ts @@ -0,0 +1,36 @@ +import { EventHandlerArgs, Indexer } from "chainsauce"; +import { IndexerContext } from "../handleEvent.js"; +import { fetchIpfs } from "../ipfs.js"; +import { abis } from "../../lib/abi/index.js"; + +export async function handleProfileMetadataUpdated( + args: EventHandlerArgs< + Indexer, + "AlloRegistry", + "ProfileMetadataUpdated" + >, +) { + const { + event, + chainId, + context: { db }, + } = args; + + const { params } = event; + + const metadataCid = params.metadata.pointer; + const metadata = await fetchIpfs(metadataCid); + + try { + db.updateTable("profiles") + .set({ + metadataCid: metadataCid, + metadata: metadata, + }) + .where("chainId", "=", chainId) + .where("id", "=", params.profileId) + .execute(); + } catch (err) { + console.warn("DB write error"); + } +} diff --git a/src/indexer/events/handleProfileNameUpdated.ts b/src/indexer/events/handleProfileNameUpdated.ts new file mode 100644 index 0000000..38828a7 --- /dev/null +++ b/src/indexer/events/handleProfileNameUpdated.ts @@ -0,0 +1,32 @@ +import { EventHandlerArgs, Indexer } from "chainsauce"; +import { IndexerContext } from "../handleEvent.js"; +import { abis } from "../../lib/abi/index.js"; + +export async function handleProfileNameUpdated( + args: EventHandlerArgs< + Indexer, + "AlloRegistry", + "ProfileNameUpdated" + >, +) { + const { + event, + chainId, + context: { db }, + } = args; + + const { params } = event; + + try { + db.updateTable("profiles") + .set({ + name: params.name, + anchorAddress: params.anchor.toLowerCase(), + }) + .where("chainId", "=", chainId) + .where("id", "=", params.profileId) + .execute(); + } catch (err) { + console.warn("DB write error"); + } +} diff --git a/src/indexer/events/handleProfileOwnerUpdated.ts b/src/indexer/events/handleProfileOwnerUpdated.ts new file mode 100644 index 0000000..36d68c2 --- /dev/null +++ b/src/indexer/events/handleProfileOwnerUpdated.ts @@ -0,0 +1,41 @@ +import { EventHandlerArgs, Indexer } from "chainsauce"; +import { IndexerContext } from "../handleEvent.js"; +import { abis } from "../../lib/abi/index.js"; + +export async function handleProfileOwnerUpdated( + args: EventHandlerArgs< + Indexer, + "AlloRegistry", + "ProfileOwnerUpdated" + >, +) { + const { + event, + chainId, + context: { db }, + } = args; + + const { params } = event; + + try { + await db + .deleteFrom("profileRoles") + .where("chainId", "=", chainId) + .where("profileId", "=", params.profileId) + .where("role", "=", "owner") + .execute(); + + await db + .insertInto("profileRoles") + .values({ + chainId, + profileId: params.profileId, + address: params.owner.toLowerCase(), + role: "owner", + createdAtBlock: event.blockNumber, + }) + .execute(); + } catch (err) { + console.warn("DB write error"); + } +} diff --git a/src/indexer/events/handleRegistered.ts b/src/indexer/events/handleRegistered.ts new file mode 100644 index 0000000..e31db3a --- /dev/null +++ b/src/indexer/events/handleRegistered.ts @@ -0,0 +1,61 @@ +import { EventHandlerArgs, Indexer } from "chainsauce"; +import { IndexerContext } from "../handleEvent.js"; +import { getPool } from "../../db/index.js"; +import { decodeRegistrationDataAlloStrategy } from "../decode.js"; +import { abis } from "../../lib/abi/index.js"; + +export async function handleRegistered( + args: EventHandlerArgs< + Indexer, + "AlloStrategy", + "Registered" + >, +) { + const { + event, + chainId, + context: { db }, + } = args; + + const { + params: { data: encodedData }, + address, + } = event; + + const strategyAddress = address.toLowerCase(); + const pool = await getPool(chainId, strategyAddress); + + if (!pool?.id) { + console.warn(`Pool ID was not found for strategy ${strategyAddress}`); + + return; + } + + const { + recipientId, + recipientAddress, + metadata: { pointer: metadataCid }, + } = decodeRegistrationDataAlloStrategy(encodedData); + + try { + await db + .insertInto("recipients") + .values({ + id: recipientId, + chainId, + poolId: pool.id, + strategyAddress, + recipientAddress: recipientAddress.toLowerCase(), + anchorAddress: + recipientId !== recipientAddress ? recipientId.toLowerCase() : null, + status: "PENDING", + metadataCid, + createdAtBlock: event.blockNumber, + updatedAtBlock: event.blockNumber, + tags: ["allo"], + }) + .execute(); + } catch (err) { + console.warn("DB write error"); + } +} diff --git a/src/indexer/events/handleRoleGranted.ts b/src/indexer/events/handleRoleGranted.ts new file mode 100644 index 0000000..c0b0828 --- /dev/null +++ b/src/indexer/events/handleRoleGranted.ts @@ -0,0 +1,110 @@ +import { EventHandlerArgs, Indexer } from "chainsauce"; +import { IndexerContext } from "../handleEvent.js"; +import { Pool, getProfile, getPoolByRole } from "../../db/index.js"; +import { abis } from "../../lib/abi/index.js"; +import { ALLO_OWNER_ROLE } from "../../lib/constants.js"; + +export async function handleRoleGranted( + args: EventHandlerArgs< + Indexer, + "AlloRegistry" | "Allo", + "RoleGranted" + >, +) { + const { + event, + chainId, + context: { db }, + } = args; + + const { params } = event; + + if (event.contractName === "AlloRegistry") { + const role = params.role.toLowerCase(); + + if (role === ALLO_OWNER_ROLE) { + return; + } + + const address = params.account.toLowerCase(); + const profile = await getProfile(chainId, role); + + try { + if (profile !== null) { + await db + .insertInto("profileRoles") + .values({ + chainId, + profileId: profile.id, + address, + role: "member", + createdAtBlock: event.blockNumber, + }) + .execute(); + + return; + } + + await db + .insertInto("pendingProfileRoles") + .values({ + chainId, + role, + address, + createdAtBlock: event.blockNumber, + }) + .execute(); + } catch (err) { + console.warn("DB write error"); + } + } else if (event.contractName === "Allo") { + const role = params.role.toLowerCase(); + const address = params.account.toLowerCase(); + + let pool: Pool | null = null; + + pool = await getPoolByRole(chainId, "admin", role); + + if (pool !== null) { + await db + .insertInto("poolRoles") + .values({ + chainId, + poolId: pool.id, + role: "admin", + address, + createdAtBlock: event.blockNumber, + }) + .execute(); + + return; + } + + pool = await getPoolByRole(chainId, "manager", role); + + if (pool !== null) { + await db + .insertInto("poolRoles") + .values({ + chainId, + poolId: pool.id, + role: "manager", + address, + createdAtBlock: event.blockNumber, + }) + .execute(); + + return; + } + + await db + .insertInto("pendingPoolRoles") + .values({ + chainId, + role: "manager", + address, + createdAtBlock: event.blockNumber, + }) + .execute(); + } +} diff --git a/src/indexer/events/handleRoleRevoked.ts b/src/indexer/events/handleRoleRevoked.ts new file mode 100644 index 0000000..c31bf63 --- /dev/null +++ b/src/indexer/events/handleRoleRevoked.ts @@ -0,0 +1,75 @@ +import { EventHandlerArgs, Indexer } from "chainsauce"; +import { IndexerContext } from "../handleEvent.js"; +import { Pool, getProfile, getPoolByRole } from "../../db/index.js"; +import { abis } from "../../lib/abi/index.js"; + +export async function handleRoleRevoked( + args: EventHandlerArgs< + Indexer, + "AlloRegistry" | "Allo", + "RoleRevoked" + >, +) { + const { + event, + chainId, + context: { db }, + } = args; + + const { params } = event; + + if (event.contractName === "AlloRegistry") { + if (event.contractName === "AlloRegistry") { + const address = params.account.toLowerCase(); + const role = params.role.toLowerCase(); + const profile = await getProfile(chainId, role); + + if (profile === null) { + return; + } + + try { + await db + .deleteFrom("profileRoles") + .where("chainId", "=", chainId) + .where("profileId", "=", profile.id) + .where("role", "=", "member") + .where("address", "=", address) + .execute(); + } catch (err) { + console.warn("DB write error"); + } + } + } else if (event.contractName === "Allo") { + const role = params.role.toLowerCase(); + const address = params.account.toLowerCase(); + + let pool: Pool | null = null; + + pool = await getPoolByRole(chainId, "admin", role); + + if (pool !== null) { + await db + .deleteFrom("poolRoles") + .where("chainId", "=", chainId) + .where("poolId", "=", pool.id) + .where("role", "=", "admin") + .where("address", "=", address) + .execute(); + + return; + } + + pool = await getPoolByRole(chainId, "manager", role); + + if (pool !== null) { + await db + .deleteFrom("poolRoles") + .where("chainId", "=", chainId) + .where("poolId", "=", pool.id) + .where("role", "=", "manager") + .where("address", "=", address) + .execute(); + } + } +} diff --git a/src/indexer/events/handleUpdatedRegistration.ts b/src/indexer/events/handleUpdatedRegistration.ts new file mode 100644 index 0000000..741d43e --- /dev/null +++ b/src/indexer/events/handleUpdatedRegistration.ts @@ -0,0 +1,47 @@ +import { EventHandlerArgs, Indexer } from "chainsauce"; +import { IndexerContext } from "../handleEvent.js"; +import { decodeRegistrationDataAlloStrategy } from "../decode.js"; +import { abis } from "../../lib/abi/index.js"; + +export async function handleUpdatedRegistration( + args: EventHandlerArgs< + Indexer, + "AlloStrategy", + "UpdatedRegistration" + >, +) { + const { + event, + chainId, + context: { db }, + } = args; + + const { + params: { data: encodedData }, + address, + } = event; + + const { + recipientId, + recipientAddress, + metadata: { pointer: metadataCid }, + } = decodeRegistrationDataAlloStrategy(encodedData); + + const strategyAddress = address.toLowerCase(); + + try { + await db + .updateTable("recipients") + .set({ + recipientAddress: recipientAddress.toLowerCase(), + metadataCid, + updatedAtBlock: event.blockNumber, + }) + .where("chainId", "=", chainId) + .where("strategyAddress", "=", strategyAddress) + .where("id", "=", recipientId) + .execute(); + } catch (err) { + console.warn("DB write error"); + } +} diff --git a/src/indexer/events/index.js b/src/indexer/events/index.js new file mode 100644 index 0000000..96b14d0 --- /dev/null +++ b/src/indexer/events/index.js @@ -0,0 +1,9 @@ +export { handleProfileCreated } from "./handleProfileCreated.js"; +export { handlePoolCreated } from "./handlePoolCreated.js"; +export { handleRegistered } from "./handleRegistered.js"; +export { handleUpdatedRegistration } from "./handleUpdatedRegistration.js"; +export { handleProfileMetadataUpdated } from "./handleProfileMetadataUpdated.js"; +export { handleProfileNameUpdated } from "./handleProfileNameUpdated.js"; +export { handleProfileOwnerUpdated } from "./handleProfileOwnerUpdated.js"; +export { handleRoleGranted } from "./handleRoleGranted.js"; +export { handleRoleRevoked } from "./handleRoleRevoked.js"; diff --git a/src/indexer/handleEvent.ts b/src/indexer/handleEvent.ts index f5d8007..ef1b2f6 100644 --- a/src/indexer/handleEvent.ts +++ b/src/indexer/handleEvent.ts @@ -1,174 +1,82 @@ -import { decodeFunctionData, PublicClient } from "viem"; +import { PublicClient } from "viem"; import { EventHandlerArgs } from "chainsauce"; import { Kysely } from "kysely"; import { Indexer } from "chainsauce"; import { Database } from "../db/index.js"; -import { decodeRegistrationDataAlloStrategy } from "./decode.js"; import { abis } from "../lib/abi/index.js"; -import { ALLO_STRATEGY_ID } from "../lib/constants.js"; - -type IndexerContext = { publicClient: PublicClient; db: Kysely }; +import { + handleProfileCreated, + handlePoolCreated, + handleRegistered, + handleUpdatedRegistration, + handleProfileMetadataUpdated, + handleProfileNameUpdated, + handleProfileOwnerUpdated, + handleRoleGranted, + handleRoleRevoked, +} from "./events/index.js"; + +export type IndexerContext = { + publicClient: PublicClient; + db: Kysely; +}; async function handleEvent( args: EventHandlerArgs>, ) { - const { - event, - chainId, - readContract, - subscribeToContract, - context: { publicClient, db }, - } = args; + const { event } = args; switch (event.name) { + case "ProfileCreated": { + await handleProfileCreated({ ...args, event }); + + break; + } + case "PoolCreated": { - const { params, transactionHash } = event; - - const strategyId = await readContract({ - contract: "AlloStrategy", - address: params.strategy, - functionName: "getStrategyId", - }); - - if (strategyId === ALLO_STRATEGY_ID) { - const { - poolId, - token, - profileId, - strategy, - metadata: { pointer: metadataCid }, - } = params; - - subscribeToContract({ - contract: "AlloStrategy", - address: strategy, - }); - - const strategyAddress = strategy.toLowerCase(); - const strategyName = "SQFSuperfluidv1"; - const tx = await publicClient.getTransaction({ - hash: transactionHash, - }); - const { args } = decodeFunctionData({ - abi: abis["Allo"], - data: tx.input, - }); - const managers = args[6]?.map((manager) => manager.toLowerCase()) ?? [ - tx.from, - ]; - - if (managers.indexOf(tx.from) < 0) { - managers.push(tx.from); - } - - try { - await db - .insertInto("pools") - .values({ - id: poolId.toString(), - chainId, - token: token.toLowerCase(), - metadataCid, - createdAtBlock: event.blockNumber, - updatedAtBlock: event.blockNumber, - strategyAddress, - strategyId, - strategyName, - projectId: profileId, - managers, - tags: ["allo"], - }) - .execute(); - } catch (err) { - console.warn("DB write error"); - } - } + await handlePoolCreated({ ...args, event }); break; } case "Registered": { - const { - params: { data: encodedData }, - address, - } = event; - - const strategyAddress = address.toLowerCase(); - const poolId = await db - .selectFrom("pools") - .select("id") - .where("chainId", "=", chainId) - .where("strategyAddress", "=", strategyAddress) - .executeTakeFirst(); - - if (!poolId) { - console.warn(`Pool ID was not found for strategy ${strategyAddress}`); - - return; - } - - const { - recipientId, - recipientAddress, - metadata: { pointer: metadataCid }, - } = decodeRegistrationDataAlloStrategy(encodedData); - - try { - await db - .insertInto("recipients") - .values({ - id: recipientId, - chainId, - poolId: poolId.id, - strategyAddress, - recipientAddress: recipientAddress.toLowerCase(), - anchorAddress: - recipientId !== recipientAddress - ? recipientId.toLowerCase() - : null, - status: "PENDING", - metadataCid, - createdAtBlock: event.blockNumber, - updatedAtBlock: event.blockNumber, - tags: ["allo"], - }) - .execute(); - } catch (err) { - console.warn("DB write error"); - } + await handleRegistered({ ...args, event }); break; } case "UpdatedRegistration": { - const { - params: { data: encodedData }, - address, - } = event; - - const { - recipientId, - recipientAddress, - metadata: { pointer: metadataCid }, - } = decodeRegistrationDataAlloStrategy(encodedData); - - const strategyAddress = address.toLowerCase(); - - try { - await db - .updateTable("recipients") - .set({ - recipientAddress: recipientAddress.toLowerCase(), - metadataCid, - updatedAtBlock: event.blockNumber, - }) - .where("chainId", "=", chainId) - .where("strategyAddress", "=", strategyAddress) - .where("id", "=", recipientId) - .execute(); - } catch (err) { - console.warn("DB write error"); - } + await handleUpdatedRegistration({ ...args, event }); + + break; + } + + case "ProfileMetadataUpdated": { + await handleProfileMetadataUpdated({ ...args, event }); + + break; + } + + case "ProfileNameUpdated": { + await handleProfileNameUpdated({ ...args, event }); + + break; + } + + case "ProfileOwnerUpdated": { + await handleProfileOwnerUpdated({ ...args, event }); + + break; + } + + case "RoleGranted": { + await handleRoleGranted({ ...args, event }); + + break; + } + + case "RoleRevoked": { + await handleRoleRevoked({ ...args, event }); break; } diff --git a/src/indexer/ipfs.ts b/src/indexer/ipfs.ts new file mode 100644 index 0000000..693b925 --- /dev/null +++ b/src/indexer/ipfs.ts @@ -0,0 +1,20 @@ +import { createVerifiedFetch } from "@helia/verified-fetch"; +import { IPFS_GATEWAYS } from "../lib/constants.js"; + +async function fetchIpfs(cid: string) { + const cidRegex = /^(Qm[1-9A-HJ-NP-Za-km-z]{44}|baf[0-9A-Za-z]{50,})$/; + + if (!cidRegex.test(cid)) { + return null; + } + + const verifiedFetch = await createVerifiedFetch({ + gateways: IPFS_GATEWAYS, + }); + + const res = await verifiedFetch(`ipfs://${cid}`); + + return await res.json(); +} + +export { fetchIpfs }; diff --git a/src/lib/abi/alloRegistry.ts b/src/lib/abi/alloRegistry.ts new file mode 100644 index 0000000..4dc3274 --- /dev/null +++ b/src/lib/abi/alloRegistry.ts @@ -0,0 +1,608 @@ +export const alloRegistryAbi = [ + { inputs: [], name: "ALLOCATION_ACTIVE", type: "error" }, + { inputs: [], name: "ALLOCATION_NOT_ACTIVE", type: "error" }, + { inputs: [], name: "ALLOCATION_NOT_ENDED", type: "error" }, + { inputs: [], name: "ALREADY_INITIALIZED", type: "error" }, + { inputs: [], name: "AMOUNT_MISMATCH", type: "error" }, + { inputs: [], name: "ANCHOR_ERROR", type: "error" }, + { inputs: [], name: "ARRAY_MISMATCH", type: "error" }, + { inputs: [], name: "INVALID", type: "error" }, + { inputs: [], name: "INVALID_ADDRESS", type: "error" }, + { inputs: [], name: "INVALID_FEE", type: "error" }, + { inputs: [], name: "INVALID_METADATA", type: "error" }, + { inputs: [], name: "INVALID_REGISTRATION", type: "error" }, + { inputs: [], name: "IS_APPROVED_STRATEGY", type: "error" }, + { inputs: [], name: "MISMATCH", type: "error" }, + { inputs: [], name: "NONCE_NOT_AVAILABLE", type: "error" }, + { inputs: [], name: "NOT_APPROVED_STRATEGY", type: "error" }, + { inputs: [], name: "NOT_ENOUGH_FUNDS", type: "error" }, + { inputs: [], name: "NOT_INITIALIZED", type: "error" }, + { inputs: [], name: "NOT_PENDING_OWNER", type: "error" }, + { inputs: [], name: "POOL_ACTIVE", type: "error" }, + { inputs: [], name: "POOL_INACTIVE", type: "error" }, + { inputs: [], name: "RECIPIENT_ALREADY_ACCEPTED", type: "error" }, + { + inputs: [{ internalType: "address", name: "recipientId", type: "address" }], + name: "RECIPIENT_ERROR", + type: "error", + }, + { inputs: [], name: "RECIPIENT_NOT_ACCEPTED", type: "error" }, + { inputs: [], name: "REGISTRATION_NOT_ACTIVE", type: "error" }, + { inputs: [], name: "UNAUTHORIZED", type: "error" }, + { inputs: [], name: "ZERO_ADDRESS", type: "error" }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "uint8", + name: "version", + type: "uint8", + }, + ], + name: "Initialized", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "bytes32", + name: "profileId", + type: "bytes32", + }, + { + indexed: false, + internalType: "uint256", + name: "nonce", + type: "uint256", + }, + { + indexed: false, + internalType: "string", + name: "name", + type: "string", + }, + { + components: [ + { + internalType: "uint256", + name: "protocol", + type: "uint256", + }, + { internalType: "string", name: "pointer", type: "string" }, + ], + indexed: false, + internalType: "struct Metadata", + name: "metadata", + type: "tuple", + }, + { + indexed: false, + internalType: "address", + name: "owner", + type: "address", + }, + { + indexed: false, + internalType: "address", + name: "anchor", + type: "address", + }, + ], + name: "ProfileCreated", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "bytes32", + name: "profileId", + type: "bytes32", + }, + { + components: [ + { + internalType: "uint256", + name: "protocol", + type: "uint256", + }, + { internalType: "string", name: "pointer", type: "string" }, + ], + indexed: false, + internalType: "struct Metadata", + name: "metadata", + type: "tuple", + }, + ], + name: "ProfileMetadataUpdated", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "bytes32", + name: "profileId", + type: "bytes32", + }, + { + indexed: false, + internalType: "string", + name: "name", + type: "string", + }, + { + indexed: false, + internalType: "address", + name: "anchor", + type: "address", + }, + ], + name: "ProfileNameUpdated", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "bytes32", + name: "profileId", + type: "bytes32", + }, + { + indexed: false, + internalType: "address", + name: "owner", + type: "address", + }, + ], + name: "ProfileOwnerUpdated", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "bytes32", + name: "profileId", + type: "bytes32", + }, + { + indexed: false, + internalType: "address", + name: "pendingOwner", + type: "address", + }, + ], + name: "ProfilePendingOwnerUpdated", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "bytes32", + name: "role", + type: "bytes32", + }, + { + indexed: true, + internalType: "bytes32", + name: "previousAdminRole", + type: "bytes32", + }, + { + indexed: true, + internalType: "bytes32", + name: "newAdminRole", + type: "bytes32", + }, + ], + name: "RoleAdminChanged", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "bytes32", + name: "role", + type: "bytes32", + }, + { + indexed: true, + internalType: "address", + name: "account", + type: "address", + }, + { + indexed: true, + internalType: "address", + name: "sender", + type: "address", + }, + ], + name: "RoleGranted", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "bytes32", + name: "role", + type: "bytes32", + }, + { + indexed: true, + internalType: "address", + name: "account", + type: "address", + }, + { + indexed: true, + internalType: "address", + name: "sender", + type: "address", + }, + ], + name: "RoleRevoked", + type: "event", + }, + { + inputs: [], + name: "ALLO_OWNER", + outputs: [{ internalType: "bytes32", name: "", type: "bytes32" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "DEFAULT_ADMIN_ROLE", + outputs: [{ internalType: "bytes32", name: "", type: "bytes32" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "NATIVE", + outputs: [{ internalType: "address", name: "", type: "address" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "bytes32", name: "_profileId", type: "bytes32" }], + name: "acceptProfileOwnership", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { internalType: "bytes32", name: "_profileId", type: "bytes32" }, + { + internalType: "address[]", + name: "_members", + type: "address[]", + }, + ], + name: "addMembers", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "", type: "address" }], + name: "anchorToProfileId", + outputs: [{ internalType: "bytes32", name: "", type: "bytes32" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "uint256", name: "_nonce", type: "uint256" }, + { internalType: "string", name: "_name", type: "string" }, + { + components: [ + { + internalType: "uint256", + name: "protocol", + type: "uint256", + }, + { internalType: "string", name: "pointer", type: "string" }, + ], + internalType: "struct Metadata", + name: "_metadata", + type: "tuple", + }, + { internalType: "address", name: "_owner", type: "address" }, + { + internalType: "address[]", + name: "_members", + type: "address[]", + }, + ], + name: "createProfile", + outputs: [{ internalType: "bytes32", name: "", type: "bytes32" }], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "_anchor", type: "address" }], + name: "getProfileByAnchor", + outputs: [ + { + components: [ + { internalType: "bytes32", name: "id", type: "bytes32" }, + { internalType: "uint256", name: "nonce", type: "uint256" }, + { internalType: "string", name: "name", type: "string" }, + { + components: [ + { + internalType: "uint256", + name: "protocol", + type: "uint256", + }, + { + internalType: "string", + name: "pointer", + type: "string", + }, + ], + internalType: "struct Metadata", + name: "metadata", + type: "tuple", + }, + { internalType: "address", name: "owner", type: "address" }, + { internalType: "address", name: "anchor", type: "address" }, + ], + internalType: "struct IRegistry.Profile", + name: "", + type: "tuple", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "bytes32", name: "_profileId", type: "bytes32" }], + name: "getProfileById", + outputs: [ + { + components: [ + { internalType: "bytes32", name: "id", type: "bytes32" }, + { internalType: "uint256", name: "nonce", type: "uint256" }, + { internalType: "string", name: "name", type: "string" }, + { + components: [ + { + internalType: "uint256", + name: "protocol", + type: "uint256", + }, + { + internalType: "string", + name: "pointer", + type: "string", + }, + ], + internalType: "struct Metadata", + name: "metadata", + type: "tuple", + }, + { internalType: "address", name: "owner", type: "address" }, + { internalType: "address", name: "anchor", type: "address" }, + ], + internalType: "struct IRegistry.Profile", + name: "", + type: "tuple", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "bytes32", name: "role", type: "bytes32" }], + name: "getRoleAdmin", + outputs: [{ internalType: "bytes32", name: "", type: "bytes32" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "bytes32", name: "role", type: "bytes32" }, + { internalType: "address", name: "account", type: "address" }, + ], + name: "grantRole", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { internalType: "bytes32", name: "role", type: "bytes32" }, + { internalType: "address", name: "account", type: "address" }, + ], + name: "hasRole", + outputs: [{ internalType: "bool", name: "", type: "bool" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "_owner", type: "address" }], + name: "initialize", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { internalType: "bytes32", name: "_profileId", type: "bytes32" }, + { internalType: "address", name: "_member", type: "address" }, + ], + name: "isMemberOfProfile", + outputs: [{ internalType: "bool", name: "", type: "bool" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "bytes32", name: "_profileId", type: "bytes32" }, + { internalType: "address", name: "_owner", type: "address" }, + ], + name: "isOwnerOfProfile", + outputs: [{ internalType: "bool", name: "", type: "bool" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "bytes32", name: "_profileId", type: "bytes32" }, + { internalType: "address", name: "_account", type: "address" }, + ], + name: "isOwnerOrMemberOfProfile", + outputs: [{ internalType: "bool", name: "", type: "bool" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "bytes32", name: "", type: "bytes32" }], + name: "profileIdToPendingOwner", + outputs: [{ internalType: "address", name: "", type: "address" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "bytes32", name: "", type: "bytes32" }], + name: "profilesById", + outputs: [ + { internalType: "bytes32", name: "id", type: "bytes32" }, + { internalType: "uint256", name: "nonce", type: "uint256" }, + { internalType: "string", name: "name", type: "string" }, + { + components: [ + { + internalType: "uint256", + name: "protocol", + type: "uint256", + }, + { internalType: "string", name: "pointer", type: "string" }, + ], + internalType: "struct Metadata", + name: "metadata", + type: "tuple", + }, + { internalType: "address", name: "owner", type: "address" }, + { internalType: "address", name: "anchor", type: "address" }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "_token", type: "address" }, + { internalType: "address", name: "_recipient", type: "address" }, + ], + name: "recoverFunds", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { internalType: "bytes32", name: "_profileId", type: "bytes32" }, + { + internalType: "address[]", + name: "_members", + type: "address[]", + }, + ], + name: "removeMembers", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { internalType: "bytes32", name: "role", type: "bytes32" }, + { internalType: "address", name: "account", type: "address" }, + ], + name: "renounceRole", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { internalType: "bytes32", name: "role", type: "bytes32" }, + { internalType: "address", name: "account", type: "address" }, + ], + name: "revokeRole", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [{ internalType: "bytes4", name: "interfaceId", type: "bytes4" }], + name: "supportsInterface", + outputs: [{ internalType: "bool", name: "", type: "bool" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "bytes32", name: "_profileId", type: "bytes32" }, + { + components: [ + { + internalType: "uint256", + name: "protocol", + type: "uint256", + }, + { internalType: "string", name: "pointer", type: "string" }, + ], + internalType: "struct Metadata", + name: "_metadata", + type: "tuple", + }, + ], + name: "updateProfileMetadata", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { internalType: "bytes32", name: "_profileId", type: "bytes32" }, + { internalType: "string", name: "_name", type: "string" }, + ], + name: "updateProfileName", + outputs: [{ internalType: "address", name: "anchor", type: "address" }], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { internalType: "bytes32", name: "_profileId", type: "bytes32" }, + { + internalType: "address", + name: "_pendingOwner", + type: "address", + }, + ], + name: "updateProfilePendingOwner", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, +] as const; diff --git a/src/lib/abi/index.ts b/src/lib/abi/index.ts index 41825ef..b26ee5e 100644 --- a/src/lib/abi/index.ts +++ b/src/lib/abi/index.ts @@ -1,7 +1,9 @@ +import { alloRegistryAbi } from "./alloRegistry.js"; import { alloAbi } from "./allo.js"; import { alloStrategyAbi } from "./alloStrategy.js"; const abis = { + AlloRegistry: alloRegistryAbi, Allo: alloAbi, AlloStrategy: alloStrategyAbi, } as const; diff --git a/src/lib/constants.ts b/src/lib/constants.ts index e4d4cbb..197ecf9 100644 --- a/src/lib/constants.ts +++ b/src/lib/constants.ts @@ -1,2 +1,12 @@ export const ALLO_STRATEGY_ID = "0xf8a14294e80ff012e54157ec9d1b2827421f1e7f6bde38c06730b1c031b3f935"; +export const ALLO_OWNER_ROLE = + "0x815b5a78dc333d344c7df9da23c04dbd432015cc701876ddb9ffe850e6882747"; +export const IPFS_GATEWAYS = [ + "https://gateway.pinata.cloud", + "https://storry.tv", + "https://cf-ipfs.com", + "https://4everland.io", + "https://ipfs.runfission.com", + "https://trustless-gateway.link", +]; diff --git a/src/networks.ts b/src/networks.ts index 62a7ede..51f8fe6 100644 --- a/src/networks.ts +++ b/src/networks.ts @@ -26,6 +26,11 @@ const networks: Network[] = [ address: "0x1133eA7Af70876e64665ecD07C0A0476d09465a1", fromBlock: 5802180n, }, + { + name: "AlloRegistry", + address: "0x4AAcca72145e1dF2aeC137E1f3C5E3D75DB8b5f3", + fromBlock: 5800180n, + }, ], }, ];