buyRecord

buyRecord is a method on the ARIO class that purchases a record in the ArNS registry for a specified name and duration.

buyRecord requires authentication.

Important: ANT Process ID

The processId parameter must be the process ID of an ANT (Arweave Name Token) that you own or control. You cannot use the ARIO contract address or create ANTs automatically through this method. You must create your ANT separately before calling buyRecord.

Examples

buyRecord

const { id: txId } = await ario.buyRecord({
    name: 'mydomain',
    years: 1,
    processId: antProcessId,
    type: 'lease'
});

Parameters

ParameterTypeDescriptionOptional
namestringThe ArNS name to purchasefalse
yearsnumberThe number of years to lease the name for (1-5)false
processIdstring

The ANT process ID to set for this name. Must be an existing ANT that you own or control

false
typestringThe type of purchase: 'lease' or 'permabuy'true
fundFromstring

The source of funds: 'balance', 'stakes', 'any', or 'turbo'

true
paidBystring | string[]

Wallet address(es) that will pay for the purchase (used with fundFrom: 'turbo')

true
tagsarray

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

true

Was this page helpful?