From 134573f43fb09048ea05a5de16be3690a18422eb Mon Sep 17 00:00:00 2001 From: gregfromstl Date: Fri, 27 Jun 2025 10:47:46 -0700 Subject: [PATCH 1/2] fix: include AA props in default wallets --- .../src/react/web/ui/ConnectWallet/ConnectButton.tsx | 8 +++++++- packages/thirdweb/src/wallets/defaultWallets.ts | 6 +++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/packages/thirdweb/src/react/web/ui/ConnectWallet/ConnectButton.tsx b/packages/thirdweb/src/react/web/ui/ConnectWallet/ConnectButton.tsx index 2e7858c0d81..f10190f4563 100644 --- a/packages/thirdweb/src/react/web/ui/ConnectWallet/ConnectButton.tsx +++ b/packages/thirdweb/src/react/web/ui/ConnectWallet/ConnectButton.tsx @@ -292,8 +292,14 @@ export function ConnectButton(props: ConnectButtonProps) { getDefaultWallets({ appMetadata: props.appMetadata, chains: props.chains, + executionMode: props.accountAbstraction + ? { + mode: "EIP4337", + smartAccount: props.accountAbstraction, + } + : undefined, }), - [props.wallets, props.appMetadata, props.chains], + [props.wallets, props.appMetadata, props.chains, props.accountAbstraction], ); const localeQuery = useConnectLocale(props.locale || "en_US"); const connectionManager = useConnectionManager(); diff --git a/packages/thirdweb/src/wallets/defaultWallets.ts b/packages/thirdweb/src/wallets/defaultWallets.ts index b966a053957..45dfa4c1d9c 100644 --- a/packages/thirdweb/src/wallets/defaultWallets.ts +++ b/packages/thirdweb/src/wallets/defaultWallets.ts @@ -1,6 +1,7 @@ import type { Chain } from "../chains/types.js"; import { COINBASE, METAMASK, RAINBOW, ZERION } from "./constants.js"; import { createWallet } from "./create-wallet.js"; +import type { ExecutionModeOptions } from "./in-app/core/wallet/types.js"; import type { Wallet } from "./interfaces/wallet.js"; import type { AppMetadata } from "./types.js"; @@ -10,9 +11,12 @@ import type { AppMetadata } from "./types.js"; export function getDefaultWallets(options?: { appMetadata?: AppMetadata; chains?: Chain[]; + executionMode?: ExecutionModeOptions; }): Wallet[] { return [ - createWallet("inApp"), + createWallet("inApp", { + executionMode: options?.executionMode, + }), createWallet(METAMASK), createWallet(COINBASE, { appMetadata: options?.appMetadata, From 35341cbbf5b9c1fe1fd9a9d0097a6ff8e9fdc080 Mon Sep 17 00:00:00 2001 From: gregfromstl Date: Fri, 27 Jun 2025 10:48:25 -0700 Subject: [PATCH 2/2] changeset --- .changeset/fifty-turtles-sneeze.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/fifty-turtles-sneeze.md diff --git a/.changeset/fifty-turtles-sneeze.md b/.changeset/fifty-turtles-sneeze.md new file mode 100644 index 00000000000..52466cc17ea --- /dev/null +++ b/.changeset/fifty-turtles-sneeze.md @@ -0,0 +1,5 @@ +--- +"thirdweb": patch +--- + +Prevent admin wallet from connecting when no IAW config is specified