From 56ae7492235789f42af2b571205a9f434f8abe93 Mon Sep 17 00:00:00 2001 From: Denis Carriere Date: Fri, 17 Nov 2023 22:44:18 -0500 Subject: [PATCH] upgrade to latest substreams-sink --- .github/workflows/bun-build.yml | 23 + .github/workflows/{ci.yml => bun-test.yml} | 8 +- .github/workflows/npm.yml | 19 - .github/workflows/sea.yml | 26 - .gitignore | 3 +- Dockerfile | 12 +- package-lock.json | 713 ++++----------------- package.json | 48 +- rollup.config.mjs | 18 - sea-config.json | 5 - src/postWebhook.ts | 7 +- src/signMessage.bench.ts | 18 +- tsconfig.json | 42 +- 13 files changed, 182 insertions(+), 760 deletions(-) create mode 100644 .github/workflows/bun-build.yml rename .github/workflows/{ci.yml => bun-test.yml} (76%) delete mode 100644 .github/workflows/npm.yml delete mode 100644 .github/workflows/sea.yml delete mode 100644 rollup.config.mjs delete mode 100644 sea-config.json diff --git a/.github/workflows/bun-build.yml b/.github/workflows/bun-build.yml new file mode 100644 index 0000000..7395fdf --- /dev/null +++ b/.github/workflows/bun-build.yml @@ -0,0 +1,23 @@ +name: Generate standalone Bun executable +on: + release: + types: [published] + +permissions: + contents: write + +jobs: + build-and-push-release: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: oven-sh/setup-bun@v1 + with: + bun-version: latest + - run: bun install + - run: bun run test + - run: bun run build + - uses: softprops/action-gh-release@v1 + with: + files: | + substreams-sink-webhook \ No newline at end of file diff --git a/.github/workflows/ci.yml b/.github/workflows/bun-test.yml similarity index 76% rename from .github/workflows/ci.yml rename to .github/workflows/bun-test.yml index d219594..7d5782b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/bun-test.yml @@ -1,7 +1,9 @@ -name: CI +name: Bun Test + on: push + jobs: - build: + build-and-test: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 @@ -9,4 +11,4 @@ jobs: with: bun-version: latest - run: bun install - - run: bun test \ No newline at end of file + - run: bun run test \ No newline at end of file diff --git a/.github/workflows/npm.yml b/.github/workflows/npm.yml deleted file mode 100644 index f766bdd..0000000 --- a/.github/workflows/npm.yml +++ /dev/null @@ -1,19 +0,0 @@ -name: NPM Registry -on: - release: - types: [ published ] - -jobs: - build-and-publish: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 - with: - node-version: '20.x' - cache: 'npm' - registry-url: 'https://registry.npmjs.org' - - run: npm ci - - run: npm publish - env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/.github/workflows/sea.yml b/.github/workflows/sea.yml deleted file mode 100644 index e6fdee9..0000000 --- a/.github/workflows/sea.yml +++ /dev/null @@ -1,26 +0,0 @@ -name: Node Sea Binary Generation -on: - release: - types: [ published ] - -env: - LINUX_BINARY_NAME: ${{ github.event.repository.name }}-linux - -permissions: - contents: write - -jobs: - build-and-publish: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 - with: - node-version: '20.x' - cache: 'npm' - - run: npm ci - - run: npm i - - run: npm run linux - - uses: softprops/action-gh-release@v1 - with: - files: ${{ env.LINUX_BINARY_NAME }} diff --git a/.gitignore b/.gitignore index 98e69d8..d43d9c7 100644 --- a/.gitignore +++ b/.gitignore @@ -10,4 +10,5 @@ cursor.lock docker-compose.yml *-linux *-macos -*-win.exe \ No newline at end of file +*-win.exe +substreams-sink-webhook \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index c5d961d..61be95f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,10 +1,4 @@ -FROM node:alpine - -EXPOSE 9102 - -COPY package*.json ./ -RUN npm ci +FROM oven/bun COPY . . -RUN npm run build - -ENTRYPOINT ["npm", "start"] +RUN bun install +ENTRYPOINT [ "bun", "./bin/cli.ts" ] \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 4ac9f36..27480f3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,40 +1,29 @@ { "name": "substreams-sink-webhook", - "version": "0.5.0", + "version": "0.6.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "substreams-sink-webhook", - "version": "0.5.0", + "version": "0.6.0", "dependencies": { "p-queue": "latest", - "substreams-sink": "^0.11.0", + "substreams-sink": "^0.13.0", "tweetnacl": "latest" }, - "bin": { - "substreams-sink-webhook": "dist/bin/cli.js" - }, "devDependencies": { - "@rollup/plugin-commonjs": "^25.0.3", - "@rollup/plugin-json": "^6.0.0", - "@rollup/plugin-node-resolve": "^15.1.0", - "@tsconfig/recommended": "latest", - "@types/node": "latest", "bun-types": "latest", - "mitata": "^0.1.6", - "rollup": "^3.26.3", + "mitata": "latest", "typescript": "latest" - }, - "engines": { - "node": ">=16" } }, "node_modules/@bufbuild/buf": { - "version": "1.26.1", - "resolved": "https://registry.npmjs.org/@bufbuild/buf/-/buf-1.26.1.tgz", - "integrity": "sha512-NyYx4T//3ndtFYV3BfqX9Xrm1NZEx3eChXniAKc/osCVViFooC5nuLQUbyqglMonH0w39RohiURMXN+e/oEB4g==", + "version": "1.28.1", + "resolved": "https://registry.npmjs.org/@bufbuild/buf/-/buf-1.28.1.tgz", + "integrity": "sha512-WRDagrf0uBjfV9s5eyrSPJDcdI4A5Q7JMCA4aMrHRR8fo/TTjniDBjJprszhaguqsDkn/LS4QIu92HVFZCrl9A==", "hasInstallScript": true, + "peer": true, "bin": { "buf": "bin/buf", "protoc-gen-buf-breaking": "bin/protoc-gen-buf-breaking", @@ -44,18 +33,18 @@ "node": ">=12" }, "optionalDependencies": { - "@bufbuild/buf-darwin-arm64": "1.26.1", - "@bufbuild/buf-darwin-x64": "1.26.1", - "@bufbuild/buf-linux-aarch64": "1.26.1", - "@bufbuild/buf-linux-x64": "1.26.1", - "@bufbuild/buf-win32-arm64": "1.26.1", - "@bufbuild/buf-win32-x64": "1.26.1" + "@bufbuild/buf-darwin-arm64": "1.28.1", + "@bufbuild/buf-darwin-x64": "1.28.1", + "@bufbuild/buf-linux-aarch64": "1.28.1", + "@bufbuild/buf-linux-x64": "1.28.1", + "@bufbuild/buf-win32-arm64": "1.28.1", + "@bufbuild/buf-win32-x64": "1.28.1" } }, "node_modules/@bufbuild/buf-darwin-arm64": { - "version": "1.26.1", - "resolved": "https://registry.npmjs.org/@bufbuild/buf-darwin-arm64/-/buf-darwin-arm64-1.26.1.tgz", - "integrity": "sha512-nmyWiT/59RFja0ZuXFxjNGoAMDPTApU66CZUUevkFVWbNB9nzeQDjx2vsJyACY64k5fTgZiaelSiyppwObQknw==", + "version": "1.28.1", + "resolved": "https://registry.npmjs.org/@bufbuild/buf-darwin-arm64/-/buf-darwin-arm64-1.28.1.tgz", + "integrity": "sha512-nAyvwKkcd8qQTExCZo5MtSRhXLK7e3vzKFKHjXfkveRakSUST2HFlFZAHfErZimN4wBrPTN0V0hNRU8PPjkMpQ==", "cpu": [ "arm64" ], @@ -63,14 +52,15 @@ "os": [ "darwin" ], + "peer": true, "engines": { "node": ">=12" } }, "node_modules/@bufbuild/buf-darwin-x64": { - "version": "1.26.1", - "resolved": "https://registry.npmjs.org/@bufbuild/buf-darwin-x64/-/buf-darwin-x64-1.26.1.tgz", - "integrity": "sha512-jl5WmUv30OW8JiRLid9+mVx1XVH0XttpUfkQfmqDFdUHGfdy4XWYK8kr84YyWu0SiMTIt1mPXkqG5UM3x+tdIQ==", + "version": "1.28.1", + "resolved": "https://registry.npmjs.org/@bufbuild/buf-darwin-x64/-/buf-darwin-x64-1.28.1.tgz", + "integrity": "sha512-b0eT3xd3vX5a5lWAbo5h7FPuf9MsOJI4I39qs4TZnrlZ8BOuPfqzwzijiFf9UCwaX2vR1NQXexIoQ80Ci+fCHw==", "cpu": [ "x64" ], @@ -78,14 +68,15 @@ "os": [ "darwin" ], + "peer": true, "engines": { "node": ">=12" } }, "node_modules/@bufbuild/buf-linux-aarch64": { - "version": "1.26.1", - "resolved": "https://registry.npmjs.org/@bufbuild/buf-linux-aarch64/-/buf-linux-aarch64-1.26.1.tgz", - "integrity": "sha512-EedR2KDW/yDIxQKWuq1Y/g7IuwTgvelqylGVO7muMxt2JWShobyUaU6GIU8JB4yhIbqRQYCL2KqBsvDJbJtCUw==", + "version": "1.28.1", + "resolved": "https://registry.npmjs.org/@bufbuild/buf-linux-aarch64/-/buf-linux-aarch64-1.28.1.tgz", + "integrity": "sha512-p5h9bZCVLMh8No9/7k7ulXzsFx5P7Lu6DiUMjSJ6aBXPMYo6Xl7r/6L2cQkpsZ53HMtIxCgMYS9a7zoS4K8wIw==", "cpu": [ "arm64" ], @@ -93,14 +84,15 @@ "os": [ "linux" ], + "peer": true, "engines": { "node": ">=12" } }, "node_modules/@bufbuild/buf-linux-x64": { - "version": "1.26.1", - "resolved": "https://registry.npmjs.org/@bufbuild/buf-linux-x64/-/buf-linux-x64-1.26.1.tgz", - "integrity": "sha512-5iFL+MmWqR4cBLVNpgsjRecdHgcTxFaIkVYlQV9q8acbaJn5rgOIjUr1tzcBao9YsL3rdBhHvKkgnQ9gi1IiTw==", + "version": "1.28.1", + "resolved": "https://registry.npmjs.org/@bufbuild/buf-linux-x64/-/buf-linux-x64-1.28.1.tgz", + "integrity": "sha512-fVJ3DiRigIso06jgEl+JNp59Y5t2pxDHd10d3SA4r+14sXbZ2J7Gy/wBqVXPry4x/jW567KKlvmhg7M5ZBgCQQ==", "cpu": [ "x64" ], @@ -108,14 +100,15 @@ "os": [ "linux" ], + "peer": true, "engines": { "node": ">=12" } }, "node_modules/@bufbuild/buf-win32-arm64": { - "version": "1.26.1", - "resolved": "https://registry.npmjs.org/@bufbuild/buf-win32-arm64/-/buf-win32-arm64-1.26.1.tgz", - "integrity": "sha512-/ayymSD12gBetN98ErkH0CBGRLTmtYAp4fmbPuvq8zuJcL0eiAnK6d7ZFjTc+vDMuKY/aelQN7dj9WhzdYAQSQ==", + "version": "1.28.1", + "resolved": "https://registry.npmjs.org/@bufbuild/buf-win32-arm64/-/buf-win32-arm64-1.28.1.tgz", + "integrity": "sha512-KJiRJpugQRK/jXC46Xjlb68UydWhCZj2jHdWLIwNtgXd1WTJ3LngChZV7Y6pPK08pwBAVz0JYeVbD5IlTCD4TQ==", "cpu": [ "arm64" ], @@ -123,14 +116,15 @@ "os": [ "win32" ], + "peer": true, "engines": { "node": ">=12" } }, "node_modules/@bufbuild/buf-win32-x64": { - "version": "1.26.1", - "resolved": "https://registry.npmjs.org/@bufbuild/buf-win32-x64/-/buf-win32-x64-1.26.1.tgz", - "integrity": "sha512-k9Dy3Z9P96wYR43lUhUo0jbjMSo001+MRBlsadEYiw85POqx6RWVaGyHLrxC2Ly7g+aGMisey050OjqfCWtKTA==", + "version": "1.28.1", + "resolved": "https://registry.npmjs.org/@bufbuild/buf-win32-x64/-/buf-win32-x64-1.28.1.tgz", + "integrity": "sha512-vMnc+7OVCkmlRWQsgYHgUqiBPRIjD8XeoRyApJ07YZzGs7DkRH4LhvmacJbLd3wORylbn6gLz3pQa8J/M61mzg==", "cpu": [ "x64" ], @@ -138,258 +132,87 @@ "os": [ "win32" ], + "peer": true, "engines": { "node": ">=12" } }, - "node_modules/@bufbuild/connect": { - "version": "0.12.0", - "resolved": "https://registry.npmjs.org/@bufbuild/connect/-/connect-0.12.0.tgz", - "integrity": "sha512-rYn3Akp7teOkvqxguLbf6QKizH37Yeo33lseV+JHDZC19CsAV9wrrZM17Sa+LNEBj/hrYtQF7EIcllgGxhv9aw==", - "peerDependencies": { - "@bufbuild/protobuf": "^1.2.1" - } - }, - "node_modules/@bufbuild/connect-node": { - "version": "0.13.0", - "resolved": "https://registry.npmjs.org/@bufbuild/connect-node/-/connect-node-0.13.0.tgz", - "integrity": "sha512-l9tYVWTD9qdVr3PD8iTLmJZoWQY4bYl4UXIyKqvNuqoaAm3pZZvrQXrz0ptS5NRWTVUKPV9DZp6Wbbch5/u55Q==", - "dependencies": { - "@bufbuild/connect": "0.13.0", - "headers-polyfill": "^3.1.2" - }, - "engines": { - "node": ">=16.0.0" - }, + "node_modules/@bufbuild/protobuf": { + "version": "1.4.2", + "resolved": "https://registry.npmjs.org/@bufbuild/protobuf/-/protobuf-1.4.2.tgz", + "integrity": "sha512-JyEH8Z+OD5Sc2opSg86qMHn1EM1Sa+zj/Tc0ovxdwk56ByVNONJSabuCUbLQp+eKN3rWNfrho0X+3SEqEPXIow==" + }, + "node_modules/@connectrpc/connect": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/@connectrpc/connect/-/connect-1.1.3.tgz", + "integrity": "sha512-AXkbsLQe2Nm7VuoN5nqp05GEb9mPa/f5oFzDqTbHME4i8TghTrlY03uefbhuAq4wjsnfDnmuxHZvn6ndlgXmbg==", "peerDependencies": { - "@bufbuild/protobuf": "^1.2.1" + "@bufbuild/protobuf": "^1.3.3" } }, - "node_modules/@bufbuild/connect-node/node_modules/@bufbuild/connect": { - "version": "0.13.0", - "resolved": "https://registry.npmjs.org/@bufbuild/connect/-/connect-0.13.0.tgz", - "integrity": "sha512-eZSMbVLyUFtXiZNORgCEvv580xKZeYQdMOWj2i/nxOcpXQcrEzTMTA7SZzWv4k4gveWCOSRoWmYDeOhfWXJv0g==", + "node_modules/@connectrpc/connect-web": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/@connectrpc/connect-web/-/connect-web-1.1.3.tgz", + "integrity": "sha512-WfShOZt91duJngqivYF4wJFRbeRa4bF/fPMfDVN0MAYSX3VuaTMn8o9qgKN7tsg2H2ZClyOVQwMkZx6IdcP7Zw==", "peerDependencies": { - "@bufbuild/protobuf": "^1.2.1" - } - }, - "node_modules/@bufbuild/protobuf": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/@bufbuild/protobuf/-/protobuf-1.3.1.tgz", - "integrity": "sha512-BUyJWutgP2S8K/1NphOJokuwDckXS4qI2T1pGZAlkFdZchWae3jm6fCdkcGbLlM1QLOcNFFePd+7Feo4BYGrJQ==" - }, - "node_modules/@effect/data": { - "version": "0.17.6", - "resolved": "https://registry.npmjs.org/@effect/data/-/data-0.17.6.tgz", - "integrity": "sha512-/vwz7Jh05eS0qY8kczR/YyJd18d0C+PMtUkAealh4f6gwvhABLGCnktNJTcq/+UHxY0Cbv18r5uaJ4+7PPC+WQ==" - }, - "node_modules/@effect/io": { - "version": "0.37.1", - "resolved": "https://registry.npmjs.org/@effect/io/-/io-0.37.1.tgz", - "integrity": "sha512-Ez3GfcG+gDDfAiBXtSjJpSrPU5Guiyw69LsYkMtIukFwyNwpHWLhYaVgfVbVjoQasil8KiFSQJSd5DbJL6nqPg==", - "dependencies": { - "@effect/data": "^0.17.0" + "@bufbuild/protobuf": "^1.3.3", + "@connectrpc/connect": "1.1.3" } }, "node_modules/@effect/schema": { - "version": "0.32.0", - "resolved": "https://registry.npmjs.org/@effect/schema/-/schema-0.32.0.tgz", - "integrity": "sha512-4HJK/cFkVPdIjYICy0eRsL7JuuLJ6mE3aJC5rX9OuUIei/qfctFEEX2NaARjtGX7hACBrRcuJCNwiq+54TTjFw==", - "dependencies": { - "@effect/data": "^0.17.1", - "@effect/io": "^0.37.0", - "fast-check": "^3.12.0" - } - }, - "node_modules/@jridgewell/sourcemap-codec": { - "version": "1.4.15", - "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz", - "integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==", - "dev": true - }, - "node_modules/@rollup/plugin-commonjs": { - "version": "25.0.4", - "resolved": "https://registry.npmjs.org/@rollup/plugin-commonjs/-/plugin-commonjs-25.0.4.tgz", - "integrity": "sha512-L92Vz9WUZXDnlQQl3EwbypJR4+DM2EbsO+/KOcEkP4Mc6Ct453EeDB2uH9lgRwj4w5yflgNpq9pHOiY8aoUXBQ==", - "dev": true, - "dependencies": { - "@rollup/pluginutils": "^5.0.1", - "commondir": "^1.0.1", - "estree-walker": "^2.0.2", - "glob": "^8.0.3", - "is-reference": "1.2.1", - "magic-string": "^0.27.0" - }, - "engines": { - "node": ">=14.0.0" - }, + "version": "0.47.7", + "resolved": "https://registry.npmjs.org/@effect/schema/-/schema-0.47.7.tgz", + "integrity": "sha512-rQpzxfGsv2C3HSpwBRYPt7p5eibekWbn+RrYCd6SWtNSF0YPClhZwzBLygQvqDMXHkk3rHuuSOnJvIdqu7o4Hw==", + "peer": true, "peerDependencies": { - "rollup": "^2.68.0||^3.0.0" - }, - "peerDependenciesMeta": { - "rollup": { - "optional": true - } + "effect": "2.0.0-next.54", + "fast-check": "^3.13.2" } }, - "node_modules/@rollup/plugin-json": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/@rollup/plugin-json/-/plugin-json-6.0.0.tgz", - "integrity": "sha512-i/4C5Jrdr1XUarRhVu27EEwjt4GObltD7c+MkCIpO2QIbojw8MUs+CCTqOphQi3Qtg1FLmYt+l+6YeoIf51J7w==", - "dev": true, - "dependencies": { - "@rollup/pluginutils": "^5.0.1" - }, - "engines": { - "node": ">=14.0.0" - }, - "peerDependencies": { - "rollup": "^1.20.0||^2.0.0||^3.0.0" - }, - "peerDependenciesMeta": { - "rollup": { - "optional": true - } - } - }, - "node_modules/@rollup/plugin-node-resolve": { - "version": "15.2.1", - "resolved": "https://registry.npmjs.org/@rollup/plugin-node-resolve/-/plugin-node-resolve-15.2.1.tgz", - "integrity": "sha512-nsbUg588+GDSu8/NS8T4UAshO6xeaOfINNuXeVHcKV02LJtoRaM1SiOacClw4kws1SFiNhdLGxlbMY9ga/zs/w==", - "dev": true, - "dependencies": { - "@rollup/pluginutils": "^5.0.1", - "@types/resolve": "1.20.2", - "deepmerge": "^4.2.2", - "is-builtin-module": "^3.2.1", - "is-module": "^1.0.0", - "resolve": "^1.22.1" - }, - "engines": { - "node": ">=14.0.0" - }, + "node_modules/@substreams/core": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/@substreams/core/-/core-0.7.0.tgz", + "integrity": "sha512-SJ70pbIRWNdp17Ld1QbGJpQ2ohvYUBKiAkOKnODeqLCDmc/xKs66nxJCIzQOvIxqLXVRU3QiBwm6NQB3CKrP0A==", "peerDependencies": { - "rollup": "^2.78.0||^3.0.0" - }, - "peerDependenciesMeta": { - "rollup": { - "optional": true - } + "@bufbuild/protobuf": "^1.4.2", + "@connectrpc/connect": "^1.1.3" } }, - "node_modules/@rollup/pluginutils": { - "version": "5.0.4", - "resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-5.0.4.tgz", - "integrity": "sha512-0KJnIoRI8A+a1dqOYLxH8vBf8bphDmty5QvIm2hqm7oFCFYKCAZWWd2hXgMibaPsNDhI0AtpYfQZJG47pt/k4g==", - "dev": true, + "node_modules/@substreams/manifest": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/@substreams/manifest/-/manifest-0.6.0.tgz", + "integrity": "sha512-yPgcnK3WL6Dvx5vEH/CVkjyl5GG9DaV5vGY3YeyuZ7QwXfceoJANSaaBAZX9227kFz+k4/6ERF77P8RrMA5A1Q==", "dependencies": { - "@types/estree": "^1.0.0", - "estree-walker": "^2.0.2", - "picomatch": "^2.3.1" - }, - "engines": { - "node": ">=14.0.0" + "@substreams/core": "0.7.0" }, "peerDependencies": { - "rollup": "^1.20.0||^2.0.0||^3.0.0" - }, - "peerDependenciesMeta": { - "rollup": { - "optional": true - } - } - }, - "node_modules/@substreams/core": { - "version": "0.1.19", - "resolved": "https://registry.npmjs.org/@substreams/core/-/core-0.1.19.tgz", - "integrity": "sha512-GEEkhJb1XUkBvlRzlA7JOXJnS5XmKO4C6ZPz2djxKkRr98EEWH2C1EGCiK/vBYt2trsOVnq/fYizaqRl6vXW5Q==", - "dependencies": { - "@bufbuild/connect": "^0.12.0", - "@bufbuild/protobuf": "^1.2.1" - } - }, - "node_modules/@substreams/manifest": { - "version": "0.0.9", - "resolved": "https://registry.npmjs.org/@substreams/manifest/-/manifest-0.0.9.tgz", - "integrity": "sha512-U/azNhOZle3S6lUCpnQ+P90V8GvtQWMMH8hEX3/TCPRz/hkOFm1PG0+6t6VYVgXX+yTCPrAVpYiyGUdfkaW9Bw==", - "dependencies": { - "@bufbuild/buf": "^1.25.0", - "@bufbuild/protobuf": "^1.2.1", - "@effect/schema": "^0.32.0", - "@substreams/core": "^0.1.19", - "yaml": "^2.3.1" + "@bufbuild/buf": "^1.28.0", + "@bufbuild/protobuf": "^1.4.2", + "@effect/schema": "^0.47.6", + "effect": "2.0.0-next.54", + "yaml": "^2.3.4" } }, "node_modules/@substreams/node": { - "version": "0.2.2", - "resolved": "https://registry.npmjs.org/@substreams/node/-/node-0.2.2.tgz", - "integrity": "sha512-3NyVXd0KjbrVh1gwQ08rwRQ76Khl9sDE/PlwX2e0asq1KHe9F1EvoQLKVAHe+c+OL1Xyn5dmPoX56CXQwx7MmQ==", + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/@substreams/node/-/node-0.4.1.tgz", + "integrity": "sha512-T+Atg2fXj/3aO7pTr/3vUtkiQySgqDJnM9NLe6N8/UbRwvY3HTLf1i7vYlqbjPrdQMbDUfPIermsoOsn7jiK6A==", "dependencies": { - "@bufbuild/connect": "latest", - "@bufbuild/connect-node": "latest", "@bufbuild/protobuf": "latest", - "@substreams/core": "^0.1.18" + "@connectrpc/connect": "latest", + "@connectrpc/connect-web": "latest", + "@substreams/core": "^0.7.0", + "eventemitter3": "latest" }, "engines": { - "node": ">=16" + "node": ">=18" } }, - "node_modules/@tsconfig/recommended": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/@tsconfig/recommended/-/recommended-1.0.2.tgz", - "integrity": "sha512-dbHBtbWBOjq0/otpopAE02NT2Cm05Qe2JsEKeCf/wjSYbI2hz8nCqnpnOJWHATgjDz4fd3dchs3Wy1gQGjfN6w==", - "dev": true - }, - "node_modules/@types/estree": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.1.tgz", - "integrity": "sha512-LG4opVs2ANWZ1TJoKc937iMmNstM/d0ae1vNbnBvBhqCSezgVUOzcLCqbI5elV8Vy6WKwKjaqR+zO9VKirBBCA==", - "dev": true - }, - "node_modules/@types/node": { - "version": "20.5.7", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.5.7.tgz", - "integrity": "sha512-dP7f3LdZIysZnmvP3ANJYTSwg+wLLl8p7RqniVlV7j+oXSXAbt9h0WIBFmJy5inWZoX9wZN6eXx+YXd9Rh3RBA==", - "dev": true - }, - "node_modules/@types/resolve": { - "version": "1.20.2", - "resolved": "https://registry.npmjs.org/@types/resolve/-/resolve-1.20.2.tgz", - "integrity": "sha512-60BCwRFOZCQhDncwQdxxeOEEkbc5dIMccYLwbxsS4TUNeVECQ/pBJ0j09mrHOl/JJvpRPGwO9SvE4nR2Nb/a4Q==", - "dev": true - }, - "node_modules/balanced-match": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", - "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", - "dev": true - }, "node_modules/bintrees": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/bintrees/-/bintrees-1.0.2.tgz", "integrity": "sha512-VOMgTMwjAaUG580SXn3LacVgjurrbMme7ZZNYGSSV7mmtY6QQRh0Eg3pwIcntQ77DErK1L0NxkbetjcoXzVwKw==" }, - "node_modules/brace-expansion": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", - "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", - "dev": true, - "dependencies": { - "balanced-match": "^1.0.0" - } - }, - "node_modules/builtin-modules": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-3.3.0.tgz", - "integrity": "sha512-zhaCDicdLuWN5UbN5IMnFqNMhNfo919sH85y2/ea+5Yg9TsTkeZxpL+JLbp6cgYFS4sRLp3YV4S6yDuqVWHYOw==", - "dev": true, - "engines": { - "node": ">=6" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/bun-types": { "version": "0.8.1", "resolved": "https://registry.npmjs.org/bun-types/-/bun-types-0.8.1.tgz", @@ -404,29 +227,6 @@ "node": ">=16" } }, - "node_modules/commondir": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz", - "integrity": "sha512-W9pAhw0ja1Edb5GVdIF1mjZw/ASI0AlShXM83UUGe2DVr5TdAPEA1OA8m/g8zWp9x6On7gqufY+FatDbC3MDQg==", - "dev": true - }, - "node_modules/data-uri-to-buffer": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/data-uri-to-buffer/-/data-uri-to-buffer-4.0.1.tgz", - "integrity": "sha512-0R9ikRb668HB7QDxT1vkpuUBtqc53YyAwMwGeUFKRojY/NWKvdZ+9UYtRfGmhqNbRkTSVpMbmyhXipFFv2cb/A==", - "engines": { - "node": ">= 12" - } - }, - "node_modules/deepmerge": { - "version": "4.3.1", - "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.3.1.tgz", - "integrity": "sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/dotenv": { "version": "16.3.1", "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.3.1.tgz", @@ -438,11 +238,11 @@ "url": "https://github.com/motdotla/dotenv?sponsor=1" } }, - "node_modules/estree-walker": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-2.0.2.tgz", - "integrity": "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==", - "dev": true + "node_modules/effect": { + "version": "2.0.0-next.54", + "resolved": "https://registry.npmjs.org/effect/-/effect-2.0.0-next.54.tgz", + "integrity": "sha512-qROhKMxlm6fpa90YRfWSgKeelDfhaDq2igPK+pIKupGehiCnZH4vd2qrY71HVZ10qZgXxh0VXpGyDQxJC+EQqw==", + "peer": true }, "node_modules/eventemitter3": { "version": "5.0.1", @@ -450,9 +250,9 @@ "integrity": "sha512-GWkBvjiSZK87ELrYOSESUYeVIc9mvLLf/nXalMOS5dYrgZq9o5OVkbZAVM06CVxYsCwH9BDZFPlQTlPA1j4ahA==" }, "node_modules/fast-check": { - "version": "3.13.0", - "resolved": "https://registry.npmjs.org/fast-check/-/fast-check-3.13.0.tgz", - "integrity": "sha512-m6+3gZ/yTiCWTuV/1e/UuPPjyyyHdQ5gu0pMd84C6705VTDjAgAE6nqFT5jhgegFllCJ95yOzBpqvJSs2DZAxQ==", + "version": "3.13.2", + "resolved": "https://registry.npmjs.org/fast-check/-/fast-check-3.13.2.tgz", + "integrity": "sha512-ouTiFyeMoqmNg253xqy4NSacr5sHxH6pZpLOaHgaAdgZxFWdtsfxExwolpveoAE9CJdV+WYjqErNGef6SqA5Mg==", "funding": [ { "type": "individual", @@ -463,6 +263,7 @@ "url": "https://opencollective.com/fast-check" } ], + "peer": true, "dependencies": { "pure-rand": "^6.0.0" }, @@ -470,233 +271,12 @@ "node": ">=8.0.0" } }, - "node_modules/fetch-blob": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/fetch-blob/-/fetch-blob-3.2.0.tgz", - "integrity": "sha512-7yAQpD2UMJzLi1Dqv7qFYnPbaPx7ZfFK6PiIxQ4PfkGPyNyl2Ugx+a/umUonmKqjhM4DnfbMvdX6otXq83soQQ==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/jimmywarting" - }, - { - "type": "paypal", - "url": "https://paypal.me/jimmywarting" - } - ], - "dependencies": { - "node-domexception": "^1.0.0", - "web-streams-polyfill": "^3.0.3" - }, - "engines": { - "node": "^12.20 || >= 14.13" - } - }, - "node_modules/formdata-polyfill": { - "version": "4.0.10", - "resolved": "https://registry.npmjs.org/formdata-polyfill/-/formdata-polyfill-4.0.10.tgz", - "integrity": "sha512-buewHzMvYL29jdeQTVILecSaZKnt/RJWjoZCF5OW60Z67/GmSLBkOFM7qh1PI3zFNtJbaZL5eQu1vLfazOwj4g==", - "dependencies": { - "fetch-blob": "^3.1.2" - }, - "engines": { - "node": ">=12.20.0" - } - }, - "node_modules/fs.realpath": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", - "dev": true - }, - "node_modules/fsevents": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", - "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", - "dev": true, - "hasInstallScript": true, - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": "^8.16.0 || ^10.6.0 || >=11.0.0" - } - }, - "node_modules/function-bind": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", - "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", - "dev": true - }, - "node_modules/glob": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/glob/-/glob-8.1.0.tgz", - "integrity": "sha512-r8hpEjiQEYlF2QU0df3dS+nxxSIreXQS1qRhMJM0Q5NDdR386C7jb7Hwwod8Fgiuex+k0GFjgft18yvxm5XoCQ==", - "dev": true, - "dependencies": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^5.0.1", - "once": "^1.3.0" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/has": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", - "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", - "dev": true, - "dependencies": { - "function-bind": "^1.1.1" - }, - "engines": { - "node": ">= 0.4.0" - } - }, - "node_modules/headers-polyfill": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/headers-polyfill/-/headers-polyfill-3.3.0.tgz", - "integrity": "sha512-5e57etwBpNcDc0b6KCVWEh/Ro063OxPvzVimUdM0/tsYM/T7Hfy3kknIGj78SFTOhNd8AZY41U8mOHoO4LzmIQ==" - }, - "node_modules/inflight": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", - "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", - "dev": true, - "dependencies": { - "once": "^1.3.0", - "wrappy": "1" - } - }, - "node_modules/inherits": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", - "dev": true - }, - "node_modules/is-builtin-module": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/is-builtin-module/-/is-builtin-module-3.2.1.tgz", - "integrity": "sha512-BSLE3HnV2syZ0FK0iMA/yUGplUeMmNz4AW5fnTunbCIqZi4vG3WjJT9FHMy5D69xmAYBHXQhJdALdpwVxV501A==", - "dev": true, - "dependencies": { - "builtin-modules": "^3.3.0" - }, - "engines": { - "node": ">=6" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/is-core-module": { - "version": "2.13.0", - "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.13.0.tgz", - "integrity": "sha512-Z7dk6Qo8pOCp3l4tsX2C5ZVas4V+UxwQodwZhLopL91TX8UyyHEXafPcyoeeWuLrwzHcr3igO78wNLwHJHsMCQ==", - "dev": true, - "dependencies": { - "has": "^1.0.3" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-module": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-module/-/is-module-1.0.0.tgz", - "integrity": "sha512-51ypPSPCoTEIN9dy5Oy+h4pShgJmPCygKfyRCISBI+JoWT/2oJvK8QPxmwv7b/p239jXrm9M1mlQbyKJ5A152g==", - "dev": true - }, - "node_modules/is-reference": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/is-reference/-/is-reference-1.2.1.tgz", - "integrity": "sha512-U82MsXXiFIrjCK4otLT+o2NA2Cd2g5MLoOVXUZjIOhLurrRxpEXzI8O0KZHr3IjLvlAH1kTPYSuqer5T9ZVBKQ==", - "dev": true, - "dependencies": { - "@types/estree": "*" - } - }, - "node_modules/magic-string": { - "version": "0.27.0", - "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.27.0.tgz", - "integrity": "sha512-8UnnX2PeRAPZuN12svgR9j7M1uWMovg/CEnIwIG0LFkXSJJe4PdfUGiTGl8V9bsBHFUtfVINcSyYxd7q+kx9fA==", - "dev": true, - "dependencies": { - "@jridgewell/sourcemap-codec": "^1.4.13" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/minimatch": { - "version": "5.1.6", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz", - "integrity": "sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==", - "dev": true, - "dependencies": { - "brace-expansion": "^2.0.1" - }, - "engines": { - "node": ">=10" - } - }, "node_modules/mitata": { "version": "0.1.6", "resolved": "https://registry.npmjs.org/mitata/-/mitata-0.1.6.tgz", "integrity": "sha512-VKQ0r3jriTOU9E2Z+mwbZrUmbg4Li4QyFfi7kfHKl6reZhGzL0AYlu3wE0VPXzIwA5xnFzmEQoBwCcNT8stUkA==", "dev": true }, - "node_modules/node-domexception": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/node-domexception/-/node-domexception-1.0.0.tgz", - "integrity": "sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/jimmywarting" - }, - { - "type": "github", - "url": "https://paypal.me/jimmywarting" - } - ], - "engines": { - "node": ">=10.5.0" - } - }, - "node_modules/node-fetch": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-3.3.2.tgz", - "integrity": "sha512-dRB78srN/l6gqWulah9SrxeYnxeddIG30+GOqK/9OlLVyLg3HPnr6SqOWTWOXKRwC2eGYCkZ59NNuSgvSrpgOA==", - "dependencies": { - "data-uri-to-buffer": "^4.0.0", - "fetch-blob": "^3.1.4", - "formdata-polyfill": "^4.0.10" - }, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/node-fetch" - } - }, - "node_modules/once": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", - "dev": true, - "dependencies": { - "wrappy": "1" - } - }, "node_modules/p-queue": { "version": "7.4.0", "resolved": "https://registry.npmjs.org/p-queue/-/p-queue-7.4.0.tgz", @@ -723,24 +303,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/path-parse": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", - "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", - "dev": true - }, - "node_modules/picomatch": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", - "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", - "dev": true, - "engines": { - "node": ">=8.6" - }, - "funding": { - "url": "https://github.com/sponsors/jonschlinkert" - } - }, "node_modules/prom-client": { "version": "14.2.0", "resolved": "https://registry.npmjs.org/prom-client/-/prom-client-14.2.0.tgz", @@ -753,9 +315,9 @@ } }, "node_modules/pure-rand": { - "version": "6.0.3", - "resolved": "https://registry.npmjs.org/pure-rand/-/pure-rand-6.0.3.tgz", - "integrity": "sha512-KddyFewCsO0j3+np81IQ+SweXLDnDQTs5s67BOnrYmYe/yNmUhttQyGsYzy8yUnoljGAQ9sl38YB4vH8ur7Y+w==", + "version": "6.0.4", + "resolved": "https://registry.npmjs.org/pure-rand/-/pure-rand-6.0.4.tgz", + "integrity": "sha512-LA0Y9kxMYv47GIPJy6MI84fqTd2HmYZI83W/kM/SkKfDlajnZYfmXFTxkbY+xSBPkLJxltMa9hIkmdc29eguMA==", "funding": [ { "type": "individual", @@ -765,66 +327,24 @@ "type": "opencollective", "url": "https://opencollective.com/fast-check" } - ] - }, - "node_modules/resolve": { - "version": "1.22.4", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.4.tgz", - "integrity": "sha512-PXNdCiPqDqeUou+w1C2eTQbNfxKSuMxqTCuvlmmMsk1NWHL5fRrhY6Pl0qEYYc6+QqGClco1Qj8XnjPego4wfg==", - "dev": true, - "dependencies": { - "is-core-module": "^2.13.0", - "path-parse": "^1.0.7", - "supports-preserve-symlinks-flag": "^1.0.0" - }, - "bin": { - "resolve": "bin/resolve" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/rollup": { - "version": "3.28.1", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-3.28.1.tgz", - "integrity": "sha512-R9OMQmIHJm9znrU3m3cpE8uhN0fGdXiawME7aZIpQqvpS/85+Vt1Hq1/yVIcYfOmaQiHjvXkQAoJukvLpau6Yw==", - "dev": true, - "bin": { - "rollup": "dist/bin/rollup" - }, - "engines": { - "node": ">=14.18.0", - "npm": ">=8.0.0" - }, - "optionalDependencies": { - "fsevents": "~2.3.2" - } + ], + "peer": true }, "node_modules/substreams-sink": { - "version": "0.11.0", - "resolved": "https://registry.npmjs.org/substreams-sink/-/substreams-sink-0.11.0.tgz", - "integrity": "sha512-UyANEnvhkyK4jB49TEROO3MhxMbw8RHO4Z1Tb6qpIbNol9ZgIzyaFdEs4VWpziOo/IhhLtbffKErEkvrsNtSDA==", + "version": "0.13.0", + "resolved": "https://registry.npmjs.org/substreams-sink/-/substreams-sink-0.13.0.tgz", + "integrity": "sha512-99uVsnwkcd8WrSVBROsLicruvnMfprQZ37vKQRw300iG+deUJt2PRsbFBtMd4qNpuVXFnALJsqLkymPGW1OTOw==", "dependencies": { - "@substreams/core": "^0.1.19", - "@substreams/manifest": "^0.0.9", - "@substreams/node": "^0.2.2", + "@substreams/core": "^0.7.0", + "@substreams/manifest": "^0.6.0", + "@substreams/node": "^0.4.1", "commander": "latest", "dotenv": "latest", - "node-fetch": "latest", "prom-client": "latest", "tslog": "latest" - } - }, - "node_modules/supports-preserve-symlinks-flag": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", - "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", - "dev": true, - "engines": { - "node": ">= 0.4" }, - "funding": { - "url": "https://github.com/sponsors/ljharb" + "engines": { + "node": ">=18" } }, "node_modules/tdigest": { @@ -864,24 +384,11 @@ "node": ">=14.17" } }, - "node_modules/web-streams-polyfill": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/web-streams-polyfill/-/web-streams-polyfill-3.2.1.tgz", - "integrity": "sha512-e0MO3wdXWKrLbL0DgGnUV7WHVuw9OUvL4hjgnPkIeEvESk74gAITi5G606JtZPp39cd8HA9VQzCIvA49LpPN5Q==", - "engines": { - "node": ">= 8" - } - }, - "node_modules/wrappy": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", - "dev": true - }, "node_modules/yaml": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.3.2.tgz", - "integrity": "sha512-N/lyzTPaJasoDmfV7YTrYCI0G/3ivm/9wdG0aHuheKowWQwGTsK0Eoiw6utmzAnI6pkJa0DUVygvp3spqqEKXg==", + "version": "2.3.4", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.3.4.tgz", + "integrity": "sha512-8aAvwVUSHpfEqTQ4w/KMlf3HcRdt50E5ODIQJBw1fQ5RL34xabzxtUlzTXVqc4rkZsPbvrXKWnABCD7kWSmocA==", + "peer": true, "engines": { "node": ">= 14" } diff --git a/package.json b/package.json index ff38222..fbed233 100644 --- a/package.json +++ b/package.json @@ -1,60 +1,30 @@ { + "private": true, + "version": "0.6.0", "name": "substreams-sink-webhook", "description": "Substreams Sink Webhook", - "version": "0.5.0", "type": "module", - "exports": "./dist/index.js", - "types": "./dist/index.d.ts", - "bin": { - "substreams-sink-webhook": "dist/bin/cli.js" - }, - "files": [ - "dist", - "src" - ], - "sideEffects": false, - "engines": { - "node": ">=16" - }, - "repository": "git@github.com:pinax-network/substreams-sink-webhook.git", - "keywords": [ - "substreams", - "streamingfast", - "firehose", - "thegraph", - "pinax" - ], "author": { "name": "Denis", "email": "denis@pinax.network" }, "scripts": { - "build": "tsc", + "start": "bun bin/cli.ts run", + "dev": "bun --watch bin/cli.ts run", + "pretest": "bunx tsc --noEmit", + "server": "bun ./examples/node/http.ts 3000", "test": "bun test", "bench": "bun ./src/*.bench.ts", - "server": "bun ./examples/node/http.ts 3000", - "start": "tsc && node --no-warnings ./dist/bin/cli.js run", - "keypair": "tsc && node --no-warnings ./dist/bin/cli.js keypair", - "ping": "tsc && node --no-warnings ./dist/bin/cli.js ping", - "rollup": "rollup --config rollup.config.mjs", - "linux": "npm run build && npm run rollup && ./scripts/build.linux.sh", - "macos": "npm run build && npm run rollup && ./scripts/build.macos.sh", - "windows": "npm run build && npm run rollup && ./scripts/build.windows.sh" + "build": "bun build --compile ./index.ts --outfile substreams-sink-webhook" }, "dependencies": { "p-queue": "latest", - "substreams-sink": "^0.11.0", + "substreams-sink": "^0.13.0", "tweetnacl": "latest" }, "devDependencies": { - "@rollup/plugin-commonjs": "^25.0.3", - "@rollup/plugin-json": "^6.0.0", - "@rollup/plugin-node-resolve": "^15.1.0", - "@tsconfig/recommended": "latest", - "@types/node": "latest", "bun-types": "latest", - "mitata": "^0.1.6", - "rollup": "^3.26.3", + "mitata": "latest", "typescript": "latest" } } diff --git a/rollup.config.mjs b/rollup.config.mjs deleted file mode 100644 index 6565117..0000000 --- a/rollup.config.mjs +++ /dev/null @@ -1,18 +0,0 @@ -import { nodeResolve } from "@rollup/plugin-node-resolve"; -import json from "@rollup/plugin-json"; -import commonjs from "@rollup/plugin-commonjs"; - -/** @type {import('rollup').RollupOptions} */ -export default { - input: "dist/bin/cli.js", - output: { - file: "dist/bundle.js", - format: "cjs", - inlineDynamicImports: true - }, - plugins: [ - nodeResolve({ extensions: [".ts"] }), - json(), - commonjs() - ], -}; diff --git a/sea-config.json b/sea-config.json deleted file mode 100644 index d5ddfa0..0000000 --- a/sea-config.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "main": "./dist/bundle.js", - "output": "./dist/sea.blob", - "disableExperimentalSEAWarning": true -} \ No newline at end of file diff --git a/src/postWebhook.ts b/src/postWebhook.ts index 800ae5d..9a17e89 100644 --- a/src/postWebhook.ts +++ b/src/postWebhook.ts @@ -1,6 +1,9 @@ -import { setTimeout } from "node:timers/promises"; import { logger } from "substreams-sink"; +function awaitSetTimeout(ms: number) { + return new Promise(resolve => setTimeout(resolve, ms)); +} + interface PostWebhookOptions { maximumAttempts?: number; } @@ -26,7 +29,7 @@ export async function postWebhook(url: string, body: string, signature: string, let milliseconds = initialInterval * Math.pow(backoffCoefficient, attempts); if ( milliseconds > maximumInterval ) milliseconds = maximumInterval; logger.warn(`delay ${milliseconds}`, {attempts, url}); - await setTimeout(milliseconds); + await awaitSetTimeout(milliseconds); } try { const response = await fetch(url, { diff --git a/src/signMessage.bench.ts b/src/signMessage.bench.ts index 1a9c2cf..8bca423 100644 --- a/src/signMessage.bench.ts +++ b/src/signMessage.bench.ts @@ -1,4 +1,4 @@ -import { run, bench, group, baseline } from 'mitata'; +import { run, bench, group } from 'mitata'; import { signMessage, verify } from './signMessage.js'; const secretKey = "3faae992336ea6599fbee55bb2605f1a1297c7288b860725cdfc8794413559dba3cb7366ee8ca77225b4d41772e270e4e831d171d1de71d91707c42e7ba82cc9"; @@ -8,21 +8,9 @@ const timestamp = 1686802918 const sig = "d7b6b6b76ffb3ad58337d3082bcbeef39de1c2c4cd19f9d24955974358bb85e4bbdde31d055f60b1035750b4ca07e4e4c1398924106352577509b077ddd85802" const msg = Buffer.from(timestamp + body); -group('sign', () => { - baseline('baseline', () => {}); +group('signMessage', () => { bench('signMessage', () => signMessage(timestamp, body, secretKey)); -}); - -group('verify', () => { - baseline('baseline', () => {}); bench('verify', () => verify(msg, sig, publicKey)); }); -await run({ - avg: true, // enable/disable avg column (default: true) - json: false, // enable/disable json output (default: false) - colors: true, // enable/disable colors (default: true) - min_max: true, // enable/disable min/max column (default: true) - collect: false, // enable/disable collecting returned values into an array during the benchmark (default: false) - percentiles: false, // enable/disable percentiles column (default: true) -}); \ No newline at end of file +await run(); \ No newline at end of file diff --git a/tsconfig.json b/tsconfig.json index cbf18f5..3b24b14 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,21 +1,23 @@ { - "extends": "@tsconfig/recommended/tsconfig.json", - "compilerOptions": { - "target": "ESNext", - "outDir": "dist", - "module": "NodeNext", - "moduleResolution": "NodeNext", - "resolveJsonModule": true, - "declaration": true, - "declarationMap": true, - "sourceMap": true, - "verbatimModuleSyntax": true, - "types": ["bun-types"] - }, - "include": [ - "index.ts", - "bin/cli.ts", - "src/**/*", - "externals/**/*" - ] - } \ No newline at end of file + "compilerOptions": { + "target": "ESNext", + "module": "NodeNext", + "moduleResolution": "NodeNext", + "resolveJsonModule": true, + "declaration": true, + "declarationMap": true, + "sourceMap": true, + "outDir": "./dist/", + "strict": true, + "noImplicitAny": true, + "strictNullChecks": true, + "alwaysStrict": true, + "skipLibCheck": true, + "types": ["bun-types"] + }, + "include": [ + "index.ts", + "bin/cli.ts", + "src/**/*" + ] +} \ No newline at end of file