-
Notifications
You must be signed in to change notification settings - Fork 146
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: alex swaps integration #4349
Conversation
2b4da38
to
3379335
Compare
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.
This is coming together well @fbwoolf, great work.
Fairly thorough review but think it's important we get this right, as this is hopefully the base form which we'll add others.
Some other considerations: Ledger Market data updates Automated Tests
Loading swap data 2023-10-13-000014.mp4Happy to help figure out ways to implement this, these are similar problems I've faced working on an exchange in the past. The trading form we had was by far the largest, most complex part of the codebase, and this is what we're doing here. |
I think we can disable for Ledger and do as an enhancement issue? cc @markmhendrickson
I think this should be a wallet enhancement issue bc the market data implementation for the send form needs to also consider this, and it needs to be looked at again? cc @markmhendrickson I wasn't able to reuse it here, and currently no sip10 tokens are even using fiat conversions in the send form.
Yep, will try to add integration tests here.
Not understanding what you mean here?
Tbh, I don't see a real problem in the video? I would have to better understand how the design team would want to handle this, right? I think this could be an enhancement issue? cc @markmhendrickson |
Thx @alter-eggo for just making change commits here. I see now the best way to handle those changes. 👍 |
That the selected assets should be reflected in the routes, such as with the example provided.
Sorry maybe I didn't explain well. But notice how when I type the 3 values changes, you can see the updates coming in sequentially. This highlights a race condition, that represents a serious bug. Let's say of those 3 requests to check the price:
What happens in the form here? I'm pretty sure that despite 0.3 being the last value typed, because the 0.1 value resolves last, we update the field with an incorrect value. This is a common async mistake. We need to debounce it in such a way that only the most recently response is used, and old values are discarded. In your testing, you'll likely never encounter this, as the requests generally do take the same amount of time so will be returned in correct order, but we can't make that assumption. To test this, you can create a fake HTTP call that returns values at different times. Unless I'm mistaken this is race condition bug serious enough such that we shouldn't merge this PR until fixed. |
@fbwoolf thanks for working on this again. Looking nice In relation to this component, here is what could improve BUTTON TOKEN Designs
|
I think I should add a |
Thx for letting me know about the dark mode bug. I will fix it. I saw the |
cc @mica000 ? |
I think I broke this, thx, I will fix. 👍 |
Updating my comment about Tooltips: Transaction fee Liquidity provider: |
This might be a random nonce issue bc using |
Looks like it was pointed out from @314159265359879 that I missed using the token decimals here, which should help this, but will check alignment too. |
For the record here, the language will be |
Should the label be changed here, isn't the past-tense |
2650c5c
to
bd3aadc
Compare
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.
This an improvement as indeed this removes the race condition, and the loader communicates something's happening. I feel users may expect to see how much they're going to get before blurring though, this is how it works on Rainbow.
Another solution that I think might be worth having a look at is debouncing the input and cancelling the previous action when there's a new input. This can come later if urgent to release.
Lastly, curious why we're not using yup for form validation as elsewhere? There's lots of manual error setting/resetting everywhere setError({})
etc
bg: 'brown.6', | ||
}, | ||
bg: 'brown.6', | ||
color: 'white', |
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.
should use a token
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.
Confused a bit by our setup for colors, what is the right token to use here? I was following the other button receipe colors using brown.6
, but I don't see what white would be?
Ok, ShapeShift does it onBlur in their swaps so felt it was a good path.
Happy to try this or follow up with it after first release. We can all talk abt it in mtg today.
Yup is being used here. I validate on mount to disable the button, which was requested in qa review. Then I have to handle some things with errors later, but is that wrong? Those methods exist for a reason from yup? |
Could be wrong but, afaik, you can either do validation with formik via their own methods, e.g. |
Yeah, not sure here about if only one method is supposed to be used, is that in the docs somewhere? I can def try to rework it so only using one method, but will just take some time. |
f495763
to
e3f8ee2
Compare
@kyranjamie any thoughts on the failing tests here? I rebased on dev and now can't get past these errors ...failing on chrome being undefined? I've cleaned my local > reinstalled yarn.lock and node_modules ...made sure I'm using node 18.18.0. 🤔 |
Looked into this today, I am only using |
5f6c51f
to
bbfea9c
Compare
954e257
to
6c6eca4
Compare
New PR for alex swap integration with all qa and design changes after the first version was tested here: #4205
This PR includes broadcasting the swap if we detect a tx is already pending and alex-sdk would not sponsor the swap tx.
Submitted swap goes directly to activity tab to see pending tx...