Skip to main content

JavaScript SDK API Reference / Bindings / createSubdomain

Function: createSubdomain()

createSubdomain(connection, subdomain, owner, space?, feePayer?): Promise<TransactionInstruction[]>

Defined in: bindings/createSubdomain.ts:25

Builds the instructions to create a .sns subdomain.

Parameters

connection

Connection

Solana RPC connection

subdomain

string

Full .sns subdomain name

owner

PublicKey

Owner of the parent domain creating the subdomain

space?

number = 2_000

Space to allocate to the subdomain. Defaults to 2 kB

feePayer?

PublicKey

Optional fee payer. Defaults to owner

Returns

Promise<TransactionInstruction[]>

Transaction instructions.

Example

const instructions = await createSubdomain(connection, "sub.example.sns", owner);