Skip to content
This repository has been archived by the owner on Jun 24, 2022. It is now read-only.

Use previously supported wallets #2166

Merged
merged 7 commits into from
Mar 1, 2022
Merged

Conversation

henrypalacios
Copy link
Contributor

@henrypalacios henrypalacios commented Jan 17, 2022

Summary

Closes #2165

Proposal:
Try to enable the wallets previously supported by Uniswap and verify that they work.

Detected problems along the way! 🕵️ :

@henrypalacios henrypalacios added app:CowSwap CowSwap app Protofire Handled by Protofire development team labels Jan 17, 2022
@henrypalacios henrypalacios self-assigned this Jan 17, 2022
@github-actions
Copy link
Contributor

  • 🔭 GP Swap: CoW Protocol v2 Swap UI

@henrypalacios
Copy link
Contributor Author

henrypalacios commented Jan 17, 2022

After enabling the 3 filtered wallets I tried to test each of them and found the following:

  1. CoinbaseWallet: 👇 I'm Working on the first one.
  • (Web extension/Mobile) When it has an unsupported wallet the application throws an error.
    Selection_428

  • (Web extension) When switching between MM and CoinbaseWallet, CoinbaseW seems to overlap MM. And when reloading the wallet information disappears and then it become difficult to reconnect to coinbaseW.

Selection_427

It is a very strange behavior that I wanted to know if @elena-zh has any experience about it.

@henrypalacios
Copy link
Contributor Author

henrypalacios commented Jan 17, 2022

  1. Formatic:
  • This one seems to work fine, however it is only available on Mainnet, I guess this PR will be limited to there @alfetopito?
  • We need to register the DApp for cowswap.

Selection_429

  1. Portis:
  • I have not been able to test it, I think is necessary to register the DApp ID for cowswap. Can you help me with that @anxolin?

Selection_430

@leandro

This comment has been minimized.

@elena-zh
Copy link

After enabling the 3 filtered wallets I tried to test each of them and found the following:

  1. CoinbaseWallet: 👇 I'm Working on the first one.
  • (Web extension/Mobile) When it has an unsupported wallet the application throws an error.
    Selection_428
  • (Web extension) When switching between MM and CoinbaseWallet, CoinbaseW seems to overlap MM. And when reloading the wallet information disappears and then it become difficult to reconnect to coinbaseW.

Selection_427

It is a very strange behavior that I wanted to know if @elena-zh has any experience about it.

Hey @henrypalacios ,
As for the Coinbase wallet mobile, we have an issue on the board #1950 . It is the only thing I could help you with.
As for the injected browser wallet, no, unfortunately I did not tested the app integration with this wallet and I can't help you in providing some details about it 😞

@elena-zh
Copy link

@henrypalacios , as for the not showing Connect button, I assume the issue might be connected with this behavior: #1187 : I noticed, that now the Swap form appears, but there is no 'connect' button for the described cases

@henrypalacios henrypalacios changed the title Mute disabled wallets Do not mute previously supported wallets Jan 18, 2022
@henrypalacios henrypalacios force-pushed the 2165-adding-wallet-supports branch 5 times, most recently from e643407 to 8ff122b Compare January 22, 2022 00:49
@henrypalacios henrypalacios reopened this Jan 29, 2022
* enable walletlink and upgrade package

* Limiting the supported networks for CoinbaseWallet

* Adding setDefaultInjected provider
@github-actions
Copy link
Contributor

CLA Assistant Lite All Contributors have signed the CLA.

* Activate formatic wallet

* Adding reconnect Uninjected Provider

* Adding connecting web3Status after refresh

* Upgrade fortmatic to v2.2.1

* Mute unnecessary Overlay useEffect

* Adding new API 🔑

* Adding custom src/custom/connectors/Fortmaitc.ts

* merger conflict resolution
@henrypalacios henrypalacios changed the title Do not mute previously supported wallets Use previously supported wallets Feb 14, 2022
@henrypalacios henrypalacios marked this pull request as ready for review February 15, 2022 13:55
Copy link
Contributor

@alfetopito alfetopito left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Both working great!

