diff --git a/landing/siwe.react.js b/landing/siwe.react.js --- a/landing/siwe.react.js +++ b/landing/siwe.react.js @@ -36,7 +36,7 @@ window.ReactNativeWebView?.postMessage?.(JSON.stringify(message)); } -const wagmiConfig = getWagmiConfig(); +const wagmiConfig = getWagmiConfig(['rainbow', 'metamask', 'walletconnect']); type Signer = { +signMessage: ({ +message: string, ... }) => Promise, diff --git a/lib/utils/wagmi-utils.js b/lib/utils/wagmi-utils.js --- a/lib/utils/wagmi-utils.js +++ b/lib/utils/wagmi-utils.js @@ -5,6 +5,7 @@ injectedWallet, metaMaskWallet, rainbowWallet, + coinbaseWallet, walletConnectWallet, // eslint-disable-next-line import/extensions } from '@rainbow-me/rainbowkit/wallets'; @@ -23,16 +24,21 @@ ? http(`https://eth-mainnet.g.alchemy.com/v2/${alchemyKey}`) : http(); -type GetWagmiConfigParams = { - +includeInjectedWallet?: ?boolean, +const walletMap = { + injected: injectedWallet, + rainbow: rainbowWallet, + metamask: metaMaskWallet, + coinbase: coinbaseWallet, + walletconnect: walletConnectWallet, }; -function getWagmiConfig(params?: ?GetWagmiConfigParams): mixed { - const wallets = []; - if (params?.includeInjectedWallet) { - wallets.push(injectedWallet); - } - if (projectId) { - wallets.push(rainbowWallet, metaMaskWallet, walletConnectWallet); +type Wallet = $Keys; + +function getWagmiConfig(walletArr: $ReadOnlyArray): mixed { + let wallets: Array; + if (!projectId) { + wallets = walletArr.includes('injected') ? [injectedWallet] : []; + } else { + wallets = walletArr.map(wallet => walletMap[wallet]); } const connectors = connectorsForWallets( diff --git a/patches/@rainbow-me+rainbowkit+2.0.4.patch b/patches/@rainbow-me+rainbowkit+2.0.4.patch --- a/patches/@rainbow-me+rainbowkit+2.0.4.patch +++ b/patches/@rainbow-me+rainbowkit+2.0.4.patch @@ -10,3 +10,15 @@ + emojiAvatarForAddress, useConnectModal }; +diff --git a/node_modules/@rainbow-me/rainbowkit/dist/wallets/walletConnectors/chunk-62IPH7HD.js b/node_modules/@rainbow-me/rainbowkit/dist/wallets/walletConnectors/chunk-62IPH7HD.js +index 892ac7c..008a7c7 100644 +--- a/node_modules/@rainbow-me/rainbowkit/dist/wallets/walletConnectors/chunk-62IPH7HD.js ++++ b/node_modules/@rainbow-me/rainbowkit/dist/wallets/walletConnectors/chunk-62IPH7HD.js +@@ -86,6 +86,7 @@ var coinbaseWallet = ({ + ...coinbaseWagmiWallet({ + appName, + appLogoUrl: appIcon, ++ enableMobileWalletLink: true, + headlessMode: true + })(config), + ...walletDetails diff --git a/web/app.react.js b/web/app.react.js --- a/web/app.react.js +++ b/web/app.react.js @@ -125,7 +125,13 @@ const queryClient = new QueryClient(); -const wagmiConfig = getWagmiConfig({ includeInjectedWallet: true }); +const wagmiConfig = getWagmiConfig([ + 'injected', + 'rainbow', + 'metamask', + 'coinbase', + 'walletconnect', +]); type BaseProps = { +location: {