Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: reduce default wait interval #550

Merged
merged 2 commits into from
Oct 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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
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
Loading