Clearing a wallet
Thanks for the library!
One thing I'm currently trying to work out is how to effectively clear a wallet - currently I use PrivateKey.send(outputs), but this can produce a situation where fee + output is more than the balance.
Is there a method I've missed that says "send all the balance of this PK"?
What you're talking about is often known as sweeping. We should probably add that keyword in the documentation.
https://ofek.dev/bit/guide/transactions.html#transfer-funds
I think that should work for you.
What you're talking about is often known as sweeping. We should probably add that keyword in the documentation.
https://ofek.dev/bit/guide/transactions.html#transfer-funds
I think that should work for you.
Thanks! That does work for me.
From running this code it appears we get a raw string of the transaction - is there any way of confirming how much is actually going to be sent prior to sending the tx, or do we just have to send it and inspect the tx afterwards?
What you're talking about is often known as sweeping. We should probably add that keyword in the documentation. https://ofek.dev/bit/guide/transactions.html#transfer-funds I think that should work for you.
Thanks! That does work for me.
From running this code it appears we get a raw string of the transaction - is there any way of confirming how much is actually going to be sent prior to sending the tx, or do we just have to send it and inspect the tx afterwards?
You can try to estimate the size of the transaction and query the fee.