setPrimaryName
setPrimaryName
is a method on the ARIO
class that allows the owner of an ANT that controls an ArNS name to set their primary name in a single API call.
setPrimaryName
requires authentication.
Examples
setPrimaryName
Parameters
Parameter | Type | Description | Optional |
---|---|---|---|
name | string | The ArNS name to set as the primary name for the caller's address. | false |
fundFrom | string | The source of funds: 'balance', 'stakes', 'any', or 'turbo' | true |
referrer | string | Track purchase referrals for analytics (e.g. my-app.com) | true |
Output
Notes
- This method requires that the caller owns an ANT that controls the specified ArNS name
- The transaction will fail if the caller does not have permission to set this name as their primary name
- This method provides a more efficient way to set a primary name compared to the previous two-step process of requesting and approving
- Internally, this method first calls
requestPrimaryName
and thenapprovePrimaryNameRequest
on the ANT - The
fundFrom
parameter determines how the operation will be funded (from balance, stakes, or turbo) - The
referrer
parameter is used for tracking and analytics purposes