irys.withdrawAll()
Withdraws the the user's entire account balance. The unit is the token
parameter supplied when creating the Irys
object. If you have balances in more than one token, you must re-instantiate the Irys
object for each token.
Returns
Type
Description
string
Either a 400 or 200 code.
400 - something went wrong
200 - Ok
response.data = {
requested, // the requested amount,
fee, // the reward required by the network (network fee)
final, // total cost to your account (requested + fee)
tx-id, // the ID of the withdrawal transaction
}
Example
try {
const irys = await getIrys();
const tx = await irys.withdrawAll();
} catch (e) {
console.log("Error withdrawing funds ", e);
}