Skip to content

Commit

Permalink
more aggressive polling
Browse files Browse the repository at this point in the history
  • Loading branch information
alvrs committed Apr 18, 2024
1 parent c0383ee commit 4855275
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 2 additions & 0 deletions packages/account-kit/src/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,5 @@ export type AppAccountClient = SmartAccountClient<typeof entryPointAddress, Tran
export const smartAccountFactory = "0x91E60e0613810449d098b0b5Ec8b51A0FE8c8985";

export const unlimitedDelegationControlId = resourceToHex({ type: "system", namespace: "", name: "unlimited" });

export const defaultPollingInterval = 300;
6 changes: 4 additions & 2 deletions packages/account-kit/src/useAppAccountClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { createPimlicoBundlerClient } from "permissionless/clients/pimlico";
import { useConfig } from "./AccountKitProvider";
import { useAppSigner } from "./useAppSigner";
import { useAppAccount } from "./useAppAccount";
import { AppAccountClient, entryPointAddress } from "./common";
import { AppAccountClient, defaultPollingInterval, entryPointAddress } from "./common";
import { getUserBalanceSlot } from "./utils/getUserBalanceSlot";
import { getEntryPointDepositSlot } from "./utils/getEntryPointDepositSlot";
import { transportObserver } from "./transportObserver";
Expand Down Expand Up @@ -51,6 +51,7 @@ export function useAppAccountClient(): AppAccountClient | undefined {
chain: publicClient.chain,
transport: transportObserver("pimlico bundler client", erc4337Config.transport),
entryPoint: entryPointAddress,
pollingInterval: defaultPollingInterval,
}).extend(() => publicActions(publicClient));

const baseMiddleware = {
Expand Down Expand Up @@ -101,6 +102,7 @@ export function useAppAccountClient(): AppAccountClient | undefined {
type: "smartAccountClient",
chain: publicClient.chain,
account: appAccount,
pollingInterval: defaultPollingInterval,
transport: transportObserver("bundler transport", erc4337Config.transport),
})
.extend(
Expand All @@ -118,7 +120,7 @@ export function useAppAccountClient(): AppAccountClient | undefined {
},
}),
)
// .extend(transactionQueue(publicClient))
// .extend(transactionQueue({ publicClient }))
// .extend(writeObserver({ onWrite: (write) => write$.next(write) }))
.extend(() => publicActions(publicClient));

Expand Down

0 comments on commit 4855275

Please sign in to comment.