Skip to content

Bid a fee from fee stats instead of BASE_FEE in JavaScript examples - #3107

Merged
ElliotFriend merged 1 commit into
mainfrom
docs-agent/3106-fee-stats-examples
Nov 11, 2026
Merged

ElliotFriend merged 1 commit into
mainfrom
docs-agent/3106-fee-stats-examples

Conversation

@stellar-doxie

@stellar-doxie stellar-doxie Bot commented Nov 11, 2026

Copy link
Copy Markdown
Contributor

🤖 Automated message from the Stellar Triage Bot.

Refs #3106

Working this because @oceans404 asked with /triage. This PR fixes the JavaScript examples. The Python, Go and Java tabs wait for a maintainer decision on the issue.

What changed

  • JavaScript examples no longer bid BASE_FEE (or a hardcoded 100). They take the 90th percentile from fee stats and cap it at MAX_FEE (100,000 stroops), the same pattern as docs: stop teaching BASE_FEE as a transaction fee js-stellar-sdk#1891.
  • RPC examples use server.getFeeStats(): sorobanInclusionFee for Soroban transactions, inclusionFee for classic ones. Horizon examples use server.feeStats() and fee_charged.
  • Prose next to changed code now matches it (frontend-guide.mdx, deploy-sac-with-code.mdx).
  • I checked the field names in @stellar/stellar-sdk 16.4.1 and 17.4.0 (rpc/api.d.ts, horizon/horizon_api.d.ts). p90 is a string, so the code wraps it in Number().

Kept on purpose

  • fee-bump-transactions.mdx: the inner transaction keeps BASE_FEE, because the fee account pays. The fee-bump fee now comes from fee stats.
  • openzeppelin-relayer.mdx: Channels fee-bumps the signed transaction and pays the fee. I replaced the misleading fetchBaseFee() comment with that fact.
  • simulateTransaction-Deep-Dive.mdx: the transaction is only simulated, so a comment now says the fee does not matter there.
  • guestbook/setup-passkeys.mdx: the page mirrors the companion app, so it changes with the app.
  • x402 quickstart fee: "1": a facilitator workaround with its own comment.
  • react.mdx: it uses the old SorobanClient library, a separate rewrite.

Small fixes in blocks this PR edits

  • path-payments.mdx: SERVER was undefined, and the second block redeclared account, transaction and resp.
  • error-handling.mdx: sdk.Server(...) is now new StellarSdk.Horizon.Server(...).
  • automate-reset-data.mdx: the networkPassPhrase typo.
  • x402 quickstart: stellar keys show does not exist. It is stellar keys secret.

Notes

BASE_FEE is the network minimum, so a transaction that bids only that gets outbid when the network is busy. The JavaScript examples now take the 90th percentile from getFeeStats() (RPC) or feeStats() (Horizon) and cap it, the same pattern as stellar/js-stellar-sdk#1891. Soroban examples use sorobanInclusionFee, classic examples use inclusionFee.
@mintlify

mintlify Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated
stellar-docs 🟢 Ready View Preview Nov 11, 2026, 1:14 AM

@stellar-doxie

stellar-doxie Bot commented Nov 11, 2026

Copy link
Copy Markdown
Contributor Author

🤖 Automated message from the Stellar Triage Bot.

Reviewing because this is my PR for #3106, which @oceans404 asked for with /triage.

Verified: the fee-stats fields match @stellar/stellar-sdk 17.4.0 and the live testnet RPC and Horizon. All 34 pages render on the preview, and checks is green. Ready to merge.

The Python, Go and Java question waits on #3106 and does not block this PR. stellar/js-stellar-sdk#1891 is still open. If its pattern changes, this PR should follow it.

@ElliotFriend
ElliotFriend merged commit b58c405 into main Nov 11, 2026
8 checks passed
@ElliotFriend
ElliotFriend deleted the docs-agent/3106-fee-stats-examples branch November 11, 2026 20:06

This branch was successfully deployed

1 active deployment
staging — d54ac942 Deployed Nov 11, 2026 by mintlify[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bot:ready-to-merge Bot verified and approved; waiting for a maintainer to merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant