Skip to content

fix(fee-utils): support xlmPrice in calculateBatchFees for USD estimation (closes #1034) - #1069

Open
jdjioe5-cpu wants to merge 1 commit into
FlowwStar:mainfrom
jdjioe5-cpu:fix/issue-1034-batch-fees-usd-estimate
Open

jdjioe5-cpu wants to merge 1 commit into
FlowwStar:mainfrom
jdjioe5-cpu:fix/issue-1034-batch-fees-usd-estimate

Conversation

@jdjioe5-cpu

Copy link
Copy Markdown
Contributor

Summary

Closes #1034

This PR resolves issue #1034 where calculateBatchFees did not accept an xlmPrice parameter, preventing callers from receiving a USD estimation (estimatedUsd).

Changes

  • lib/fee-utils.ts:
    • Added optional xlmPrice?: number parameter to calculateBatchFees(operationCount, feePerOperation, xlmPrice?: number).
    • Forwarded xlmPrice to calculateFeeBreakdown(totalFee, xlmPrice).
  • __tests__/lib/fee-utils.test.ts:
    • Added test case verifying estimatedUsd is omitted when xlmPrice is omitted.
    • Added test case verifying estimatedUsd is correctly calculated when xlmPrice is provided.

Verification

  • All 16 unit tests in __tests__/lib/fee-utils.test.ts pass (npx vitest run fee-utils).
  • Cleanly mergeable with upstream main.

This branch had an error being deployed

1 failed deployment
staging — 2fd2334f Deployed Oct 24, 2026 by jdjioe5-cpu via deploy-staging #362
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.

calculateBatchFees() can never return a USD estimate

1 participant