Closed bigboydiamonds closed 2 weeks ago
The changes introduce a nativeCurrency
field to the chain objects in chains.ts
, specifying the name, symbol, and decimals for the native currencies of various blockchain networks. The Chain
interface in index.d.ts
is updated to include this new field. Additionally, switchNetwork.ts
imports CHAINS_BY_ID
to utilize the new nativeCurrency
details when switching networks.
Files/Paths | Change Summary |
---|---|
packages/widget/src/constants/chains.ts |
Added nativeCurrency details (name, symbol, decimals) to multiple chain objects. |
packages/widget/src/types/index.d.ts |
Added nativeCurrency field (name, symbol, decimals) to the Chain interface. |
packages/widget/src/utils/actions/switchNetwork.ts |
Imported CHAINS_BY_ID and utilized new nativeCurrency info in switchNetwork function. |
sequenceDiagram
participant User
participant Widget
participant Provider
User ->> Widget: Switch Network
Widget ->> CHAINS_BY_ID: Get chain by ID
CHAINS_BY_ID ->> Widget: Return Chain Object
Widget ->> Provider: wallet_addEthereumChain with nativeCurrency
Provider ->> Widget: Confirm Network Switch
Widget ->> User: Network Switched
In a land where currencies gleam,
Chains now hold a native dream.
ETH, BNB, and MATIC too,
Switch networks with ease, anew.
With details fine, and symbols bright,
The widget dances in the light.
🐇✨
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
Latest commit: |
84eaf76
|
Status: | ✅ Deploy successful! |
Preview URL: | https://eaa4eda7.sanguine-fe.pages.dev |
Branch Preview URL: | https://widget-add-unrecognized-netw.sanguine-fe.pages.dev |
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 25.67477%. Comparing base (
9779cda
) to head (84eaf76
). Report is 3 commits behind head on master.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Summary by CodeRabbit
New Features
Enhancements
These changes improve clarity and usability for end-users interacting with various blockchain networks within the app.