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(wallets): add support for wallet_addEthereumChain and wallet_switchEthereumChain #3371

Merged
merged 1 commit into from
Jun 19, 2024

Conversation

gregfromstl
Copy link
Member

@gregfromstl gregfromstl commented Jun 18, 2024

PR-Codex overview

This PR enhances the WalletConnect integration by adding support for validating account addresses, switching Ethereum chains, and handling chain-related requests.

Detailed summary

  • Added support for validating account addresses with checksum
  • Implemented handling of switching Ethereum chains
  • Updated request handlers for adding and switching Ethereum chains
  • Added tests for wallet_addEthereumChain and wallet_switchEthereumChain requests

✨ Ask PR-Codex anything about this PR by commenting with /codex {your question}

Copy link

vercel bot commented Jun 18, 2024

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

Name Status Preview Comments Updated (UTC)
thirdweb_playground ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 19, 2024 2:46am

Copy link

changeset-bot bot commented Jun 18, 2024

⚠️ No Changeset found

Latest commit: d931436

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link

graphite-app bot commented Jun 18, 2024

Your org requires the Graphite merge queue for merging into main

Add the label “merge-queue” to the PR and Graphite will automatically add it to the merge queue when it’s ready to merge. Or use the label “hotfix” to add to the merge queue as a hot fix.

You must have a Graphite account and log in to Graphite in order to use the merge queue. Sign up using this link.

Copy link

codspeed-hq bot commented Jun 18, 2024

CodSpeed Performance Report

Merging #3371 will not alter performance

Comparing feat/walletconnect-add-switch-chains (d931436) with 06-13-fix_wallets_cache_walletconnectclient (9266254)

Summary

✅ 9 untouched benchmarks

Copy link
Contributor

github-actions bot commented Jun 18, 2024

size-limit report 📦

Path Size Loading time (3g) Running time (snapdragon) Total time
thirdweb (esm) 40.65 KB (0%) 814 ms (0%) 5.5 s (+150.1% 🔺) 6.3 s
thirdweb (cjs) 91.92 KB (0%) 1.9 s (0%) 6.4 s (-12.41% 🔽) 8.3 s
thirdweb (minimal + tree-shaking) 4.74 KB (0%) 95 ms (0%) 184 ms (+32.49% 🔺) 279 ms
thirdweb/chains (tree-shaking) 423 B (0%) 10 ms (0%) 321 ms (+132.17% 🔺) 331 ms
thirdweb/react (minimal + tree-shaking) 13.46 KB (0%) 270 ms (0%) 405 ms (-46.57% 🔽) 674 ms

Copy link

codecov bot commented Jun 18, 2024

Codecov Report

Attention: Patch coverage is 76.19048% with 15 lines in your changes missing coverage. Please review.

Project coverage is 62.52%. Comparing base (9266254) to head (d931436).

Additional details and impacted files
@@                               Coverage Diff                               @@
##           06-13-fix_wallets_cache_walletconnectclient    #3371      +/-   ##
===============================================================================
- Coverage                                        62.55%   62.52%   -0.03%     
===============================================================================
  Files                                              870      872       +2     
  Lines                                            64595    64728     +133     
  Branches                                          3479     3487       +8     
===============================================================================
+ Hits                                             40405    40471      +66     
- Misses                                           23510    23577      +67     
  Partials                                           680      680              
Flag Coverage Δ *Carryforward flag
legacy_packages 65.60% <ø> (ø) Carriedforward from 9266254
packages 61.89% <76.19%> (-0.04%) ⬇️

*This pull request uses carry forward flags. Click here to find out more.

Files Coverage Δ
...s/wallet-connect/receiver/request-handlers/sign.ts 100.00% <100.00%> (ø)
...-connect/receiver/request-handlers/switch-chain.ts 100.00% <100.00%> (ø)
...rdweb/src/wallets/wallet-connect/receiver/utils.ts 96.87% <100.00%> (ø)
...wallets/wallet-connect/receiver/session-request.ts 91.22% <61.53%> (-6.15%) ⬇️

... and 4 files with indirect coverage changes

@gregfromstl gregfromstl marked this pull request as ready for review June 18, 2024 04:02
@gregfromstl gregfromstl force-pushed the 06-13-fix_wallets_cache_walletconnectclient branch from fe2c8f4 to 05659fa Compare June 18, 2024 04:58
@gregfromstl gregfromstl requested a review from MananTank as a code owner June 18, 2024 04:58
@gregfromstl gregfromstl force-pushed the feat/walletconnect-add-switch-chains branch from bfd5078 to 5bf7498 Compare June 18, 2024 04:58
@gregfromstl gregfromstl force-pushed the 06-13-fix_wallets_cache_walletconnectclient branch from 05659fa to 142ab64 Compare June 18, 2024 23:57
@gregfromstl gregfromstl force-pushed the feat/walletconnect-add-switch-chains branch from 5bf7498 to 14705ce Compare June 18, 2024 23:57
Copy link

graphite-app bot commented Jun 19, 2024

Merge activity

@gregfromstl gregfromstl force-pushed the 06-13-fix_wallets_cache_walletconnectclient branch from 142ab64 to 1652bbc Compare June 19, 2024 01:08
@gregfromstl gregfromstl force-pushed the feat/walletconnect-add-switch-chains branch from 14705ce to 5213c80 Compare June 19, 2024 01:08
@gregfromstl gregfromstl force-pushed the 06-13-fix_wallets_cache_walletconnectclient branch from 1652bbc to 167819f Compare June 19, 2024 01:13
@gregfromstl gregfromstl force-pushed the feat/walletconnect-add-switch-chains branch from 5213c80 to 65c69b1 Compare June 19, 2024 01:13
…tchEthereumChain (#3371)

<!-- start pr-codex -->

## PR-Codex overview
This PR enhances the WalletConnect functionality by adding support for switching Ethereum chains and adding new chains.

### Detailed summary
- Updated `sign.ts` to include raw message in `account.signMessage`
- Added `checksumAddress` validation in `validateAccountAddress`
- Implemented `handleSwitchChain` for switching Ethereum chains
- Added support for `wallet_addEthereumChain` and `wallet_switchEthereumChain` requests
- Updated types and interfaces for wallet interactions

> ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}`

<!-- end pr-codex -->
@gregfromstl gregfromstl force-pushed the 06-13-fix_wallets_cache_walletconnectclient branch from 167819f to 9266254 Compare June 19, 2024 02:41
@gregfromstl gregfromstl force-pushed the feat/walletconnect-add-switch-chains branch from 65c69b1 to d931436 Compare June 19, 2024 02:41
@gregfromstl gregfromstl changed the base branch from 06-13-fix_wallets_cache_walletconnectclient to main June 19, 2024 02:45
@graphite-app graphite-app bot merged commit d931436 into main Jun 19, 2024
26 of 27 checks passed
@graphite-app graphite-app bot deleted the feat/walletconnect-add-switch-chains branch June 19, 2024 02:46
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.

2 participants