cancelWithdrawal
cancelWithdrawal
is a method on the ARIO
class that cancels an existing vault withdrawal on a gateway. If no gatewayAddress
is provided, the signer's address will be used.
cancelWithdrawal
requires authentication.
Parameters
Parameter | Type | Description | Required |
---|---|---|---|
gatewayAddress | string | The gateway address where the vault exists | No |
vaultId | string | The ID of the vault withdrawal to cancel | Yes |
tags | array | An array of GQL tag objects to attach to the transfer AO message | No |
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();