Skip to content

Commit ac88279

Browse files
authored
feat: add flashblocks support to react (#2037)
1 parent 8f24ea0 commit ac88279

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

account-kit/react/src/hooks/useSendUserOperation.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ export type UseSendUserOperationArgs<
4545
> = {
4646
client: UseSmartAccountClientResult["client"] | undefined;
4747
waitForTxn?: boolean;
48+
waitForTxnTag?: "pending" | "latest";
4849
} & UseSendUserOperationMutationArgs<TEntryPointVersion, TAccount>;
4950

5051
export type UseSendUserOperationResult<
@@ -129,7 +130,12 @@ export function useSendUserOperation<
129130
>(
130131
params: UseSendUserOperationArgs<TEntryPointVersion, TAccount>,
131132
): UseSendUserOperationResult<TEntryPointVersion, TAccount> {
132-
const { client: _client, waitForTxn = false, ...mutationArgs } = params;
133+
const {
134+
client: _client,
135+
waitForTxn = false,
136+
waitForTxnTag = "latest",
137+
...mutationArgs
138+
} = params;
133139

134140
const { sendCallsAsync } = useSendCalls<TEntryPointVersion>({
135141
client: _client,
@@ -186,7 +192,7 @@ export function useSendUserOperation<
186192

187193
// TODO: this should really use useCallsStatusHook instead (once it exists)
188194
const txnHash = await _client
189-
.waitForUserOperationTransaction({ hash: uoHash })
195+
.waitForUserOperationTransaction({ hash: uoHash, tag: waitForTxnTag })
190196
.catch((e) => {
191197
throw new WaitForUserOperationError(request!, e);
192198
});

0 commit comments

Comments
 (0)