diff --git a/src/buy/components/BuyProvider.tsx b/src/buy/components/BuyProvider.tsx index ec00cc86b3..7866a80ba1 100644 --- a/src/buy/components/BuyProvider.tsx +++ b/src/buy/components/BuyProvider.tsx @@ -87,6 +87,13 @@ export function BuyProvider({ const { sendTransactionAsync } = useSendTransaction(); // Sending the transaction (and approval, if applicable) const { sendCallsAsync } = useSendCalls(); // Atomic Batch transactions (and approval, if applicable) + // Validate `projectId` prop + if (!projectId) { + throw new Error( + 'Buy: projectId must be provided as a prop to the Buy component.', + ); + } + // Refreshes balances and inputs post-swap const resetInputs = useResetBuyInputs({ fromETH, fromUSDC, from, to }); // For batched transactions, listens to and awaits calls from the Wallet server