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: native dApp support [LIVE-9527] #6328

Merged
merged 46 commits into from
Apr 2, 2024
Merged

feat: native dApp support [LIVE-9527] #6328

merged 46 commits into from
Apr 2, 2024

Conversation

Justkant
Copy link
Contributor

@Justkant Justkant commented Feb 28, 2024

📝 Description

Migration from ETH dApp Browser Live App and iframe-provider to support inside LL directly injecting an EIP 6963 compatible provider in the WebView, using params from the manifest.

ℹ️ For reviewers, explanatory gist of changes: https://gist.github.com/Wozacosta/efca37c582b23bd2702307fc49aa620d/

You can test using the manifest below
{
  "id": "metamask-test-dapp",
  "name": "Metamask Test Dapp",
  "private": false,
  "url": "https://metamask.github.io/test-dapp/",
  "dapp": {
    "networks": [
      {
        "currency": "ethereum",
        "chainID": 1,
        "nodeURL": "https://eth-dapps.api.live.ledger.com"
      },
      {
        "currency": "bsc",
        "chainID": 56,
        "nodeURL": "https://bsc-dataseed.binance.org/"
      },
      {
        "currency": "polygon",
        "chainID": 137,
        "nodeURL": "https://polygon-mainnet.g.alchemy.com/v2/[your-key]"
      },
      {
        "currency": "arbitrum",
        "chainID": 42161,
        "nodeURL": "https://arb1.arbitrum.io/rpc"
      },
      {
        "currency": "optimism",
        "chainID": 10,
        "nodeURL": "https://mainnet.optimism.io"
      }
    ]
  },
  "homepageUrl": "https://metamask.github.io/test-dapp/",
  "icon": "https://cdn.live.ledger.com/icons/platform/1inch.png",
  "platforms": ["android", "ios", "desktop"],
  "apiVersion": "^2.0.0",
  "manifestVersion": "1",
  "branch": "stable",
  "categories": ["tools"],
  "currencies": ["ethereum", "bsc", "polygon", "arbitrum", "optimism"],
  "content": {
    "shortDescription": {
      "en": "Metamask Test Dapp"
    },
    "description": {
      "en": "Metamask Test Dapp"
    }
  },
  "permissions": [],
  "domains": ["http://", "https://"],
  "visibility": "complete"
}

❓ Context

✅ Checklist

Pull Requests must pass the CI and be code reviewed. Set as Draft if the PR is not ready.

  • npx changeset was attached.
  • Covered by automatic tests.
  • Impact of the changes:
    • Shouldn't impact anything existing as it's only enabled for manifests that contain the dapp field
    • We still can tests apps from the discover section but we shouldn't see any impact
    • We have a test manifest above for testing the feature itself

🧐 Checklist for the PR Reviewers

  • The code aligns with the requirements described in the linked JIRA or GitHub issue.
  • The PR description clearly documents the changes made and explains any technical trade-offs or design decisions.
  • There are no undocumented trade-offs, technical debt, or maintainability issues.
    -The PR has been tested thoroughly, and any potential edge cases have been considered and handled.
  • Any new dependencies have been justified and documented.
  • Performance considerations have been taken into account. (changes have been profiled or benchmarked if necessary)

@Justkant Justkant self-assigned this Feb 28, 2024
Copy link

vercel bot commented Feb 28, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

5 Ignored Deployments
Name Status Preview Comments Updated (UTC)
ledger-live-docs ⬜️ Ignored (Inspect) Visit Preview Apr 2, 2024 1:50pm
ledger-live-github-bot ⬜️ Ignored (Inspect) Visit Preview Apr 2, 2024 1:50pm
native-ui-storybook ⬜️ Ignored (Inspect) Visit Preview Apr 2, 2024 1:50pm
react-ui-storybook ⬜️ Ignored (Inspect) Visit Preview Apr 2, 2024 1:50pm
web-tools ⬜️ Ignored (Inspect) Visit Preview Apr 2, 2024 1:50pm

@live-github-bot live-github-bot bot added desktop Has changes in LLD mobile Has changes in LLM common Has changes in live-common labels Feb 28, 2024
@Wozacosta
Copy link
Contributor

Wozacosta commented Feb 28, 2024

Just FYI using the sign typed data V3 action on the test app fails because of ethers library.

We get this error caught in the catch block( https://github.com/LedgerHQ/ledger-live/pull/6328/files#diff-59e2fd754b520d4fb4a88e193bddb176538cb4bf93fcd688179e333c391298d5R607-R613 ) :

Passing a null chainId fails when it tries to use BigNumber over it.

This behaviour is fixed in their v6 ethers-io/ethers.js#3623 (comment)

SCR-20240228-qseb

When forcing chainId to be "1" for instance I get the correct UI back:

SCR-20240228-qrtr

@live-github-bot
Copy link
Contributor

live-github-bot bot commented Feb 29, 2024

Desktop Bundle Checks

Comparing 2b93b13 against 36cfbf3.

✅ Previous issues have all been fixed.

Mobile Bundle Checks

Comparing 2b93b13 against 36cfbf3.

✅ Previous issues have all been fixed.

@live-github-bot live-github-bot bot added the translations Translation files have been touched label Mar 5, 2024
@live-github-bot live-github-bot bot added the tools Has changes in tools label Mar 6, 2024
Copy link

socket-security bot commented Mar 11, 2024

New and removed dependencies detected. Learn more about Socket for GitHub ↗︎

Package New capabilities Transitives Size Publisher

🚮 Removed packages: npm/@expo/[email protected]

View full report↗︎

valpinkman
valpinkman previously approved these changes Apr 2, 2024
@Justkant Justkant requested a review from a team as a code owner April 2, 2024 13:49
Copy link
Member

@CremaFR CremaFR left a comment

Choose a reason for hiding this comment

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

LGTM

@Wozacosta Wozacosta removed the request for review from ComradeAERGO April 2, 2024 16:01
Copy link

@tdommes-ledger tdommes-ledger left a comment

Choose a reason for hiding this comment

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

QA is not mandatory for the review as of now .

@Justkant Justkant merged commit 75a35be into develop Apr 2, 2024
59 of 67 checks passed
@Justkant Justkant deleted the feat/native-dapp branch April 2, 2024 16:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
common Has changes in live-common desktop Has changes in LLD mobile Has changes in LLM tools Has changes in tools translations Translation files have been touched
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants