-
Notifications
You must be signed in to change notification settings - Fork 13
hot-fix: skip coral route fetching for add-money flow and use default squid route fetching #1016
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
Conversation
…id route fetching
## Walkthrough
This change refines the payment flow logic by introducing a `disableCoral` flag to conditionally control route preparation for cross-chain payments, particularly distinguishing Peanut wallet, external wallet, and add money flows. It updates error handling, timer display, and environment variable usage for Squid integrator configuration, and clarifies payer address handling in payment initiator logic.
## Changes
| Files/Paths | Change Summary |
|---------------------------------------------|------------------------------------------------------------------------------------------------------------------|
| src/components/Payment/Views/Confirm.payment.view.tsx | Enhanced route preparation and error handling for wallet/payment flow types; updated timer display conditions; temporarily disabled inaccurate gas fee display. |
| src/constants/general.consts.ts | Added `DEFAULT_SQUID_INTEGRATOR_ID` constant; changed source for `SQUID_API_URL` environment variable; removed `baseSepolia` import. |
| src/hooks/usePaymentInitiator.ts | Extended `prepareTransactionDetails` to accept `disableCoral`; clarified payer address handling in payment creation; updated dependencies. |
| src/services/swap.ts | Introduced `RouteOptions` type with `disableCoral`; updated route fetching logic to support disabling Coral routes; propagated option through related functions. |
## Estimated code review effort
🎯 3 (Moderate) | ⏱️ ~15–25 minutes
## Suggested reviewers
- jjramirezn
- Hugo0 Note ⚡️ Unit Test Generation is now available in beta!Learn more here, or try it out under "Finishing Touches" below. 📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
✨ Finishing Touches
🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
chainId: fromChainId, | ||
}, | ||
usdAmount, | ||
disableCoral: isAddMoneyFlow && isUsingExternalWallet, |
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.
nice
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.
why not just isUsingExternalWallet? that should be sufficient for knowing we dont want expiry
btw: this are good names and its very easy to reason about!
|
||
export const SQUID_INTEGRATOR_ID = process.env.SQUID_INTEGRATOR_ID! | ||
export const SQUID_API_URL = process.env.SQUID_API_URL | ||
export const DEFAULT_SQUID_INTEGRATOR_ID = |
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.
bit sketch?
src/hooks/usePaymentInitiator.ts
Outdated
chainId: sourceChainId.toString(), | ||
hash: txHash, | ||
tokenAddress: selectedTokenData?.address || chargeDetails.tokenAddress, | ||
payerAddress: wagmiAddress ?? '', |
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.
issue, blocking: this is from a different PR!! what happened here? in production we dont have the payeraddress change live in api right? this will break
Deployment failed with the following error:
|
fixes TASK-13364