Skip to content

Commit

Permalink
chore: reduce default wait interval (#550)
Browse files Browse the repository at this point in the history
  • Loading branch information
joepegler authored Oct 11, 2024
1 parent 67ec368 commit 71d3925
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 12 deletions.
8 changes: 6 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# @biconomy/account

## 4.6.4

### Patch Changes

- shorten default pollInterval

## 4.6.3

### Patch Changes
Expand All @@ -16,8 +22,6 @@

### Patch Changes

- Taiko testnet fix

## 4.5.5

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"sideEffects": false,
"name": "@biconomy/account",
"author": "Biconomy",
"version": "4.6.3",
"version": "4.5.6",
"description": "SDK for Biconomy integration with support for account abstraction, smart accounts, ERC-4337.",
"keywords": [
"erc-7579",
Expand Down
15 changes: 6 additions & 9 deletions src/bundler/Bundler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import type {
} from "./utils/Types.js"
import { extractChainIdFromBundlerUrl } from "./utils/Utils.js"

const POLL_INTERVAL = 2000;
/**
* This class implements IBundler interface.
* Implementation sends UserOperation to a bundler URL as per ERC4337 standard.
Expand Down Expand Up @@ -182,7 +183,7 @@ export class Bundler implements IBundler {
let totalDuration = 0

return new Promise<UserOpReceipt>((resolve, reject) => {
const intervalValue = this.UserOpReceiptIntervals[chainId] || 5000 // default 5 seconds
const intervalValue = this.UserOpReceiptIntervals[chainId] || POLL_INTERVAL
const intervalId = setInterval(async () => {
try {
const userOpResponse = await this.getUserOpReceipt(
Expand Down Expand Up @@ -215,10 +216,8 @@ export class Bundler implements IBundler {
clearInterval(intervalId)
reject(
new Error(
`Exceeded maximum duration (${
maxDuration / 1000
} sec) waiting to get receipt for userOpHash ${
sendUserOperationResponse.result
`Exceeded maximum duration (${maxDuration / 1000
} sec) waiting to get receipt for userOpHash ${sendUserOperationResponse.result
}. Try getting the receipt manually using eth_getUserOperationReceipt rpc method on bundler`
)
)
Expand Down Expand Up @@ -255,10 +254,8 @@ export class Bundler implements IBundler {
clearInterval(intervalId)
reject(
new Error(
`Exceeded maximum duration (${
maxDuration / 1000
} sec) waiting to get receipt for userOpHash ${
sendUserOperationResponse.result
`Exceeded maximum duration (${maxDuration / 1000
} sec) waiting to get receipt for userOpHash ${sendUserOperationResponse.result
}. Try getting the receipt manually using eth_getUserOperationReceipt rpc method on bundler`
)
)
Expand Down

0 comments on commit 71d3925

Please sign in to comment.