reassignName

reassignName is a method on the ANT class that reassigns a name to a new ANT. This can only be done by the current owner of the ANT.

reassignName requires authentication.

Parameters

ParameterTypeDescriptionOptional
namestringArNS name to reassignfalse
ioProcessIdstringProcess Id of the ARIO contract.false
antProcessIdstringProcess Id of the new ANT.false
tagsarrayAn array of GQL tag objects to attach to the transfer AO message.true

Examples

reassignName

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

 async function main() {
 const jwk = JSON.parse(fs.readFileSync("KeyFile.json"));
 const ant = ANT.init({
     signer: new ArweaveSigner(jwk),
     processId: "bh9l1cy0aksiL_x9M359faGzM_yjralacHIUo8_nQXM"
 });

 const { id: txId } = await ant.reassignName({
         name: 'ardrive',
         ioProcessId: ARIO_PROCESS_ID,
         antProcessId: NEW_ANT_PROCESS_ID, // the new ANT process id that will take over ownership of the name
     });
 }

 main();