getTokenCost is a method on the ARIO class that calculates the cost in mARIO tokens for various ArNS operations such as buying records, extending leases, increasing undername limits, upgrading to permabuy, and requesting primary names.
The getTokenCost method accepts different parameter sets depending on the intent (the specific action you want to check the cost for). Each intent requires a different combination of parameters as outlined below:
Buy Record / Buy Name
Parameter
Type
Description
Optional
intent
string
'Buy-Record' or 'Buy-Name'
false
name
string
The ArNS name to calculate cost for
false
type
string
'lease' or 'permabuy'
false
years
number
Number of years for lease (required for all lease operations)
{"permabuyPrice": 164234000000,// Cost in mARIO (6 decimal places)"leasePrice": 82117000000,// Cost in mARIO (6 decimal places)"extensionPrice": 164234000000,// Cost in mARIO (6 decimal places)"increasePrice": 500000000,// Cost in mARIO (6 decimal places)"upgradePrice": 82117000000,// Cost in mARIO (6 decimal places)"primaryNamePrice": 2500000000000// Cost in mARIO (6 decimal places)}