approvePrimaryNameRequest

approvePrimaryNameRequest is a method on the ANT class that approves a primary name request for a given name or address.

approvePrimaryNameRequest requires authentication.

Parameters

← Swipe to see more →
ParameterTypeDescriptionOptional
namestringArNS name to approve as primary name.false
addressstring - WalletAddress

Public wallet address that made the primary name request being approved.

false
ioProcessIdstringProcess Id of the ARIO contract.false
tagsarray

An array of GQL tag objects to attach to the transfer AO message.

true
← Swipe to see more →

Examples

approvePrimaryNameRequest

 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.approvePrimaryNameRequest({
         name: 'arns',
         address: 't4Xr0_J4Iurt7caNST02cMotaz2FIbWQ4Kbj616RHl3', // must match the request initiator address
         ioProcessId: ARIO_PROCESS_ID, // the ARIO process id to use for the request
     });
 }

 main();