fix(fee-utils): remove hardcoded XLM_PRICE, suppress fabricated USD fee estimate#413
Merged
Austinaminu2 merged 1 commit intoJul 26, 2026
Conversation
…n price unavailable lib/fee-utils.ts used a hardcoded XLM_PRICE = 0.12 constant as the default for calculateFeeBreakdown, which meant estimatedUsd was always emitted — even when no live price was available — using a stale/fabricated value. This made the fee breakdown UI display misleading USD cost information to users. Changes: - Remove the XLM_PRICE = 0.12 constant - Make xlmPrice a true optional param (undefined by default) - Only compute estimatedUsd when a live price is explicitly provided; otherwise return undefined so callers can suppress the USD display Call sites in app/app/stream/[id]/page.tsx and components/streams/create-confirmation.tsx that omit xlmPrice will now correctly receive estimatedUsd: undefined instead of a stale estimate. Closes FlowwStar#289
brightfootlimited-collab
had a problem deploying
to
staging
July 26, 2026 15:52 — with
GitHub Actions
Failure
|
@brightfootlimited-collab Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary Fixes #289 lib/fee-utils.ts had a hardcoded XLM_PRICE = 0.12 constant used as the default value for calculateFeeBreakdown's xlmPrice parameter. This caused estimatedUsd to always be emitted using a stale, made-up price — exactly the fabricated fee data described in the issue. ## Changes - Remove the XLM_PRICE = 0.12 constant - Make xlmPrice a true optional (undefined by default) instead of defaulting to a hardcoded value - Suppress estimatedUsd when no live price is provided (returns undefined), so the UI only shows a USD estimate when a real price is available ## Behaviour after fix | Call site | Before | After | |-----------|--------|-------| | calculateFeeBreakdown(fee) — no price passed | estimatedUsd: 0.000xxx (stale .12/XLM) | estimatedUsd: undefined | | calculateFeeBreakdown(fee, livePrice) | correct | same (unchanged) | Call sites in �pp/app/stream/[id]/page.tsx and components/streams/create-confirmation.tsx that omit xlmPrice will now correctly receive estimatedUsd: undefined and can suppress the USD line in the dialog until a live price is wired up. ## Testing The existing test suite in tests/lib/fee-utils.test.ts already covers this scenario, including a 'does not fabricate per-resource fees' assertion. All tests pass with this change.