Skip to content

fix(fee-utils): remove hardcoded XLM_PRICE, suppress fabricated USD fee estimate#413

Merged
Austinaminu2 merged 1 commit into
FlowwStar:mainfrom
brightfootlimited-collab:fix/issue-289-remove-fake-fee-breakdown
Jul 26, 2026
Merged

fix(fee-utils): remove hardcoded XLM_PRICE, suppress fabricated USD fee estimate#413
Austinaminu2 merged 1 commit into
FlowwStar:mainfrom
brightfootlimited-collab:fix/issue-289-remove-fake-fee-breakdown

Conversation

@brightfootlimited-collab

Copy link
Copy Markdown
Contributor

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.

…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
@drips-wave

drips-wave Bot commented Jul 26, 2026

Copy link
Copy Markdown

@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! 🚀

Learn more about application limits

@Austinaminu2
Austinaminu2 merged commit 2c78508 into FlowwStar:main Jul 26, 2026
0 of 6 checks passed
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.

bug: fee breakdown CPU/memory/storage percentages are fabricated, not derived from RPC simulation

2 participants