-
Notifications
You must be signed in to change notification settings - Fork 146
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Subtract pending outbound tx amounts from available balance #1701
Comments
There has been conversation around not doing this, but it is still in the backlog? Should this be started? @aulneau I think you challenged not doing it? |
I presume we still want this prioritized for the backlog, since we do this in the desktop wallet already and it seems to work well (and I don't recall the recent convo around not doing it). But curious to hear what @aulneau thinks if he has concerns. |
@timstackblock to retest |
Findings: The use case mentioned above by @kyranjamie hasn't been fixed. Testing scenario:
Results:
They were the same amount which means that the cc @markmhx |
@fbwoolf want to take this one? |
Yep, for sure. 👍 |
@kyranjamie I'm working on this, but do you think we should ask the api team to add a |
Also, are we wanting to subtract out just pending txs or locally 'submitted' tx balances too? EDIT: I put up a PR, so just did pending txs unless CR says otherwise. |
If we expect submitted balances to eventually go through as pending, then I presume it'd be best to subtract them as well? |
I'd just use the mempool amounts to subtract "pending balances". We could also subtract submitted amounts, but this should only ever be a short-lived state, and sometimes it goes wrong, so I would avoid this to begin with. I don't think we need a new API prop. This is how it's done in desktop wallet https://github.com/hirosystems/stacks-wallet/blob/d35bffa0a072a7d03212004f260bc59ff1259ea5/app/utils/tx-utils.ts#L67-L69 |
Quick questions:
|
As I was testing Max amount ,noticed the following:
The screen recording below can explain the scenario better. Max.amount.tx.pending.movcc @markmhx @fbwoolf |
Yep, that is expected but not sure if there is more info we want to provide if the pending tx is using all available STX? We could def provide an error message below the input field in this situation? |
Yes, highly agree with you in providing an error message below the input field in this situation, esp for new users/beginners -the info will be helpful @markmhx any inputs on the error message or warnings for the scenario mentioned above. |
Also is this applicable only for STX? |
Yep, this is only for STX. |
Is there any future enhancement plan for the non-Stx tokens? |
Test passed except for the error message/warning which will be ideal for the use case above. |
Ideally we should have this for STX and non-STX assets, even if we release both as separate enhancements. @Eshwari007 please do create a separate ticket for non-STX assets 🙏 |
How abt the error message or warning when user selects Max while a pending tx with full Max tx is in the process as well thus has no inputs when the user selects the Max button.( the scenario on the video above) |
Let's create a separate issue for this message as an enhancement 🙏 |
For example, when sending a tx and then using the Send max functionality, the outbound pending tx isn't considered.
The text was updated successfully, but these errors were encountered: