Skip to content

handle the response when quote exceeds the pool size #661

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

Open
wants to merge 2 commits into
base: staging
Choose a base branch
from

Conversation

Sharqiewicz
Copy link
Member

@Sharqiewicz Sharqiewicz commented May 22, 2025

Update the output to visually and textually show that the quote is loaded, even if an error message about exceeding the pool size is returned.

Copy link

netlify bot commented May 22, 2025

Deploy Preview for pendulum-pay ready!

Name Link
🔨 Latest commit 9b79caa
🔍 Latest deploy log https://app.netlify.com/projects/pendulum-pay/deploys/68301e257a8cd80008a751c6
😎 Deploy Preview https://deploy-preview-661--pendulum-pay.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@Sharqiewicz Sharqiewicz requested review from a team and Copilot May 22, 2025 11:58
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR refactors several UI components to improve their handling of loading states and cleans up unused code. Key changes include the removal of an unused import in the ramp hook, conditional class adjustments in the AssetButton component, and the introduction of a loading prop in the NumericInput and AssetNumericInput components.

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
frontend/src/hooks/offramp/useSubmitRamp.ts Removed an unused constant import and fixed a trailing comma
frontend/src/components/buttons/AssetButton/index.tsx Refactored className handling using a helper for conditional classes
frontend/src/components/NumericInput/index.tsx Added a new loading prop with updated conditional rendering for spinner
frontend/src/components/AssetNumericInput/index.tsx Passed loading prop down to NumericInput and updated prop references
Comments suppressed due to low confidence (1)

frontend/src/components/buttons/AssetButton/index.tsx:16

  • Consider adding an accessible label (e.g., 'aria-label') to the button element in AssetButton to improve screen reader support.
      <button

Copy link
Member

@ebma ebma left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should still allow changing the asset when the quote does not load. It could be that for a different output asset, we can get a quote. Otherwise the user would first have to edit their input amount which could be confusing again.

We could also consider adding an error message.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Handle /quotes 500 error when the input amount exceeds the swap-pool reserves
2 participants