Skip to content
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

Withdraw all #11

Closed
peoplma opened this issue Apr 3, 2016 · 2 comments
Closed

Withdraw all #11

peoplma opened this issue Apr 3, 2016 · 2 comments

Comments

@peoplma
Copy link

peoplma commented Apr 3, 2016

I've been having trouble trying to get a balance from a label address and withdraw all of it. An error is raised saying that I don't have enough when I try to withdraw the whole balance - obviously - due to network fees. But using the block_io.get_network_fee_estimate method returns the wrong fee amount for bitcoin, so I can't subtract that from the address balance either. Is there a better way to withdraw the maximum amount from an address?

@v6
Copy link

v6 commented Apr 4, 2016

// , These sort of fractional transactions kind of get killed by calculations for fees and other things.

@doersf
Copy link
Member

doersf commented Sep 10, 2017

Fee estimation has gotten alot simpler since this issue was opened. Here's how you get the max withdrawable balance now:

  1. You can just use the max available balance to get a network fee estimate.
  2. Then make another call with amount_used minus estimated fee returned.
  3. You should be able to request the withdrawal with the amount in (2).

@doersf doersf closed this as completed Sep 10, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants