Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adds wc metamask, rainbow #1555

Merged
merged 2 commits into from
Jul 21, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions packages/adapters/wallet-connect-v2-adapter/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,32 @@ import { CHAIN_NAMESPACES, ChainNamespaceType, IWalletConnectExtensionAdapter }
import { IAdapterSettings } from "./interface";

export const WALLET_CONNECT_EXTENSION_ADAPTERS: IWalletConnectExtensionAdapter[] = [
{
name: "Rainbow",
chains: [CHAIN_NAMESPACES.EIP155],
logo: "https://images.web3auth.io/login-rainbow.svg",
mobile: {
native: "rainbow:",
universal: "https://rnbwapp.com",
},
desktop: {
native: "",
universal: "",
},
},
{
name: "MetaMask",
chains: [CHAIN_NAMESPACES.EIP155],
logo: "https://images.web3auth.io/login-metamask.svg",
mobile: {
native: "metamask:",
universal: "https://metamask.app.link",
},
desktop: {
native: "",
universal: "",
},
},
{
name: "Argent",
chains: [CHAIN_NAMESPACES.EIP155],
Expand Down
6 changes: 5 additions & 1 deletion packages/ui/src/components/ExternalWallets.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,12 @@ export default function ExternalWallet(props: ExternalWalletsProps) {
const buttons: ExternalButton[] = [];
// add wallet connect links
if (deviceDetails.platform === bowser.PLATFORMS_MAP.mobile) {
const mobileLinks = formatMobileRegistry(wcAdapters, walletConnectUri, deviceDetails.os, deviceDetails.platform);
let mobileLinks = formatMobileRegistry(wcAdapters, walletConnectUri, deviceDetails.os, deviceDetails.platform);
if (deviceDetails.os === bowser.OS_MAP.iOS) {
if ((window as any).ethereum?.isMetaMask) {
// if metamask, use the metamask adapter directly
mobileLinks = mobileLinks.filter((x) => x.name !== "MetaMask");
}
buttons.push(
...mobileLinks.map((link) => ({
name: link.name,
Expand Down