Show buy-in amount, fee, gas price, and total deduction in join-table preview - #483
Merged
Marvy247 merged 1 commit intoAug 31, 2026
Merged
Conversation
…-table preview TransactionSimulation already showed a fee estimate via simulateTransaction, but not the buy-in amount, the effective gas price, or the total wallet deduction the issue asked for. - TransactionSimulation.tsx: accepts an optional buyInAmount (stroops) prop; when present, renders a Buy-in Summary section (buy-in amount, network fee, gas price derived from fee/instructions used, and total deduction = buy-in + fee) above the existing generic simulation details - use-transaction-simulation.ts: useJoinTableSimulation now exposes its internal params (tableId, buyIn) so callers can read the in-flight buy-in amount - Table.tsx / page.tsx: pass buyInAmount to the join-table confirmation modal only, not the in-game action confirmation modal Closes HitEmPoka#161
|
@gboigwe 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! 🚀 |
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.
Summary
TransactionSimulationalready estimated the network fee viasimulateTransaction, but the modal never showed the buy-in amount itself, an effective gas price, or the total amount that would actually leave the wallet (buy-in + fee) — exactly what this issue asks for.TransactionSimulation.tsxaccepts an optionalbuyInAmount(stroops) prop. When present, it renders a "Buy-in Summary" section above the existing generic simulation details: buy-in amount, network fee, gas price (derived fromfee / instructions used, both already returned by the existing simulation), and total deduction.useJoinTableSimulationnow exposes its internalparams(tableId,buyIn) so the render site can read the in-flight buy-in amount without new plumbing.Table.tsxandpage.tsxpassbuyInAmountonly to the join-table confirmation modal — the separate in-game action confirmation modal (raise/call/etc.) is untouched, since that's not a buy-in flow.Issue
Closes #161
Notes on interpreting "current XLM/gas price"
Soroban doesn't have a separate market "gas price" the way some other chains do — fees are computed from simulated resource usage against the network's current fee rates, which
simulateTransaction(already used here) reflects automatically. I interpreted "current gas price" as the effective rate the simulation implies (fee ÷ instructions used), shown so the user can see how the fee was derived, rather than adding a new external USD/XLM market-price dependency that nothing in the codebase currently has.Test plan
npx vitest run— 123 passed, same 4 pre-existing failures as onmainbefore this change (audio-controls.test.tsx,reconnect-state.test.ts— unrelated to this work, confirmed viagit stashbefore/after comparison)transaction-simulation-buyin.test.tsx— 4 new tests covering: summary shown/hidden based onbuyInAmountpresence, correct amount/fee/gas-price/total formatting, and no summary when the simulation itself failednpx tsc --noEmit— fixed a real compile error my own change introduced (BigInt literal syntax isn't allowed at this project'sES2017TS target; switched toBigInt(...)calls, matching the existing convention already used elsewhere in this codebase, e.g.page.tsx'sSTROOPS_PER_XLM). All remaining type errors are pre-existing and unrelated (confirmed present before this change too):token-selector.test.tsx,page.tsx:668(tokenChoicetyping),Table.tsx(replayEntry/setReplayEntry),reconnect-state.ts(ArrayBuffertyping) — not touched, since they aren't caused by this change.