From 13ffc5d0a9c8ecc0a1d0b26da386a59b1b01508f Mon Sep 17 00:00:00 2001 From: Joaquim Verges Date: Sun, 14 Sep 2025 22:57:37 +1200 Subject: [PATCH] [SDK] Add wallet validation before executing transactions --- packages/thirdweb/src/react/core/hooks/useStepExecutor.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/packages/thirdweb/src/react/core/hooks/useStepExecutor.ts b/packages/thirdweb/src/react/core/hooks/useStepExecutor.ts index 0163da2e62c..a568bd376cd 100644 --- a/packages/thirdweb/src/react/core/hooks/useStepExecutor.ts +++ b/packages/thirdweb/src/react/core/hooks/useStepExecutor.ts @@ -408,6 +408,14 @@ export function useStepExecutor( abortControllerRef.current = abortController; try { + if (flatTxs.length > 0 && !wallet) { + throw new ApiError({ + code: "INVALID_INPUT", + message: "No wallet provided to execute transactions", + statusCode: 400, + }); + } + // Execute onramp first if configured and not already completed if (preparedQuote.type === "onramp" && onrampStatus === "pending") { await executeOnramp(