web
web copied to clipboard
Consistent handling of Tx fees/minimum amounts
Overview
Currently, handling Tx fees and minimum amounts across the app is either inconsistent, or not implemented at all.
We should implement a consistent way to handle:
- minimum amounts to send/stake
- depending on to the asset precision
- depending on the account's balance
- max possible amounts to send/stake, including deducted gas fees
This way, we will be able to have guarantees in validating send/staking forms and never product an invalid Tx/ (from e.g percentages) or allow to continue with user input that would result in a failing Tx.
References and additional details
This is taking over #1703 in a systematic, specced way vs. just tackling it for Cosmos.
Acceptance Criteria
- Minimum amounts are handled across all send and staking modals
- Max sends are working across all send and staking modals, and do not produce errors on max sends because of the lack of network fees subtraction
- When the resulting amount is effectively negative, it is zero'd out
Need By Date
No response
Screenshots/Mockups
No response
Estimated effort
No response
Blocked by DeFi UI PR https://github.com/shapeshift/web/issues/2219 We could start work on this after the aforementioned PR is merged
With #2219 merged, I'm removing the blocked and low priority tags and recommend prioritizing this. Cosmos staking is one of our strongest rev streams, and often users want to stake the Max amount, but currently this happy path results in an error.
@willyogo The max. ATOM issue has been fixed on the lib side, meaning users can now send max. amount of ATOM with the conservative fee properly deducted


IMO, with this now fixed, we should be able to close this issue. The issue with having some amount of ATOM less than the fee is still present but IMO really is just an edge case encountered during development as we're talking sub-penny amounts


nice! that's awesome that we've got it fixed for sending @gomesalexandre. Do we need to do anything else to make 'Max' work for staking? I just tested and am still getting "Not enough ATOM to cover gas" when attempting to stake max.