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 zero quote api error message #369

Merged
merged 2 commits into from
Nov 12, 2024
Merged
Show file tree
Hide file tree
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
5 changes: 5 additions & 0 deletions .changeset/clean-snakes-speak.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@reservoir0x/relay-kit-ui': patch
---

Fix zero quote api error message
4 changes: 3 additions & 1 deletion packages/ui/src/components/widgets/WidgetErrorWell.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@ export const WidgetErrorWell: FC<Props> = ({
const isSmallDevice = useMediaQuery('(max-width: 600px)')
const fetchQuoteErrorMessage = error
? error?.response?.data?.message
? (error?.response?.data.message as string)
? error?.response?.data.message === 'processing response error'
? 'Amount is higher than the available liquidity.'
: (error?.response?.data.message as string)
: 'Unknown Error'
: null
const isHighPriceImpact = Number(quote?.details?.totalImpact?.percent) < -3.5
Expand Down