Skip to content

Commit

Permalink
Merge pull request #1790 from Web3Auth/fix/wallet-connect-project-id
Browse files Browse the repository at this point in the history
fixes wallet connect id check
  • Loading branch information
chaitanyapotti authored Apr 16, 2024
2 parents cb255a5 + 5f9ebbf commit 0260ca5
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 11 deletions.
5 changes: 1 addition & 4 deletions packages/adapters/default-evm-adapter/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,7 @@ export const getDefaultExternalAdapters = async (params: { options: Web3AuthNoMo
web3AuthNetwork,
useCoreKitKey,
adapterSettings: {
walletConnectInitOptions: {
// Using a default wallet connect project id for web3auth modal integration
projectId: "d3c63f19f9582f8ba48e982057eb096b",
},
walletConnectInitOptions: {},
},
});

Expand Down
16 changes: 9 additions & 7 deletions packages/modal/src/modalManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -241,16 +241,18 @@ export class Web3Auth extends Web3AuthNoModal implements IWeb3AuthModal {
} as Record<string, ModalConfig>;
this.modalConfig.adapters[WALLET_ADAPTERS.WALLET_CONNECT_V2].showOnModal = false;
} else {
if (!walletConnectProjectId)
if (!walletConnectAdapter?.adapterOptions?.adapterSettings?.walletConnectInitOptions?.projectId && !walletConnectProjectId)
throw WalletInitializationError.invalidParams("Invalid wallet connect project id. Please configure it on the dashboard");

walletConnectAdapter.setAdapterSettings({
adapterSettings: {
walletConnectInitOptions: {
projectId: walletConnectProjectId,
if (walletConnectProjectId) {
walletConnectAdapter.setAdapterSettings({
adapterSettings: {
walletConnectInitOptions: {
projectId: walletConnectProjectId,
},
},
},
});
});
}
}
}

Expand Down

0 comments on commit 0260ca5

Please sign in to comment.