Skip to main content

JavaScript SDK API Reference / Bindings / registerDomainWithNft

Function: registerDomainWithNft()

registerDomainWithNft(domain, space, nameAccount, reverseLookupAccount, buyer, nftSource, nftMint): TransactionInstruction

Defined in: bindings/registerDomainWithNft.ts:68

Builds an instruction to register a top-level .sns domain using a Wolves NFT.

The nameAccount and reverseLookupAccount keys must be pre-derived with getSnsDomainKeySync and getReverseKeySync respectively before calling this function.

Parameters

domain

string

Full .sns domain name

space

number

The number of bytes to allocate for the name account data

nameAccount

PublicKey

The derived public key of the domain name account

reverseLookupAccount

PublicKey

The derived public key of the reverse lookup account

buyer

PublicKey

Buyer paying for the registration and holding the NFT

nftSource

PublicKey

The buyer's token account holding the Wolves NFT

nftMint

PublicKey

The mint address of the Wolves NFT

Returns

TransactionInstruction

Transaction instruction.

Example

const instruction = registerDomainWithNft(
"example.sns",
1_000,
nameAccount,
reverseAccount,
buyer,
nftSource,
nftMint,
);