Skip to content

Commit

Permalink
fix: reassign connector name for CoinbaseSmartWallet
Browse files Browse the repository at this point in the history
  • Loading branch information
alx-khramov committed Sep 17, 2024
1 parent ce8dabb commit e61e5ab
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions packages/wallets/coinbase-smart-wallet/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<ReturnType<typeof coinbaseWallet>>[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,
});

0 comments on commit e61e5ab

Please sign in to comment.