Skip to main content

JavaScript SDK API Reference / Bindings / setPrimaryDomain

Function: setPrimaryDomain()

setPrimaryDomain(connection, nameAccount, owner): Promise<TransactionInstruction>

Defined in: bindings/setPrimaryDomain.ts:24

Builds an instruction to set a domain as the owner's primary domain.

This derives the owner's primary-domain account, detects whether the provided name account is a subdomain, and includes the parent name account when required by the primary-domain program.

Parameters

connection

Connection

Solana RPC connection

nameAccount

PublicKey

Name account to set as primary

owner

PublicKey

Owner of the name account

Returns

Promise<TransactionInstruction>

Transaction instruction.

Example

const instruction = await setPrimaryDomain(connection, nameAccount, owner);