diff --git a/packages/adapters/wallet-connect-v2-adapter/src/config.ts b/packages/adapters/wallet-connect-v2-adapter/src/config.ts index 57e622384..49de45709 100644 --- a/packages/adapters/wallet-connect-v2-adapter/src/config.ts +++ b/packages/adapters/wallet-connect-v2-adapter/src/config.ts @@ -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], diff --git a/packages/providers/ethereum-provider/src/providers/privateKeyProviders/TransactionFormatter/index.ts b/packages/providers/ethereum-provider/src/providers/privateKeyProviders/TransactionFormatter/index.ts index 5f38ee98c..1b5af0083 100644 --- a/packages/providers/ethereum-provider/src/providers/privateKeyProviders/TransactionFormatter/index.ts +++ b/packages/providers/ethereum-provider/src/providers/privateKeyProviders/TransactionFormatter/index.ts @@ -59,7 +59,22 @@ export class TransactionFormatter { if (!this.isEIP1559Compatible && clonedTxParams.gasPrice) { if (clonedTxParams.maxFeePerGas) delete clonedTxParams.maxFeePerGas; if (clonedTxParams.maxPriorityFeePerGas) delete clonedTxParams.maxPriorityFeePerGas; + // if user provides gas Limit, we should use it instead // if gas is not provided explicitly, estimate it. + if (!clonedTxParams.gasLimit) { + if (!clonedTxParams.gas) { + const defaultGasLimit = await this.getDefaultGasLimit(clonedTxParams); + if (defaultGasLimit) { + clonedTxParams.gasLimit = defaultGasLimit; + } + } else { + clonedTxParams.gasLimit = clonedTxParams.gas; + } + } + return clonedTxParams; + } + + if (!clonedTxParams.gasLimit) { if (!clonedTxParams.gas) { const defaultGasLimit = await this.getDefaultGasLimit(clonedTxParams); if (defaultGasLimit) { @@ -68,16 +83,6 @@ export class TransactionFormatter { } else { clonedTxParams.gasLimit = clonedTxParams.gas; } - return clonedTxParams; - } - - if (!clonedTxParams.gas) { - const defaultGasLimit = await this.getDefaultGasLimit(clonedTxParams); - if (defaultGasLimit) { - clonedTxParams.gasLimit = defaultGasLimit; - } - } else { - clonedTxParams.gasLimit = clonedTxParams.gas; } const { diff --git a/packages/ui/src/components/ExternalWallets.tsx b/packages/ui/src/components/ExternalWallets.tsx index 3987b7357..45c641535 100644 --- a/packages/ui/src/components/ExternalWallets.tsx +++ b/packages/ui/src/components/ExternalWallets.tsx @@ -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,