Electric-Coin-Company / zashi

Issue Tracking and common resources for the Zashi Zcash Wallets
MIT License
2 stars 1 forks source link

Add "Send entire wallet balance" option to the send workflow. #40

Open nuttycom opened 5 months ago

nuttycom commented 5 months ago

Is your feature request related to a problem? Please describe.

In order to move funds between wallets, it's useful to be able to send the full balance out of the wallet to a recipient. Due to the complexities of fee calculation presented by ZIP 317 the user will likely not be able to accurately guess the fee amount required to empty their wallet, so computing this amount should be the responsibility of the wallet.

Describe the solution you'd like

The top-line balance of the wallet should be equal to the total funds that could be received at an Orchard address when emptying the wallet. The send flow UI should include an alternative to the amount field that is something like a "send maximum value" option. When this option is selected, the transaction proposal should transfer the maximum possible value out of the wallet to a recipient address, correctly accounting for ZIP 317 considerations. Remaining dust-valued UTXOs should be ignored.

Alternatives you've considered

The current design of the top-line balance API does not take fees required to spend into consideration.

Additional context

How this issue is resolved is also related to #39.