diff --git a/.changeset/angry-mayflies-push.md b/.changeset/angry-mayflies-push.md new file mode 100644 index 00000000000..2e18d6786b7 --- /dev/null +++ b/.changeset/angry-mayflies-push.md @@ -0,0 +1,5 @@ +--- +"thirdweb": patch +--- + +Sanitize block explorer URLs diff --git a/packages/thirdweb/src/react/web/ui/ConnectWallet/TransactionsScreen.tsx b/packages/thirdweb/src/react/web/ui/ConnectWallet/TransactionsScreen.tsx index a53c69be431..2c635a8e5c4 100644 --- a/packages/thirdweb/src/react/web/ui/ConnectWallet/TransactionsScreen.tsx +++ b/packages/thirdweb/src/react/web/ui/ConnectWallet/TransactionsScreen.tsx @@ -3,6 +3,7 @@ import { ExternalLinkIcon } from "@radix-ui/react-icons"; import { useState } from "react"; import type { ThirdwebClient } from "../../../../client/client.js"; +import { formatExplorerAddressUrl } from "../../../../utils/url.js"; import { iconSize } from "../../../core/design-system/index.js"; import { useChainExplorers } from "../../../core/hooks/others/useChainQuery.js"; import { useActiveAccount } from "../../../core/hooks/wallets/useActiveAccount.js"; @@ -125,7 +126,10 @@ export function TransactionsScreen(props: { diff --git a/packages/thirdweb/src/react/web/ui/TransactionButton/ExecutingScreen.tsx b/packages/thirdweb/src/react/web/ui/TransactionButton/ExecutingScreen.tsx index c83a55c506f..8719f12c0ef 100644 --- a/packages/thirdweb/src/react/web/ui/TransactionButton/ExecutingScreen.tsx +++ b/packages/thirdweb/src/react/web/ui/TransactionButton/ExecutingScreen.tsx @@ -3,6 +3,7 @@ import { useCallback, useEffect, useRef, useState } from "react"; import type { Hex } from "viem"; import type { WaitForReceiptOptions } from "../../../../transaction/actions/wait-for-tx-receipt.js"; import type { PreparedTransaction } from "../../../../transaction/prepare-transaction.js"; +import { formatExplorerTxUrl } from "../../../../utils/url.js"; import { iconSize } from "../../../core/design-system/index.js"; import { useChainExplorers } from "../../../core/hooks/others/useChainQuery.js"; import { useSendTransaction } from "../../hooks/transaction/useSendTransaction.js"; @@ -106,7 +107,10 @@ export function ExecutingTxScreen(props: {