diff --git a/.github/actions/install-dependencies/action.yml b/.github/actions/install-dependencies/action.yml index b3e4c76f..65464e94 100644 --- a/.github/actions/install-dependencies/action.yml +++ b/.github/actions/install-dependencies/action.yml @@ -14,4 +14,4 @@ runs: - name: Install dependencies shell: bash - run: bun install --ignore-scripts + run: bun install --ignore-scripts --frozen-lockfile diff --git a/bun.lockb b/bun.lockb index 9a5ab6ab..ba85647b 100755 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/packages/core/CHANGELOG.md b/packages/core/CHANGELOG.md index 10c752e4..f87d25aa 100644 --- a/packages/core/CHANGELOG.md +++ b/packages/core/CHANGELOG.md @@ -1,5 +1,17 @@ # @zerodev/sdk +## 5.5.10 + +### Patch Changes + +- feat: change custom polling interval to 200 for select chains + +## 5.5.9 + +### Patch Changes + +- feat: custom polling interval for select chains + ## 5.5.8 ### Patch Changes diff --git a/packages/core/clients/kernelAccountClient.ts b/packages/core/clients/kernelAccountClient.ts index 4f742ec9..045bc788 100644 --- a/packages/core/clients/kernelAccountClient.ts +++ b/packages/core/clients/kernelAccountClient.ts @@ -26,6 +26,7 @@ import { } from "viem/account-abstraction" import type { KernelSmartAccountImplementation } from "../accounts/index.js" import { getUserOperationGasPrice } from "../actions/index.js" +import { FAST_POLLING_CHAIN_IDS } from "../constants.js" import { type KernelAccountClientActions, kernelAccountClientActions @@ -142,15 +143,23 @@ export function createKernelAccountClient( userOperation } = parameters + const chain = parameters.chain ?? client_?.chain + const defaultPollingInterval = FAST_POLLING_CHAIN_IDS.includes( + chain?.id as number + ) + ? 200 + : 1000 + const client = Object.assign( createClient({ ...parameters, - chain: parameters.chain ?? client_?.chain, + chain, transport: bundlerTransport, key, name, type: "kernelAccountClient", - pollingInterval: parameters.pollingInterval ?? 1000 + pollingInterval: + parameters.pollingInterval ?? defaultPollingInterval }), { client: client_, paymaster, paymasterContext, userOperation } ) diff --git a/packages/core/constants.ts b/packages/core/constants.ts index e84a560d..ec551bc7 100644 --- a/packages/core/constants.ts +++ b/packages/core/constants.ts @@ -171,3 +171,5 @@ export const getEntryPoint = ( export const KERNEL_7702_DELEGATION_ADDRESS = "0xd6CEDDe84be40893d153Be9d467CD6aD37875b28" + +export const FAST_POLLING_CHAIN_IDS = [1, 10, 56, 137, 8453, 42161, 84532] diff --git a/packages/core/package.json b/packages/core/package.json index ff894d31..6400168d 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -1,6 +1,6 @@ { "name": "@zerodev/sdk", - "version": "5.5.8", + "version": "5.5.10", "author": "ZeroDev", "main": "./_cjs/index.js", "module": "./_esm/index.js",