Skip to content

Commit 778bf2c

Browse files
[SDK] Add wallet validation before executing transactions (#8050)
1 parent 97e5080 commit 778bf2c

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

packages/thirdweb/src/react/core/hooks/useStepExecutor.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -408,6 +408,14 @@ export function useStepExecutor(
408408
abortControllerRef.current = abortController;
409409

410410
try {
411+
if (flatTxs.length > 0 && !wallet) {
412+
throw new ApiError({
413+
code: "INVALID_INPUT",
414+
message: "No wallet provided to execute transactions",
415+
statusCode: 400,
416+
});
417+
}
418+
411419
// Execute onramp first if configured and not already completed
412420
if (preparedQuote.type === "onramp" && onrampStatus === "pending") {
413421
await executeOnramp(

0 commit comments

Comments
 (0)