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
ℹ️
Use a token-specific version of getIrysUploader()
to connect to an Irys Bundler before uploading. Choose one from here.
try {
const irys = await getIrysUploader();
const tx = await irys.withdrawAll();
} catch (e) {
console.log("Error withdrawing funds ", e);
}