removeUndernameRecord

removeUndernameRecord is a method on the ANT class that removes a specified undername record from the ANT process. Once removed, the undername will no longer resolve.

removeUndernameRecord requires authentication.

Parameters

ParameterTypeDescriptionOptional
undernamestringThe undername to remove (e.g., 'dapp')false
tagsarrayAn array of GQL tag objects to attach to the transfer AO messagetrue

Examples

removeUndernameRecord

const fs = require("fs");
const { ANT, ArweaveSigner } = require("@ar.io/sdk");

async function main() {
    const jwk = JSON.parse(fs.readFileSync("KeyFile.json"));
    
    // get the ant for the base name
    const arnsRecord = await ario.getArNSRecord({ name: 'ardrive' });
    const ant = ANT.init({
        signer: new ArweaveSigner(jwk),
        processId: arnsRecord.processId
    });

    const { id: txId } = await ant.removeUndernameRecord(
        { undername: 'dapp' },
        // optional additional tags
        { tags: [{ name: 'App-Name', value: 'My-Awesome-App' }] }
    );

    // dapp_ardrive.ar.io will no longer resolve
}

main();