Skip to content

Commit 8639300

Browse files
committed
feat: add polling interval to config
1 parent 64b6b03 commit 8639300

File tree

4 files changed

+183
-169
lines changed

4 files changed

+183
-169
lines changed

package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,18 +20,18 @@
2020
"pino-pretty": "^13.1.1"
2121
},
2222
"devDependencies": {
23-
"@aws-sdk/client-s3": "^3.863.0",
23+
"@aws-sdk/client-s3": "^3.864.0",
2424
"@biomejs/biome": "^2.1.4",
2525
"@commander-js/extra-typings": "^14.0.0",
2626
"@commitlint/cli": "^19.8.1",
2727
"@commitlint/config-conventional": "^19.8.1",
2828
"@gearbox-protocol/biome-config": "^1.0.0",
29-
"@gearbox-protocol/cli-utils": "^5.42.1",
29+
"@gearbox-protocol/cli-utils": "^5.44.0",
3030
"@gearbox-protocol/liquidator-contracts": "^1.36.0-experimental.41",
3131
"@gearbox-protocol/liquidator-v2-contracts": "^2.4.0",
3232
"@gearbox-protocol/sdk": "8.19.0",
3333
"@gearbox-protocol/types": "^1.14.8",
34-
"@types/node": "^24.2.0",
34+
"@types/node": "^24.2.1",
3535
"@uniswap/sdk-core": "^7.7.2",
3636
"@uniswap/v3-sdk": "^3.25.2",
3737
"@vlad-yakovlev/telegram-md": "^2.1.0",
@@ -42,15 +42,15 @@
4242
"di-at-home": "^0.0.7",
4343
"esbuild": "^0.25.8",
4444
"husky": "^9.1.7",
45-
"lint-staged": "^16.1.4",
45+
"lint-staged": "^16.1.5",
4646
"nanoid": "^5.1.5",
4747
"node-pty": "^1.0.0",
4848
"pino": "^9.8.0",
4949
"tsx": "4.20.3",
5050
"typescript": "^5.9.2",
5151
"viem": "^2.33.3",
5252
"vitest": "^3.2.4",
53-
"zod": "^4.0.15"
53+
"zod": "^4.0.17"
5454
},
5555
"commitlint": {
5656
"extends": [

src/config/common.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,19 @@ export const CommonSchema = z.object({
145145
description: "Max block range size for eth_getLogs",
146146
env: "LOGS_PAGE_SIZE",
147147
}),
148+
/**
149+
* Polling interval in milliseconds, default to what's default in viem
150+
*/
151+
pollingInterval: z.coerce
152+
.number()
153+
.nonnegative()
154+
.optional()
155+
.register(zommandRegistry, {
156+
flags: "--polling-interval <interval>",
157+
description:
158+
"Polling interval in milliseconds, default to what's default in viem",
159+
env: "POLLING_INTERVAL",
160+
}),
148161
/**
149162
* Private key used to send liquidation transactions
150163
*/

src/services/Client.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,8 @@ export default class Client {
6161
#balance?: bigint;
6262

6363
public async launch(): Promise<void> {
64-
const { chainId, network, optimistic, privateKey } = this.config;
64+
const { chainId, network, optimistic, privateKey, pollingInterval } =
65+
this.config;
6566
const transport = createTransport(this.config, {
6667
timeout: optimistic ? 240_000 : 10_000,
6768
retryCount: optimistic ? 3 : undefined,
@@ -75,7 +76,7 @@ export default class Client {
7576
cacheTime: 0,
7677
chain,
7778
transport,
78-
pollingInterval: optimistic ? 25 : undefined,
79+
pollingInterval: optimistic ? 25 : pollingInterval,
7980
});
8081
this.#walletClient = createWalletClient({
8182
account: privateKeyToAccount(privateKey.value),

0 commit comments

Comments
 (0)