Skip to content

Commit 6d1d344

Browse files
authored
Fix: Exclude IAW when smart wallets are used (#7454)
1 parent 26b8c32 commit 6d1d344

File tree

3 files changed

+17
-2
lines changed

3 files changed

+17
-2
lines changed

.changeset/fifty-turtles-sneeze.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"thirdweb": patch
3+
---
4+
5+
Prevent admin wallet from connecting when no IAW config is specified

packages/thirdweb/src/react/web/ui/ConnectWallet/ConnectButton.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -292,8 +292,14 @@ export function ConnectButton(props: ConnectButtonProps) {
292292
getDefaultWallets({
293293
appMetadata: props.appMetadata,
294294
chains: props.chains,
295+
executionMode: props.accountAbstraction
296+
? {
297+
mode: "EIP4337",
298+
smartAccount: props.accountAbstraction,
299+
}
300+
: undefined,
295301
}),
296-
[props.wallets, props.appMetadata, props.chains],
302+
[props.wallets, props.appMetadata, props.chains, props.accountAbstraction],
297303
);
298304
const localeQuery = useConnectLocale(props.locale || "en_US");
299305
const connectionManager = useConnectionManager();

packages/thirdweb/src/wallets/defaultWallets.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import type { Chain } from "../chains/types.js";
22
import { COINBASE, METAMASK, RAINBOW, ZERION } from "./constants.js";
33
import { createWallet } from "./create-wallet.js";
4+
import type { ExecutionModeOptions } from "./in-app/core/wallet/types.js";
45
import type { Wallet } from "./interfaces/wallet.js";
56
import type { AppMetadata } from "./types.js";
67

@@ -10,9 +11,12 @@ import type { AppMetadata } from "./types.js";
1011
export function getDefaultWallets(options?: {
1112
appMetadata?: AppMetadata;
1213
chains?: Chain[];
14+
executionMode?: ExecutionModeOptions;
1315
}): Wallet[] {
1416
return [
15-
createWallet("inApp"),
17+
createWallet("inApp", {
18+
executionMode: options?.executionMode,
19+
}),
1620
createWallet(METAMASK),
1721
createWallet(COINBASE, {
1822
appMetadata: options?.appMetadata,

0 commit comments

Comments
 (0)