Repository navigation
Bid a fee from fee stats instead of BASE_FEE in JavaScript examples - #3107
Merged
Merged
Conversation
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.
Contributor
|
Preview deployment for your docs. Learn more about Mintlify Previews.
|
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 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. |
This was referenced Nov 11, 2026
ElliotFriend
approved these changes
Nov 11, 2026
This branch was successfully deployed
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.
🤖 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
BASE_FEE(or a hardcoded100). They take the 90th percentile from fee stats and cap it atMAX_FEE(100,000 stroops), the same pattern as docs: stop teaching BASE_FEE as a transaction fee js-stellar-sdk#1891.server.getFeeStats():sorobanInclusionFeefor Soroban transactions,inclusionFeefor classic ones. Horizon examples useserver.feeStats()andfee_charged.@stellar/stellar-sdk16.4.1 and 17.4.0 (rpc/api.d.ts,horizon/horizon_api.d.ts).p90is a string, so the code wraps it inNumber().Kept on purpose
BASE_FEE, because the fee account pays. The fee-bump fee now comes from fee stats.fetchBaseFee()comment with that fact.fee: "1": a facilitator workaround with its own comment.SorobanClientlibrary, a separate rewrite.Small fixes in blocks this PR edits
SERVERwas undefined, and the second block redeclaredaccount,transactionandresp.sdk.Server(...)is nownew StellarSdk.Horizon.Server(...).networkPassPhrasetypo.stellar keys showdoes not exist. It isstellar keys secret.Notes
checksjob is the format and build check.const status, undefinedreturnContractResponse) and error-handling.mdx (it calls a contract with no simulation).