Add an option to send a transaction using all available LBC
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 7.2k
- Forks
- 493
- PR merge metrics
- No merged PRs in 30d
Description
## The Issue
As a daemon or app user, I want to be able to move all my funds from one address to another. Currently, you'd need to send some amount that's smaller than the wallet balance to account for fees. There should be an option that allows all funds to be sent along with the appropriate fee, i.e. a send max scenario.
## Steps
- make it so you can use `all` as a value to `--amount`. this signals you want to use your whole available balance
- create the transaction internally using the full amount, then estimate the fee, then update the transaction to subtract the fee from the full amount
APIs that should support this: `support_create`, `wallet_send`, any other api that has a `--amount` flag
Use case: i want to support my channel with all my available lbc and i don't want to do the math to figure out how much the fee should be.
Take a look `txo_fund --everything`. There may be reusable code there. (https://github.com/lbryio/lbry-sdk/blob/master/lbry/wallet/account.py#L488)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in lbry/wallet/account.py around txo_fund --everything, then trace amount handling through support_create, wallet_send, and other APIs with an --amount flag. Compare how transaction creation and fee estimation work, and verify that the supported APIs can send the full available balance with the fee deducted automatically.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- backend-api-design, blockchain
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100