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
Parameter | Type | Description | Optional |
---|---|---|---|
name | string | ArNS name to approve as primary name. | false |
address | string - WalletAddress | Public wallet address that made the primary name request being approved. | false |
ioProcessId | string | Process Id of the ARIO contract. | false |
tags | array | An array of GQL tag objects to attach to the transfer AO message. | true |
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_TESTNET_PROCESS_ID, // the ARIO process id to use for the request
});
}
main();