File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
account-kit/react/src/hooks Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -45,6 +45,7 @@ export type UseSendUserOperationArgs<
45
45
> = {
46
46
client : UseSmartAccountClientResult [ "client" ] | undefined ;
47
47
waitForTxn ?: boolean ;
48
+ waitForTxnTag ?: "pending" | "latest" ;
48
49
} & UseSendUserOperationMutationArgs < TEntryPointVersion , TAccount > ;
49
50
50
51
export type UseSendUserOperationResult <
@@ -129,7 +130,12 @@ export function useSendUserOperation<
129
130
> (
130
131
params : UseSendUserOperationArgs < TEntryPointVersion , TAccount > ,
131
132
) : 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 ;
133
139
134
140
const { sendCallsAsync } = useSendCalls < TEntryPointVersion > ( {
135
141
client : _client ,
@@ -186,7 +192,7 @@ export function useSendUserOperation<
186
192
187
193
// TODO: this should really use useCallsStatusHook instead (once it exists)
188
194
const txnHash = await _client
189
- . waitForUserOperationTransaction ( { hash : uoHash } )
195
+ . waitForUserOperationTransaction ( { hash : uoHash , tag : waitForTxnTag } )
190
196
. catch ( ( e ) => {
191
197
throw new WaitForUserOperationError ( request ! , e ) ;
192
198
} ) ;
You can’t perform that action at this time.
0 commit comments