Skip to content

Commit 4fa922c

Browse files
throw error if AA chains are not configured
1 parent 521b999 commit 4fa922c

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

packages/no-modal/src/noModal.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -282,6 +282,10 @@ export class Web3AuthNoModal extends SafeEventEmitter<Web3AuthNoModalEvents> imp
282282
// if AA is enabled, filter out chains that are not AA-supported
283283
if (this.coreOptions.accountAbstractionConfig) {
284284
// write a for loop over accountAbstractionConfig.chains and check if the chainId is valid
285+
if (this.coreOptions.accountAbstractionConfig.chains.length === 0) {
286+
log.error("Please configure chains for smart accounts on dashboard at https://dashboard.web3auth.io");
287+
throw WalletInitializationError.invalidParams("Please configure chains for smart accounts on dashboard at https://dashboard.web3auth.io");
288+
}
285289
for (const chain of this.coreOptions.accountAbstractionConfig.chains) {
286290
if (!isHexStrict(chain.chainId)) {
287291
log.error(`Please provide a valid chainId in accountAbstractionConfig.chains for chain ${chain.chainId}`);

0 commit comments

Comments
 (0)