-
Notifications
You must be signed in to change notification settings - Fork 42
fix(keychain): display exact precision for transaction fees (C7E-764) #1707
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
base: main
Are you sure you want to change the base?
Conversation
|
Original prompt from Tarrence:
if (maxFee && maxFee.overall_fee && token.price) {
const formatted = convertTokenAmountToUSD(
maxFee.overall_fee,
18,
token.price,
true, // Enable exact precision for fees
);
setFormattedFee(formatted);
}
This change will ensure that the fee amount displayed to users matches exactly what they'll be charged, eliminating confusion. Once you've made these changes, please:
Thanks for your help! |
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
| maxFee.overall_fee, | ||
| 18, | ||
| token.price, | ||
| true, // Enable exact precision for fees |
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.
I think we want to modify packages/keychain/src/components/starterpack/total-cost.tsx
Fix transaction fee display precision (C7E-764)
Issue
Controller fee estimate rounds numbers (to 2 decimal places) but execution doesn't use the rounded values. For example, users see "$5.13 USDC" but are actually charged "$5.125 USDC".
Changes
exactPrecisionparameter toconvertTokenAmountToUSDfunctionexactPrecisionis trueFeescomponent to use the exact precision parameter for fee displayThis change ensures that the fee amount displayed to users matches exactly what they'll be charged, eliminating confusion.
Testing
Link to Devin run: https://app.devin.ai/sessions/f4b189805d3d45f6ac135aca3ec613ef
Requested by: Tarrence van As ([email protected])