You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The problem I'm trying to solve here is the following: If I have an application where the users have certain balances, I would wan't to have a way for them to withdraw that balance without me having to pay the cost of the operation. So, say user has 1btc and he/she decides to transfer these funds to where ever. Now when this transaction is happening, the user gets 1btc but I end up paying the fee. What I would like to have happen here is the following: My wallets balance is reduced by 1btc and the user is going to receive what ever amount is left after the fee has been payed.
I could do what some apps do and have their balance go to negative (the amount of fee payed is reduced from onsite balance after the transaction has been sent), but I don't like that. I could also have a set withdrawal fee, percentage or similar arrangement, but I would like to not do that either. Ideally I could charge a fee on the service I provide and advertise that my service doesn't charge extra for withdrawals, you just pay the costs that are enforced by the network.
The text was updated successfully, but these errors were encountered:
When you try to withdraw max available coins, it will give you an error saying "Wallet balance too low to pay the fee [12880]". Notice the fee in the square brackets.
In code, you can try withdrawing, catch the error, take out the square brackets and subtract this value from the original price and send it.
Not efficient, I know. But this is how I've done it.
The problem I'm trying to solve here is the following: If I have an application where the users have certain balances, I would wan't to have a way for them to withdraw that balance without me having to pay the cost of the operation. So, say user has 1btc and he/she decides to transfer these funds to where ever. Now when this transaction is happening, the user gets 1btc but I end up paying the fee. What I would like to have happen here is the following: My wallets balance is reduced by 1btc and the user is going to receive what ever amount is left after the fee has been payed.
I could do what some apps do and have their balance go to negative (the amount of fee payed is reduced from onsite balance after the transaction has been sent), but I don't like that. I could also have a set withdrawal fee, percentage or similar arrangement, but I would like to not do that either. Ideally I could charge a fee on the service I provide and advertise that my service doesn't charge extra for withdrawals, you just pay the costs that are enforced by the network.
The text was updated successfully, but these errors were encountered: