-
Notifications
You must be signed in to change notification settings - Fork 557
Refactor: UB widget inputs #7390
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
🦋 Changeset detectedLatest commit: a394384 The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
WalkthroughThis update refactors the handling of token amounts across several components and utilities. The amount prop is now consistently represented as a decimal string (e.g., "1.5") instead of a bigint or raw wei value. Related asynchronous logic for unit conversion and token metadata fetching is removed or simplified, and type definitions are updated accordingly. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant UIComponent
participant BuyWidget/CheckoutWidget/TransactionWidget
participant TokenUtils
User->>UIComponent: Provide buyTokenAmount as decimal string
UIComponent->>BuyWidget/CheckoutWidget: Pass amount (string)
BuyWidget/CheckoutWidget->>BuyWidget/CheckoutWidget: Use amount directly (no conversion)
Note over BuyWidget/CheckoutWidget: No async token metadata fetching
User->>UIComponent: Provide buyTokenAmount as decimal string
UIComponent->>TransactionWidget: Pass amount (string)
TransactionWidget->>TokenUtils: Fetch token decimals (if needed)
TokenUtils-->>TransactionWidget: Return decimals
TransactionWidget->>TransactionWidget: Convert amount string to wei using decimals
TransactionWidget->>TransactionWidget: Prepare transaction with computed value
Possibly related PRs
Warning Review ran into problems🔥 ProblemsErrors were encountered while retrieving linked issues. Errors (1)
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (3)
🚧 Files skipped from review as they are similar to previous changes (3)
⏰ Context from checks skipped due to timeout of 90000ms (8)
✨ Finishing Touches
🪧 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 (
|
How to use the Graphite Merge QueueAdd either label to this PR to merge it via the merge queue:
You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has enabled the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. |
size-limit report 📦
|
2b87c29
to
74550bf
Compare
PR-Codex overview
This PR focuses on updating the
BuyWidget
and related components to use decimal strings for amounts instead of big integers, enhancing usability and consistency across the application.Detailed summary
buyTokenAddress
to optional intypes.ts
.amount
fields in various components to accept decimal strings.toUnits
conversions in favor of direct string usage for amounts.Summary by CodeRabbit