buyRecord

buyRecord is a method on the ARIO class that purchases a new ArNS record with the specified name, type, processId, and duration.

Examples

buyRecord

const record = await ario.buyRecord({
  name: 'ardrive',
  type: 'lease',
  years: 1,
})

Parameters

ParameterTypeDescriptionOptional
namestringThe ArNS name to purchasefalse
typestringThe type of record: 'lease' or 'permabuy'false
yearsnumber

The number of years to lease (for lease type) or purchase permanently (for permabuy type)

false
processIdstring

The process id of an existing ANT process. If not provided, a new ANT process using the provided signer will be spawned, and the ArNS record will be assigned to that process.

true
referrerstring

Track purchase referrals for analytics (e.g. my-app.com)

true
tagsarray

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

true

Manual ANT Creation

If you prefer to manually create an ANT during the purchase process, see the manual ANT creation workflow.

Was this page helpful?