-
Notifications
You must be signed in to change notification settings - Fork 305
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use experimental web3js for homepage data (#256)
This PR is a first effort to start proving out the experimental web3js on Explorer. All data displayed on the homepage is fetched using functions of the experimental web3js. Notes: - Annoyingly this doesn't eliminate the old web3js dependency from the homepage. There's a big tree of providers with various web3.js (and other) dependencies in [the app layout](https://github.com/solana-labs/explorer/blob/master/app/layout.tsx). - The main difference for the functions covered here is using bigint in the new web3js. I've tried to keep processing of bigint as bigint, for example calculating percentages of bigints is done without converting them to numbers. I've mostly left display components as number, for example `<Slot>` is used in many places and is left unchanged, and `<CountUp>` is a 3rd party dependency which expects numbers. - I've added the experimental web3js using an alias `web3js-experimental`. pnpm has an issue where peerDependencies (some libs have web3js as a peer dependency) don't work correctly, [see issue + workaround used here](pnpm/pnpm#6588 (comment)) - We mostly used the exported return types from web3js as our data structures. The experimental web3js doesn't export return types, so I've created minimal types that just contain the fields that we need and then passed these around as needed --------- Co-authored-by: steveluscher <[email protected]>
- Loading branch information
1 parent
411d876
commit 280a929
Showing
12 changed files
with
199 additions
and
98 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
280a929
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
explorer – ./
explorer-git-master-solana-foundation.vercel.app
explorer-solana-foundation.vercel.app
explorer.solana.com