Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions packages/core/clients/kernelAccountClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
)
? 250
: 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 }
)
Expand Down
2 changes: 2 additions & 0 deletions packages/core/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -171,3 +171,5 @@ export const getEntryPoint = <TEntryPointVersion extends EntryPointVersion>(

export const KERNEL_7702_DELEGATION_ADDRESS =
"0xd6CEDDe84be40893d153Be9d467CD6aD37875b28"

export const FAST_POLLING_CHAIN_IDS = [1, 10, 56, 137, 8453, 42161, 84532]
Loading