-
Notifications
You must be signed in to change notification settings - Fork 20
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: add mu03 support #99
Conversation
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.
some questions. also, wondering how compatible this would be with the recent changes I made to swapForm
|
||
return tokensForChain | ||
? Object.entries(tokensForChain) | ||
.filter(([, tokenAddress]) => tokenAddress !== '') // Allows incomplete 'TokenAddresses' list i.e When tokens are not on all chains |
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 should probably not allow incomplete tokenAddresses right
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.
tokenAddresses (the token list which is used to populate the UI) isn't incomplete. The TokenAddress token to chain map above is incomplete (as there's no EUROC on main net). This is what allows us to move forward and add tokens for a chain without requiring it on all chains
There may be some conflict in the submit button, but I've updated the onClick assignment logic to make it easy to add your additional logic as I think this may be merged first so we can use the UI for MU03 testing |
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.
Let's refactor to use the SDK method getTradeablePairs to avoid hardcoding these things
I agree, but this change will require a bit more time. We can merge this and I'll create another issue for full SDK integration. |
Description
This PR adds support for MU03 changes, it also lays the groundwork to make future stable additions more scaleable. The main changes are:
The deployed preview for this branch can be viewed here
Other changes
Token outputs are now limited to valid options, only showing users valid options. When a token is selected only the list of token which are valid to swap are shown instead of showing invalid options and programatically changing their selections.
I noticed unwanted behaviour when connected to a non Celo network, so I added non Celo network detection as part of logic which handles enabling and disabling of swap button.
Tested
I performed the regression tests to confirm core functionality still works
I also selected selected each token as input to ensured only swappable outputs were displayed
Related issues
Checklist before requesting a review