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

feat: add deeplinks for Send Eth, Send ERC20 and Approve ERC20 #313

Merged
merged 7 commits into from
Apr 9, 2024

Conversation

seaona
Copy link
Contributor

@seaona seaona commented Apr 8, 2024

Description

This PR adds support to Deeplinks in the test dapp. This will allows us to automate e2e tests around the feature. Specifically,

  • Adds Simple Send Eth for deeplinks
  • Adds ERC20 transfer. For this, we need to pass the contract address and the decimals in the URL. Notice for this functionality we'll access it from the browser (outside the wallet), that's why we need to pre-deploy a contract, in order to use it, if we want to have assets.
  • Adds ERC20 approve. For this, we need to pass the contract address and the decimals in the URL. Notice for this functionality we'll access it from the browser (outside the wallet), that's why we need to pre-deploy a contract, in order to use it, if we want to have assets.

Screenshots

Screenshot from 2024-04-08 20-03-33

deeplink-test-dapp-support.mp4

Manual QA

  1. Build the test dapp locally
  2. With the Extension/Mobile test dapp: deploy an ERC20 token
  3. Copy the address the the decimals (default is 4)
  4. Now, go to the Mobile Browser (outside the MetaMask wallet)
  5. Add this URL: http://localhost:9011/?contract=0x35e22143f85CD31F5319Ae4295B36F396bF27f78&decimals=4 but change the contract address and decimals for the one you deployed
  6. Click Send Eth --open MM and proceed with the tx
  7. Go back to the browser
  8. Click Transfer Tokens -- open MM and proceed with the tx
  9. Go back to the browser
  10. Click Approve Tokens -- open MM and proceed with the tx

@seaona seaona marked this pull request as ready for review April 8, 2024 18:08
@@ -46,6 +46,11 @@ if (!ethers.utils.isAddress(deployedContractAddress)) {
deployedContractAddress = '';
}

let tokenDecimals = urlSearchParams.get('decimals');
if (!tokenDecimals) {
tokenDecimals = '18';
Copy link
Contributor Author

Choose a reason for hiding this comment

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

we set this value as default, if no value for decimals is passed in the query param on the URL

@seaona seaona merged commit fcc0cff into main Apr 9, 2024
7 checks passed
@seaona seaona deleted the deeplinks branch April 9, 2024 17:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants