Skip to content
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

fix: lifi final quote failures #8430

Merged
merged 3 commits into from
Dec 20, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,12 @@ export async function getTrade({
const routesResponse = await getRoutes(routesRequest)
.then(response => Ok(response))
.catch((e: SDKError) => {
// This shouldn't happen, but if it does (`/routes`) endpoint errors), Li.Fi probably went "down" for that specific request
// We should use the stale rate quote, though if it's a proper limit, `/stepTransaction` would fail too, meaning things will still fail at Tx execution time
// Which is much better than a blank screen
if (quoteOrRate === 'quote') return Ok({ routes: [] })

// This is a rate. All errors re: validation or internal server errors etc should be handled gracefully
const code = (() => {
switch (e.code) {
case LiFiErrorCode.ValidationError:
Expand Down