setUndernameRecord

setUndernameRecord is a method on the ANT class that creates or updates an undername record for the ANT. An undername is a prefix that is joined to the base name with an underscore (e.g., dapp_ardrive.ar.io).

setUndernameRecord requires authentication.

Examples

setUndernameRecord

const { id: txId } = await ant.setUndernameRecord({
    undername: 'dapp',
    transactionId: '432l1cy0aksiL_x9M359faGzM_yjralacHIUo8_nQXM',
    ttlSeconds: 900
});

Parameters

ParameterTypeDescriptionOptional
undernamestring

The undername to set the record for (e.g., 'dapp')

false
transactionIdstringThe Arweave transaction ID to set as the recordfalse
ttlSecondsnumber

The number of seconds for DNS TTL (defaults to 900)

true
tagsarray

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

true
TTL

Time-To-Live (TTL) determines how often gateways should check the ANT for updates to the corresponding record. You can have different TTLs for different records within an ANT, depending on their use case. A record that is updated frequently should have a lower value to facilitate serving current data, while a record that is updated less often should have a higher value to allow cached data to be served more quickly.

TTL must be between 60 seconds (1 minute) and 86400 seconds (1 day).

Was this page helpful?