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

POC: Add web3modal #3727

Closed
wants to merge 5 commits into from
Closed

POC: Add web3modal #3727

wants to merge 5 commits into from

Conversation

usame-algan
Copy link
Member

@usame-algan usame-algan commented May 16, 2024

What it solves

Resolves #3701

  • Currently only activated on Sepolia and Mainnet until we can get static chain configs
  • No balances visible yet
  • Wallet tracking most likely not working yet
  • Switch wallet not working
  • Social Login not working
  • No Ledger or Trezor support

How this PR fixes it

  • Replaces all instances of useOnboard with new hooks
  • Adjusts function signatures to expect a Eip1193Provider instead of a custom onboard object

How to test it

WIP

Screenshots

Checklist

  • I've tested the branch on mobile 📱
  • I've documented how it affects the analytics (if at all) 📊
  • I've written a unit/e2e test for it (if applicable) 🧑‍💻

Copy link

github-actions bot commented May 16, 2024

Copy link

github-actions bot commented May 16, 2024

ESLint Summary View Full Report

Annotations are provided inline on the Files Changed tab. You can also see all annotations that were generated on the annotations page.

Type Occurrences Fixable
Errors 0 0
Warnings 0 0
Ignored 0 N/A
  • Result: ✅ success
  • Annotations: 0 total

Report generated by eslint-plus-action

Copy link

github-actions bot commented May 16, 2024

Coverage report

Action wasn't able to generate report within GitHub comment limit. If you're facing this issue, please let me know by commenting under this issue.

Report generated by 🧪jest coverage report action from 504f830

@usame-algan usame-algan force-pushed the poc-w3m branch 2 times, most recently from f2b9979 to ee590fd Compare May 17, 2024 08:19
Copy link

github-actions bot commented May 17, 2024

📦 Next.js Bundle Analysis for safe-wallet-web

This analysis was generated by the Next.js Bundle Analysis action. 🤖

⚠️ Global Bundle Size Increased

Page Size (compressed)
global 1.32 MB (🔴 +340.22 KB)
Details

The global bundle is the javascript bundle that loads alongside every page. It is in its own category because its impact is much higher - an increase to its size means that every page on your website loads slower, and a decrease means every page loads faster.

Any third party scripts you have added directly to your app using the <script> tag are not accounted for in this analysis

If you want further insight into what is behind the changes, give @next/bundle-analyzer a try!

Twenty-seven Pages Changed Size

The following pages changed size from the code in this PR compared to its base branch:

Page Size (compressed) First Load
/address-book 27.51 KB (🟢 -5 B) 1.35 MB
/apps 50.03 KB (-4 B) 1.37 MB
/apps/custom 41.66 KB (🟢 -7 B) 1.36 MB
/apps/open 84.96 KB (🟡 +51 B) 1.4 MB
/balances 30.58 KB (🟢 -9 B) 1.35 MB
/balances/nfts 20.27 KB (🟢 -5 B) 1.34 MB
/home 63.6 KB (-5 B) 1.38 MB
/licenses 5 KB (🟢 -1 B) 1.33 MB
/new-safe/create 32.23 KB (-2 B) 1.35 MB
/new-safe/load 18.35 KB (🟢 -3 B) 1.34 MB
/settings/appearance 8.38 KB (🟢 -5 B) 1.33 MB
/settings/cookies 7.57 KB (🟢 -4 B) 1.33 MB
/settings/data 7.48 KB (🟢 -4 B) 1.33 MB
/settings/environment-variables 9.07 KB (🟢 -4 B) 1.33 MB
/settings/modules 9.56 KB (🟢 -4 B) 1.33 MB
/settings/notifications 28.01 KB (-1 B) 1.35 MB
/settings/safe-apps 25.34 KB (🟢 -3 B) 1.35 MB
/settings/security-login 31.13 KB (🟢 -12 B) 1.35 MB
/settings/setup 32.07 KB (🟢 -9 B) 1.35 MB
/share/safe-app 10.66 KB (🟢 -7 B) 1.33 MB
/transactions 107.96 KB (🟢 -68 B) 1.43 MB
/transactions/history 107.92 KB (🟢 -68 B) 1.43 MB
/transactions/messages 67.85 KB (🟡 +47 B) 1.39 MB
/transactions/queue 63.17 KB (🟡 +47 B) 1.38 MB
/transactions/tx 53 KB (🟡 +51 B) 1.37 MB
/welcome 6.7 KB (🟢 -14 B) 1.33 MB
/welcome/social-login 7.08 KB (🟢 -12 B) 1.33 MB
Details

Only the gzipped size is provided here based on an expert tip.

First Load is the size of the global bundle plus the bundle for the individual page. If a user were to show up to your website and land on a given page, the first load size represents the amount of javascript that user would need to download. If next/link is used, subsequent page loads would only need to download that page's bundle (the number in the "Size" column), since the global bundle has already been downloaded.

Any third party scripts you have added directly to your app using the <script> tag are not accounted for in this analysis

Next to the size is how much the size has increased or decreased compared with the base branch of this PR. If this percentage has increased by 20% or more, there will be a red status indicator applied, indicating that special attention should be given to this.

@@ -45,3 +45,4 @@ NEXT_PUBLIC_REDEFINE_API=
NEXT_PUBLIC_SOCIAL_WALLET_OPTIONS_STAGING=
NEXT_PUBLIC_SOCIAL_WALLET_OPTIONS_PRODUCTION=

NEXT_PUBLIC_WEB3MODAL_PROJECT_ID=
Copy link
Member

Choose a reason for hiding this comment

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

Looks like this would be a required env var. We should mention it in the readme.

Copy link
Member

@katspaugh katspaugh left a comment

Choose a reason for hiding this comment

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

Maybe we should have an abstraction layer between our code and a connector library. Otherwise we'd have to edit 25 files (counting all the web3modal imports) every time we switch (which admittedly doesn't happen often).

@usame-algan
Copy link
Member Author

Maybe we should have an abstraction layer between our code and a connector library. Otherwise we'd have to edit 25 files (counting all the web3modal imports) every time we switch (which admittedly doesn't happen often).

I could imagine that we can adjust our WalletProvider to expose this via the useWallet hook i.e.

const { wallet, connectWallet, disconnectWallet, switchNetwork, ... } = useWallet()

@usame-algan
Copy link
Member Author

Closing this for now. We can use this as a basis once there is Ledger support.

@github-actions github-actions bot locked and limited conversation to collaborators Jul 25, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Migrate to AppKit from WalletConnect
2 participants