Skip to content

feat(send): dynamically estimate and disclose network fee based on network stats (#458) - #582

Merged
Nanafancy merged 1 commit into
Ignition-World:mainfrom
xtep103:feat/dynamic-network-fee-458
Aug 31, 2026
Merged

feat(send): dynamically estimate and disclose network fee based on network stats (#458)#582
Nanafancy merged 1 commit into
Ignition-World:mainfrom
xtep103:feat/dynamic-network-fee-458

Conversation

@xtep103

@xtep103 xtep103 commented Aug 29, 2026

Copy link
Copy Markdown
Contributor

Overview

Replaces the hardcoded 0.00001 XLM network fee with dynamic fee estimation based on real-time Stellar network conditions (via Horizon /fee_stats) and transaction complexity (operation count).

Related Issue

Closes #458

Changes

Send Feature & Fee Estimation

  • [ADD] ignition-pay-frontend/features/send/services/fee.ts
    • Added fetchNetworkFeeStats to query /fee_stats from Horizon with graceful fallback to standard 100 stroops (0.00001 XLM) on network/server error or timeout.
    • Added estimateTransactionFee to compute dynamic fees by combining network fee stats with transaction complexity (operation count).
  • [MODIFY] ignition-pay-frontend/features/send/models/index.ts
    • Added calculateTransactionFee, BASE_FEE_STROOPS, STROOPS_PER_XLM, DEFAULT_NETWORK_FEE_XLM, and NetworkFeeEstimate interface.
    • Updated spendableBalance and validateAmount to accept dynamic custom fee parameters for native XLM transactions.
  • [MODIFY] ignition-pay-frontend/features/send/services/index.ts
    • Re-exported fee estimation methods and types.
  • [MODIFY] ignition-pay-frontend/features/send/widgets/SendPage.tsx
    • Integrated dynamic fee estimation in the review step and confirmation step, replacing the hardcoded 0.00001 XLM.
    • Added estimation loading state with spinner in the review summary.
    • Updated max spendable balance calculation to account for dynamic network fee.
  • [MODIFY] ignition-pay-frontend/components/transaction-row.tsx
    • Cleaned up unused hardcoded fee and resolved optimistic transaction ID property handling.
  • [ADD] ignition-pay-frontend/tests/send-fee.test.ts
    • Added unit tests for calculateTransactionFee, fetchNetworkFeeStats, and estimateTransactionFee.
  • [MODIFY] ignition-pay-frontend/tests/send-models.test.ts
    • Added test cases for dynamic fee handling in spendableBalance and validateAmount.
  • [ADD] ignition-pay-frontend/tests/send-page-fee.test.tsx
    • Added component test verifying dynamic network fee retrieval and display in SendPage review step.

Verification Results

✓ tests/strkey.test.ts (12 tests)
✓ tests/send-models.test.ts (12 tests)
✓ tests/memo.test.ts (9 tests)
✓ tests/send-fee.test.ts (10 tests)
✓ tests/send-trustline.test.ts (6 tests)
✓ tests/asset-card.test.tsx (6 tests)
✓ tests/send-page-fee.test.tsx (2 tests)
✓ tests/api-keys-section.test.tsx (3 tests)
✓ tests/send-page-paste.test.tsx (7 tests)
✓ tests/dashboard-models.test.ts (8 tests)
✓ tests/accessibility.test.tsx (1 test)

Test Files  11 passed (11)
Tests       76 passed (76)
Acceptance Criteria Status
Network fee is dynamically estimated from Horizon /fee_stats ✅ Handled with fallback to 100 stroops (0.00001 XLM)
Transaction complexity (operation count) scales fee calculation ✅ Computed via calculateTransactionFee
Review step shows dynamic fee instead of hardcoded 0.00001 XLM ✅ Integrated in SendPage review and confirmed screens
Spendable balance respects dynamic network fee allowance ✅ Updated in spendableBalance and validateAmount
Comprehensive unit and integration tests ✅ 37 send/fee tests and 76 total frontend tests passing

@drips-wave

drips-wave Bot commented Aug 29, 2026

Copy link
Copy Markdown

@xtep103 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

@Nanafancy
Nanafancy merged commit cb32824 into Ignition-World:main Aug 31, 2026
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.

Network fee is hardcoded to 0.00001 XLM

2 participants