Skip to content

Commit cbdb7cd

Browse files
committed
fixup! feat(sdk): makes chain optional in smart wallet config
1 parent d1e7560 commit cbdb7cd

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

packages/thirdweb/src/wallets/smart/smart-wallet.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,12 @@ import type { SmartWalletOptions } from "./types.js";
129129
export function smartWallet(
130130
createOptions: SmartWalletOptions,
131131
): Wallet<"smart"> {
132+
if (
133+
typeof createOptions.factoryAddress === "undefined" &&
134+
typeof createOptions.chain !== "undefined"
135+
) {
136+
throw new Error("You must provide a chain if factory address is specified");
137+
}
132138
const emitter = createWalletEmitter<"smart">();
133139
let account: Account | undefined = undefined;
134140
let adminAccount: Account | undefined = undefined;

0 commit comments

Comments
 (0)