`}

${({ clickable, pending }) =>
clickable !== false &&
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if this prop isn't fed clickable explicitly (it's an optional prop with no default) it will still allow clicking, i.e undefined !== false // true

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for such detailed information.

I have moved to explicitly clickDisabled state when disabling.

@@ -230,6 +243,17 @@ export function Web3StatusInner({
<Text>{error instanceof UnsupportedChainIdError ? <Trans>Wrong Network</Trans> : <Trans>Error</Trans>}</Text>
</Web3StatusError>
)
} else if (thereWasAProvider) {
return (
<Web3StatusConnected pending={true} clickable={false}>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ubernit: can just pass pending like so:

Suggested change
<Web3StatusConnected pending={true} clickable={false}>
<Web3StatusConnected pending clickable={false}>


export const OVERLAY_READY = 'OVERLAY_READY'

type FormaticSupportedChains = 1 | 3 | 4 | 42
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should only have chains we support here, should use SupportedChainId enum


type FormaticSupportedChains = 1 | 3 | 4 | 42

const CHAIN_ID_NETWORK_ARGUMENT: { readonly [chainId in FormaticSupportedChains]: string | undefined } = {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here probably

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done!

@@ -4,7 +4,7 @@ import { WalletConnectConnector } from '@web3-react/walletconnect-connector'
import { WalletLinkConnector } from '@web3-react/walletlink-connector'
import { PortisConnector } from '@web3-react/portis-connector'

import { FortmaticConnector } from 'connectors/Fortmatic'
import { FortmaticConnector, getFortmaticApiKey } from 'custom/connectors/Fortmatic'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't need custom in the import

Suggested change
import { FortmaticConnector, getFortmaticApiKey } from 'custom/connectors/Fortmatic'
import { FortmaticConnector, getFortmaticApiKey } from 'connectors/Fortmatic'

} else {
if (isMobile && window.ethereum) {
const connectInjected = useCallback(
(providerName = 'Metamask') => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you not use the WalletProvider.METAMASK enum here? (or does it not exist for some reason?)

Copy link
Contributor Author

@henrypalacios henrypalacios Feb 18, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It does not exist in WalletProvider because it assumes that the INJECTED provider is Metamask, I have created an enum to distinguish between the injected ones.

@@ -84,3 +97,23 @@ export function useEagerConnect() {

return tried
}

export function setDefaultInjected(providerName: 'MetaMask' | 'CoinbaseWallet') {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: use enum WalletProvider enum here

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Accomplished...

@elena-zh
Copy link

elena-zh commented Feb 21, 2022

Hey @henrypalacios , I have faced another issue with Coinbase wallet:

  1. I do a hard refresh of the page OR disconnect a wallet inside the Mobile Coinbase app
  2. the app goes to the 'Connecting' state
  3. I close Coinbase connection window
    ---> The app hangs in the 'Connecting...' state (until I reload the page.
    See the video: https://watch.screencastify.com/v/aeccGsVrwYL3zbXdBlDb

So here I would expected to connect to stop connection process with the Coinbase wallet.

Anyways, it is a low priority. So let me know please If I need to create a separate issue for this.

@elena-zh
Copy link

This issue is an important to fix: when press on the 'Connect Coinbase wallet' from mobile view, the app navigates to the Coinbase app browser and opens Uniswap app instead of the CowSwap.

See the video:

uni.mp4

@elena-zh
Copy link

When I have enabled 2 browser extentions (MM and Coinbase), connect a wallet to the MM and try to confirm a wrap/unwrap/approve token transaction, I see Coinbase wallet pop-up with an error there:
image

However, I can sign Buy/Sell orders transactions (again, I see Coinbase wallet pop-up instead of the MM)

@elena-zh
Copy link

Fortmatic works fine except this issue: I can't call keyboard in order to connect to the wallet when press on the email field in the connection modal

fortm.mp4

The only way to open the keyboard is to long press on the field, then tap it again (takes a lot of time to understand and find out how to manage this).

@elena-zh
Copy link

This issue is an important to fix: when press on the 'Connect Coinbase wallet' from mobile view, the app navigates to the Coinbase app browser and opens Uniswap app instead of the CowSwap.

See the video:

uni.mp4

The issue is fixed: the app opens https://cowswap.exchange/#/swap instead of the Uniswap now.
However, I'd propose to open an appropriate environment in the CB wallet according to the one a user is currently working on:

@@ -25,6 +25,9 @@ export const APP_DATA_HASH = getAppDataHash()
export const PRODUCTION_URL = 'cowswap.exchange'
export const BARN_URL = `barn.${PRODUCTION_URL}`

// Change the generated CoinbaseWallet link by going to the DApp on mobile via deeplink
SUPPORTED_WALLETS_UNISWAP.COINBASE_LINK.href = 'https://go.cb-w.com/o0KpAwewQnb'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How did you generate the link?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The only place I found now was within CoinbaseWallet itself 👇
Selection_462_resize

Which is why it has become a challenge to comply with the following.

"... I'd propose to open an appropriate environment in the CB wallet according to the one a user is currently working on:
BARN - https://barn.cowswap.exchange/#/swap
Stage - https://cowswap.staging.gnosisdev.com/#/swap
Dev/PRs - https://cowswap.dev.gnosisdev.com/#/swap
Prod - https://cowswap.exchange/#/swap

I have tried to remove the COINBASE_LINK

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If it's not trivial to update the link, let's stick to PROD and move on.

@alfetopito
Copy link
Contributor

As discussed on the meeting @elena-zh those 2 issues:

  1. Coinbase conflicting with metamask
  2. Fortmatic wallet not showing the keyboard

Are out of the scope of this change.
I'll go ahead and merge as is to get this included in the next release.

The issue 1 can be resolved by having only 1 injected wallet enabled at a time.

The issue 2 sounds more like up to the wallet than anything we can do on our side.
You could validate that by trying it out on uniswap.

Still, please open issues for them in the backlog, although I don't think we'll prioritize them any time soon.

@alfetopito alfetopito merged commit e88eb5e into develop Mar 1, 2022
@alfetopito alfetopito deleted the 2165-adding-wallet-supports branch March 1, 2022 17:03
@github-actions github-actions bot locked and limited conversation to collaborators Mar 1, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
app:CowSwap CowSwap app Protofire Handled by Protofire development team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Adds wallets previously supported by uniswap (coinbase, formatic, etc)
6 participants