reassignName

reassignName is a method on the ANT class that transfers ownership of an ArNS name to a new ANT. This operation can only be performed by the current ANT owner.

reassignName requires authentication.

Parameters

ParameterTypeDescriptionOptional
namestringThe ArNS name to be reassignedfalse
ioProcessIdstringThe Process ID of the ARIO contractfalse
antProcessIdstringThe Process ID of the target ANTfalse
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();