Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Context
Currently UI needs to wait for token arrival at router address, then call relayer
route
. But there are many scenarios that breaks the process, and the fund is stuck at the router address.To solve this issue, we can upgrade the relayer to be able to "wait and route", so the whole process is more robust. Now UI only needs to send one request to the relayer right after user signed xcm tx, and don't need to worry about user closing UI in the middle anymore.
This will also enhance UX by displaying a progress bar:
xcm (waiting) => routing => confirming => complete
Change
api/route.ts
to specific files to be more clean/routeHomaAuto
: wait for token arrive then auto perform the route, returns a route Id so frontend can use this to track and display progress./routeStatus
: get current route status/allRouteStatus
: see all route status, mostly for debugging purposeNote that we don't need to permanently store route status, as it's only for frontend to track progress and display progress bar. For a complete route history, we can add new endpoint with subquery in the future
Test