diff --git a/packages/checkout/widgets-lib/src/widgets/connect/ConnectWidget.tsx b/packages/checkout/widgets-lib/src/widgets/connect/ConnectWidget.tsx index 62b89cfe09..1199eeab04 100644 --- a/packages/checkout/widgets-lib/src/widgets/connect/ConnectWidget.tsx +++ b/packages/checkout/widgets-lib/src/widgets/connect/ConnectWidget.tsx @@ -7,6 +7,7 @@ import { Checkout, ConnectWidgetParams, EIP1193Provider, + EIP6963ProviderInfo, getMetaMaskProviderDetail, getPassportProviderDetail, WalletConnectManager as IWalletConnectManager, @@ -177,14 +178,17 @@ export default function ConnectWidget({ sendProviderUpdatedEvent({ provider }); // Find the wallet provider info via injected with Passport and MetaMask fallbacks - let walletProviderInfo; + let walletProviderInfo: EIP6963ProviderInfo | undefined; if (isWalletConnectProvider(provider)) { walletProviderInfo = walletConnectProviderInfo; } else { const injectedProviderDetails = checkout.getInjectedProviders(); - walletProviderInfo = injectedProviderDetails.find((providerDetail) => ( + const walletProviderDetail = injectedProviderDetails.find((providerDetail) => ( providerDetail.provider === provider.provider )); + if (walletProviderDetail) { + walletProviderInfo = walletProviderDetail.info; + } if (!walletProviderInfo) { if (isPassportProvider(provider)) { walletProviderInfo = getPassportProviderDetail(provider.provider as EIP1193Provider).info; diff --git a/packages/checkout/widgets-lib/src/widgets/connect/connectWidgetEvents.ts b/packages/checkout/widgets-lib/src/widgets/connect/connectWidgetEvents.ts index 84abd12120..7b738ef956 100644 --- a/packages/checkout/widgets-lib/src/widgets/connect/connectWidgetEvents.ts +++ b/packages/checkout/widgets-lib/src/widgets/connect/connectWidgetEvents.ts @@ -4,7 +4,8 @@ import { ConnectEventType, WalletProviderName, WidgetType, - EIP6963ProviderInfo, WalletConnectManager, + WalletConnectManager, + EIP6963ProviderInfo, } from '@imtbl/checkout-sdk'; import { Web3Provider } from '@ethersproject/providers';