From abd60d4470df1ccf0248368245fed40b1ec907f4 Mon Sep 17 00:00:00 2001 From: Filip Date: Mon, 25 May 2026 23:40:21 +0200 Subject: [PATCH] feat: support MEE v2.2.2 (bump @biconomy/abstractjs to ^1.2.4) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit MEE v2.2.2 ships the audited ERC-8211 reference implementation, a new Nexus 1.3.2 implementation, and updated deterministic deployment addresses. mee-node picks up support by bumping @biconomy/abstractjs from ^1.0.13 to ^1.2.4, which exposes MEEVersion.V2_2_2 and its config map (DEFAULT_CONFIGURATIONS_BY_MEE_VERSION). mee-node consumes zero runtime APIs from abstractjs — the only use was a deep type import for GrantPermissionResponse from @biconomy/abstractjs/dist/_types/modules/validators/smartSessions/decorators/grantPermission. The Smart Sessions revamp in abstractjs 1.2.0 changed that type from a single object to GrantPermissionResponseEntry[] (an array), which breaks structural compatibility with mee-node's local zod-inferred GrantPermissionResponseType. Swap the deep abstractjs type import in gas-estimator-v2.service.ts for the local GrantPermissionResponseType from @/sessions. The local type is derived from mee-node's own zod schema for the same concept and matches the runtime shape the gas estimator actually receives. Side benefit: mee-node no longer depends on abstractjs's evolving internal type tree. No new functionality, no schema changes, no decoder changes — the v2.2.2 enum entry was already added to meeVersionSchema in d357670. The Nexus 1.3.1 → 1.3.2 change is ABI-equivalent (only accountId and _domainNameAndVersion string constants change), so no new nexus-132.ts ABI file is required. --- bun.lock | 16 ++++++++++++++-- package.json | 2 +- .../gas-estimator/gas-estimator-v2.service.ts | 4 ++-- 3 files changed, 17 insertions(+), 5 deletions(-) diff --git a/bun.lock b/bun.lock index 04208c9a..e7329dc1 100644 --- a/bun.lock +++ b/bun.lock @@ -35,7 +35,7 @@ "zod-openapi": "4.2.4", }, "devDependencies": { - "@biconomy/abstractjs": "^1.0.13", + "@biconomy/abstractjs": "^1.2.4", "@biomejs/biome": "1.9.4", "@types/cors": "^2.8.17", "@types/express": "5.0.1", @@ -65,7 +65,7 @@ "@babel/runtime": ["@babel/runtime@7.27.6", "", {}, "sha512-vbavdySgbTTrmFE+EsiqUTzlOr5bzlnJtUv9PynGCAKvfQqjIXbvFdumPM/GxMDfyuGMJaJAU6TO4zc1Jf1i8Q=="], - "@biconomy/abstractjs": ["@biconomy/abstractjs@1.0.13", "", { "peerDependencies": { "@rhinestone/module-sdk": "0.2.7", "typescript": "^5.8.2", "viem": "^2.26.2" } }, "sha512-fqIhBFfVC+mKL5RH1kVLk08JwYWWFkPVuvrBmUiTTeHpGm6omeGJsYBR61W9XD7nmjsell1bnbCRla2+VAdRbg=="], + "@biconomy/abstractjs": ["@biconomy/abstractjs@1.2.4", "", { "peerDependencies": { "@metamask/delegation-toolkit": "^0.11.0", "@noble/curves": "2.0.1", "@openzeppelin/merkle-tree": "1.0.8", "@rhinestone/module-sdk": "0.4.0", "@safe-global/types-kit": "3.0.0", "typescript": "^5.8.2", "viem": "^2.26.2" } }, "sha512-7EM3ULl9G6sZbLEHo+9eOCt05s8HS/DbuXa4O5Rfv8YHq7n2ot11WY+vTd4d64xMhwKMbOcCuRLELLuIFf56tg=="], "@bigmi/core": ["@bigmi/core@0.3.1", "", { "dependencies": { "@noble/hashes": "^1.8.0", "bech32": "^2.0.0", "bitcoinjs-lib": "^7.0.0-rc.0", "bs58": "^6.0.0", "eventemitter3": "^5.0.1", "zustand": "^5.0.5" } }, "sha512-KU2KZJmyHPtw7m9sTfOWZ2gQaE8iONpLajmh4gCZfscZIRiL1LddqWkLuFIoFNfY0jbJmvqX46leLUw5YIOVDw=="], @@ -177,6 +177,14 @@ "@metamask/abi-utils": ["@metamask/abi-utils@2.0.4", "", { "dependencies": { "@metamask/superstruct": "^3.1.0", "@metamask/utils": "^9.0.0" } }, "sha512-StnIgUB75x7a7AgUhiaUZDpCsqGp7VkNnZh2XivXkJ6mPkE83U8ARGQj5MbRis7VJY8BC5V1AbB1fjdh0hupPQ=="], + "@metamask/delegation-abis": ["@metamask/delegation-abis@0.11.0", "", {}, "sha512-tnNGFDLQ5jfgPhHJaT5JwvF759nja1iGAG00REbk1Ufir+TxjxTmF8L9MbJifZmUh4fnyqV4Ik6NAOYVNBPVBg=="], + + "@metamask/delegation-deployments": ["@metamask/delegation-deployments@0.11.0", "", {}, "sha512-RfeMr1Ct0givG7oOy1unwdb5lGttq9pape4OGz2mk8quG0KDqDi7cw3fzYc7wz9xFDZ2YrFanYRacaLTlqWS8g=="], + + "@metamask/delegation-toolkit": ["@metamask/delegation-toolkit@0.11.0", "", { "dependencies": { "@metamask/delegation-utils": "^0.11.0", "webauthn-p256": "^0.0.5" }, "peerDependencies": { "viem": ">=2.18.2 <3.0.0" } }, "sha512-KQybftUahuPPjN842ejmVaJWg2rzHpSpvd+b6qtiOBypzJs7cgw1/f8QalHLugS1eyicEYLXwvRxjjufiG4wbg=="], + + "@metamask/delegation-utils": ["@metamask/delegation-utils@0.11.0", "", { "dependencies": { "@metamask/delegation-abis": "^0.11.0", "@metamask/delegation-deployments": "^0.11.0", "buffer": "^6.0.3" }, "peerDependencies": { "viem": ">=2.18.2 <3.0.0" } }, "sha512-eg8icyDtbzwER/G3VvaiVUNiNr9GXxJXQMcFRbhm9tTMqWXpphYXk9edSungRF+QqYmXIytRiR2ChSHp0uNtew=="], + "@metamask/superstruct": ["@metamask/superstruct@3.2.1", "", {}, "sha512-fLgJnDOXFmuVlB38rUN5SmU7hAFQcCjrg3Vrxz67KTY7YHFnSNEKvX4avmEBdOI0yTCxZjwMCFEqsC8k2+Wd3g=="], "@metamask/utils": ["@metamask/utils@9.3.0", "", { "dependencies": { "@ethereumjs/tx": "^4.2.0", "@metamask/superstruct": "^3.1.0", "@noble/hashes": "^1.3.1", "@scure/base": "^1.1.3", "@types/debug": "^4.1.7", "debug": "^4.3.4", "pony-cause": "^2.1.10", "semver": "^7.5.4", "uuid": "^9.0.1" } }, "sha512-w8CVbdkDrVXFJbfBSlDfafDR6BAkpDmv1bC1UJVCoVny5tW2RKAdn9i68Xf7asYT4TnUhl/hN4zfUiKQq9II4g=="], @@ -431,6 +439,8 @@ "@rollup/rollup-win32-x64-msvc": ["@rollup/rollup-win32-x64-msvc@4.40.0", "", { "os": "win32", "cpu": "x64" }, "sha512-lpPE1cLfP5oPzVjKMx10pgBmKELQnFJXHgvtHCtuJWOv8MxqdEIMNtgHgBFf7Ea2/7EuVwa9fodWUfXAlXZLZQ=="], + "@safe-global/types-kit": ["@safe-global/types-kit@3.0.0", "", { "dependencies": { "abitype": "^1.0.2" } }, "sha512-AZWIlR5MguDPdGiOj7BB4JQPY2afqmWQww1mu8m8Oi16HHBW99G01kFOu4NEHBwEU1cgwWOMY19hsI5KyL4W2w=="], + "@scure/base": ["@scure/base@1.2.6", "", {}, "sha512-g/nm5FgUa//MCj1gV09zTJTaM6KBAHqLN907YVQqf7zC49+DcO4B1so4ZX07Ef10Twr6nuqYEH9GEggFXA4Fmg=="], "@scure/bip32": ["@scure/bip32@1.7.0", "", { "dependencies": { "@noble/curves": "~1.9.0", "@noble/hashes": "~1.8.0", "@scure/base": "~1.2.5" } }, "sha512-E4FFX/N3f4B80AKWp5dP6ow+flD1LQZo/w8UnLGYZO674jS6YnYeepycOOksv+vLPSpgN35wgKgy+ybfTb2SMw=="], @@ -1207,6 +1217,8 @@ "vitest": ["vitest@3.2.0-beta.1", "", { "dependencies": { "@vitest/expect": "3.2.0-beta.1", "@vitest/mocker": "3.2.0-beta.1", "@vitest/pretty-format": "^3.2.0-beta.1", "@vitest/runner": "3.2.0-beta.1", "@vitest/snapshot": "3.2.0-beta.1", "@vitest/spy": "3.2.0-beta.1", "@vitest/utils": "3.2.0-beta.1", "chai": "^5.2.0", "debug": "^4.4.0", "expect-type": "^1.2.1", "magic-string": "^0.30.17", "pathe": "^2.0.3", "std-env": "^3.9.0", "tinybench": "^2.9.0", "tinyexec": "^0.3.2", "tinyglobby": "^0.2.13", "tinypool": "^1.0.2", "tinyrainbow": "^2.0.0", "vite": "^5.0.0 || ^6.0.0", "vite-node": "3.2.0-beta.1", "why-is-node-running": "^2.3.0" }, "peerDependencies": { "@edge-runtime/vm": "*", "@types/debug": "^4.1.12", "@types/node": "^18.0.0 || ^20.0.0 || >=22.0.0", "@vitest/browser": "3.2.0-beta.1", "@vitest/ui": "3.2.0-beta.1", "happy-dom": "*", "jsdom": "*" }, "optionalPeers": ["@edge-runtime/vm", "@types/debug", "@types/node", "@vitest/browser", "@vitest/ui", "happy-dom", "jsdom"], "bin": { "vitest": "vitest.mjs" } }, "sha512-OODsyAWMAflJw8/t9YfqZgFHUE3lvdFEqCyvIByOPpP2zWCVPRVGqRaMCYwtLvYc6PqYANDB4s5gjgBOWJNApg=="], + "webauthn-p256": ["webauthn-p256@0.0.5", "", { "dependencies": { "@noble/curves": "^1.4.0", "@noble/hashes": "^1.4.0" } }, "sha512-drMGNWKdaixZNobeORVIqq7k5DsRC9FnG201K2QjeOoQLmtSDaSsVZdkg6n5jUALJKcAG++zBPJXmv6hy0nWFg=="], + "webidl-conversions": ["webidl-conversions@3.0.1", "", {}, "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ=="], "whatwg-url": ["whatwg-url@5.0.0", "", { "dependencies": { "tr46": "~0.0.3", "webidl-conversions": "^3.0.0" } }, "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw=="], diff --git a/package.json b/package.json index 560ba849..09991ad6 100644 --- a/package.json +++ b/package.json @@ -51,7 +51,7 @@ "zod-openapi": "4.2.4" }, "devDependencies": { - "@biconomy/abstractjs": "^1.0.13", + "@biconomy/abstractjs": "^1.2.4", "@biomejs/biome": "1.9.4", "@types/cors": "^2.8.17", "@types/express": "5.0.1", diff --git a/src/modules/gas-estimator/gas-estimator-v2.service.ts b/src/modules/gas-estimator/gas-estimator-v2.service.ts index 1b68571f..1db342f8 100644 --- a/src/modules/gas-estimator/gas-estimator-v2.service.ts +++ b/src/modules/gas-estimator/gas-estimator-v2.service.ts @@ -7,7 +7,7 @@ import { GasManagerService } from "@/gas-manager"; import { NodeService } from "@/node"; import type { QuoteType } from "@/quotes"; import { RpcManagerService } from "@/rpc-manager"; -import { type GrantPermissionResponse } from "@biconomy/abstractjs/dist/_types/modules/validators/smartSessions/decorators/grantPermission"; +import { type GrantPermissionResponseType } from "@/sessions"; import { Inject, Service } from "typedi"; import type { Address, Hex } from "viem"; import { publicActionsL2 } from "viem/op-stack"; @@ -403,7 +403,7 @@ export class GasEstimatorServiceV2 { // Gas estimation algorithm to calculate the vgl for Smart sessions use mode getSmartSessionUseModeVerificationGasLimit( userOpCalldata: Hex, - sessionDetails: GrantPermissionResponse, + sessionDetails: GrantPermissionResponseType, ) { try { // This fixed gas limit will be always there no matter different execution mode or number of actions or number of action policies