-
Notifications
You must be signed in to change notification settings - Fork 2.6k
transfer_all() function in Balances Pallet #8696
Comments
I think by the time it gets to the extrinsic, all fees and tips are already deducted from the account, so it should be simple enough to query the free balance of the user account, and then use that amount for a transfer call. |
but block weight fee multiplier changes every block so you can never guarantee the transfer success |
@xlc I think you are reading my comment wrong. I think a new extrinsic like this solves this:
This logic is built into the runtime and happens after all the fee stuff is deducted. So I think it will always succeed when the full transfer is possible. |
Yes but not during the block, so for the duration of a single block, it is constant. I think shawn's proposal works. |
I try to implement transfer_all_free in runtime with KeepAlive then got the error
|
Why are you implementing it again? The function already exists now |
It would be helpful to have a function that takes into account the transaction fee required to send the entire balance of an account without leaving any dust behind to be reaped.
amountToTransfer + partialFee + tip? = Total balance
The text was updated successfully, but these errors were encountered: