-
Notifications
You must be signed in to change notification settings - Fork 525
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: Secondary Token Balances #1679
Conversation
…ximized account center layout, still need docs updates for secondary tokens
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
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.
looks great- love this feature! Was able to test on demo and view my DAI token balance when I connected my metamask wallet.
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.
Looks good. One question, if an icon is not passed in for a token does it just render a blank space? Maybe we should have a default token icon?
Currently we just render a blank space per the designs but I had originally had a question mark icon which could be a little confusing for the end user. Any other ideas @gesquinca? Discussed further with @gesquinca and went with removing the black space when an icon isnt passed. Here is the updated view. |
* Release 2.21.3 (develop) (#1656) * Bump docs packages * Update package versions for release * Remove optional chain in trezor * add safeheron to injected package readme * add wallet as value to translate function in more areas of connect * package updates * add images * text update * Update packages/react/package.json Co-authored-by: Adam Carpenter <adamcarpenter86@gmail.com> * Update packages/vue/package.json Co-authored-by: Adam Carpenter <adamcarpenter86@gmail.com> * add screenshots to top level assets folder * update react pkg * fix merge conflict in react pkg * fix vue pkg --------- Co-authored-by: Kat Leight <leightkt@gmail.com> Co-authored-by: Kat Leight <33187102+leightkt@users.noreply.github.com> * Update react hooks docs re usage of apiKey (#1668) * update supported networks svg * fix indentation * FEATURE: Add cede.store wallet package (#1667) * FEATURE: Add cede.store wallet package * Formatting and add to docs site * DOCS: Add cede.store detailed documentation with an example flow * Update formatting - looks good! --------- Co-authored-by: Adam Carpenter <adamcarpenter86@gmail.com> * Release 2.21.4 (develop) (#1671) * Update cede and WC docs (#1681) * add webpack-dev-server to dependencies (#1680) * Feat: Secondary Token Balances (#1679) * RPC working from hackathon * Working as expected for setting balances in state, no rendering yet * Display but need to be abstracted and cleaned * Added layout and styling for secondary tokens along with rework of maximized account center layout, still need docs updates for secondary tokens * Fix compiler err * Add docks for secondaryTokens and screenshots to readme and docs of AC * Fix versioning of common * Bump common * Bump all versions required * Prettify common validation * Fix: Walletconnet - wallet switching chains and handling int and hex chainIds (#1682) * Wallet switching chains now working properly and setting required chains to the config chains in w3o * Fix web3auth ci build * Update HeroSection.svelte (#1685) update title from web3-onboard to Web3 Onboard. When not referencing code we should stick to no dash * Update the core version within vue and react projects (#1686) * Playwright (#1609) * change scripts loaded for dev server, fix walletConnect, update webpack config, fix accounts error on no wallet connection (#1689) * Update FeaturesSection.svelte (#1684) * Update title Web3-Onboard to Web3 Onboard When not referencing the code, we should always use Web3 Onboard. When referencing code, we use web3-onboard. * Update FeaturesSection.svelte Update FeaturesSection to include the core package size minified. * Update docs/src/lib/components/HeroSection.svelte --------- Co-authored-by: Adam Carpenter <adamcarpenter86@gmail.com> * Fix: Secondary Token Symbol fetch and docs (#1690) * Fixing * Update SecondaryToken type * Add max of 5 tokens to secondaryTokens, add error handling in html, add docs update * Bump all package versions * Revert node version changes for web3auth * Remove cede from wallets group * Remove merge conflict in yarn.lock * Update packages/cede-store/README.md * Fix image path in docs * Update Account Center example with a better shot * Spelling & web3 onboard cohesion update (#1694) updating some spelling and web3 onboard referneces * Update account center shot to show multiple wallets connected * Update account center shot to show multiple wallets connected --------- Co-authored-by: Kat Leight <leightkt@gmail.com> Co-authored-by: Kat Leight <33187102+leightkt@users.noreply.github.com> Co-authored-by: Gustavo Esquinca <g.esq.ca@gmail.com> Co-authored-by: Nikita TEREKHOV <57397713+neeeekitos@users.noreply.github.com> Co-authored-by: Laurence <53497147+laurencedelisle@users.noreply.github.com>
* RPC working from hackathon * Working as expected for setting balances in state, no rendering yet * Display but need to be abstracted and cleaned * Added layout and styling for secondary tokens along with rework of maximized account center layout, still need docs updates for secondary tokens * Fix compiler err * Add docks for secondaryTokens and screenshots to readme and docs of AC * Fix versioning of common * Bump common * Bump all versions required * Prettify common validation
@@ -339,6 +340,19 @@ | |||
}) | |||
}) | |||
} | |||
if ( | |||
!secondaryTokens && | |||
Array.isArray(appChain.secondaryTokens) && |
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.
it's possible that appChain will be "undefined" if the chain selected in user's wallet doesn't exist in the config. This leads to an error:
Cannot read properties of undefined (reading 'secondaryTokens')
:(
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.
@pavelivanov we have a patch coming out for this shortly - apologies for any inconvenience
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.
we have a patch coming out for this shortly - apologies for any inconvenience
is this patch available?
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.
There is a fix for this on @web3-onboard/core v2.19.0-alpha.1 and an official release will be out shortly.
Description
This PR adds the ability to pass in an array of
secondaryTokens
per chain object within the W3O init and have those balances pulled from the associated chain RPC and be available within the wallet accounts object to the DAPP and displayed within Account Center.This PR also includes a refactor/styling of Account Center to match the latest designs and handle display depending on the appMetaData, secondary tokens, etc passed in on init
Checklist
package.json
of the package you have made changes in following semantic versioning and using alpha release taggingyarn check-all
to confirm there are not any associated errors