From e61e5abc64ed3382b927e3a074177b42507cfb94 Mon Sep 17 00:00:00 2001 From: Alexander Khramov Date: Tue, 17 Sep 2024 15:32:12 +0300 Subject: [PATCH] fix: reassign connector name for CoinbaseSmartWallet --- .../wallets/coinbase-smart-wallet/src/index.ts | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/packages/wallets/coinbase-smart-wallet/src/index.ts b/packages/wallets/coinbase-smart-wallet/src/index.ts index c69889a8..4505f4c1 100644 --- a/packages/wallets/coinbase-smart-wallet/src/index.ts +++ b/packages/wallets/coinbase-smart-wallet/src/index.ts @@ -7,17 +7,27 @@ export const id = 'coinbaseSmartWallet'; export const name = 'Coinbase Smart Wallet'; export const rdns = 'com.coinbase.wallet'; -export const getCoinbaseSmartWalletConnector = () => - coinbaseWallet({ +type ConfigType = Parameters>[0]; + +export const getCoinbaseSmartWalletConnector = (config: ConfigType) => { + const coinbaseCreateConnectorFn = coinbaseWallet({ preference: 'smartWalletOnly', appName: globalThis.window?.location?.hostname, }); + const coinbaseConnector = coinbaseCreateConnectorFn(config); + + return { + ...coinbaseConnector, + name, + }; +}; + export const CoinbaseSmartWallet: WalletAdapterType = ({ providersStore }) => ({ walletName: name, walletId: id, type: coinbaseWallet.type, icon: WalletIcon, detector: () => isProviderExistsEIP6963(providersStore, rdns), - createConnectorFn: getCoinbaseSmartWalletConnector(), + createConnectorFn: getCoinbaseSmartWalletConnector, });