cancelWithdrawal
cancelWithdrawal
is a method on the ARIO
class that instantly withdraws an existing vault on a gateway. If no gatewayAddress
is provided, the signer's address will be used.
cancelWithdrawal
requires authentication.
Parameters
Parameter | Type | Description | Optional |
---|---|---|---|
gatewayAddress | String - WalletAddress | Gateway address where delegate vault exists | true |
vaultId | string | Delegated vault id to cancel. | false |
tags | array | An array of GQL tag objects to attach to the transfer AO message. | true |
Examples
cancelWithdrawal
const fs = require("fs");
const { ARIO, ArweaveSigner } = require("@ar.io/sdk");
async function main() {
const jwk = JSON.parse(fs.readFileSync("KeyFile.json"));
const ario = ARIO.init({
signer: new ArweaveSigner(jwk),
});
// cancels a delegated vault from a gateway
const { id: txId } = await ario.cancelWithdrawal(
{
// gateway address where vault exists
gatewayAddress: 't4Xr0_J4Iurt7caNST02cMotaz2FIbWQ4Kbj616RHl3',
// vault id to cancel
vaultId: 'fDrr0_J4Iurt7caNST02cMotaz2FIbWQ4Kcj616RHl3',
},
// optional additional tags
{ tags: [{ name: 'App-Name', value: 'My-Awesome-App' }] },
);
// cancels an operator vault from a gateway
const { id: txId } = await ario.cancelWithdrawal(
{
// operator vault id to cancel
vaultId: 'fDrr0_J4Iurt7caNST02cMotaz2FIbWQ4Kcj616RHl3',
},
);
}
main();