Repository navigation
feat(tron): add getMaxSendableAmount client request method - #555
Draft
ulissesferreira wants to merge 2 commits into
Draft
ulissesferreira wants to merge 2 commits into
ulissesferreira wants to merge 2 commits into
Conversation
ulissesferreira
force-pushed
the
WPN-2374-get-max-sendable-amount
branch
from
November 4, 2026 16:52
9c04a39 to
96c6a10
Compare
2 tasks done
getMaxSendableAmount client request method
ulissesferreira
force-pushed
the
WPN-2375-estimate-fees-conservatively-in-onamountinput
branch
3 times, most recently
from
November 5, 2026 11:23
d2514de to
d8db631
Compare
ulissesferreira
force-pushed
the
WPN-2375-estimate-fees-conservatively-in-onamountinput
branch
from
November 5, 2026 12:52
d8db631 to
c5c45f8
Compare
Computes the maximum safe amount that can be sent for TRX and TRC-20 assets, with its fee quote. The sent asset and the account resources are read fresh, so the result never acts on stale balances. For native TRX sends the maximum leaves enough TRX to cover the network fees and the account activation; for TRC-20 sends the account must hold enough TRX to cover the transfer fee. When the destination is omitted, the conservative case is assumed and the quoted fees include a conservative account activation reserve. WPN-2374
ulissesferreira
force-pushed
the
WPN-2374-get-max-sendable-amount
branch
from
November 5, 2026 15:58
96c6a10 to
5865cae
Compare
|
ulissesferreira
force-pushed
the
WPN-2375-estimate-fees-conservatively-in-onamountinput
branch
4 times, most recently
from
November 6, 2026 12:50
476d65f to
5366887
Compare
This branch has not been 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.



Explanation
Adds the
getMaxSendableAmountclient request method to the Tron Snap. It returns only{ amount }: the maximum amount that can be entered soonAmountInputpasses, or0when no amount can pass. Fees, balances, and validation errors are intentionally not returned.The value is derived from the same balance source (
getAccountAssetsByIDs), fee limit, and fee/reserve helpers asonAmountInput, without a brute-force search. Native TRX subtracts the network fee and, whentoAddressis omitted, the account activation reserve. TRC-20 returns the full token balance when TRX covers the transfer fee, otherwise0.References
Ticket: WPN-2374
Stacked on: #554
Checklist