JavaScript SDK API Reference / Address / PrimaryDomain
Class: PrimaryDomain
Defined in: primary-domain.ts:37
Deserialized primary-domain account and its address derivation helpers.
Constructors
Constructor
new PrimaryDomain(
obj):PrimaryDomain
Defined in: primary-domain.ts:49
Parameters
obj
Returns
PrimaryDomain
Properties
nameAccount
nameAccount:
PublicKey
Defined in: primary-domain.ts:41
Primary domain account address.
tag
tag:
number
Defined in: primary-domain.ts:39
Account state tag.
schema
staticschema:object
Defined in: primary-domain.ts:42
struct
struct:
object
struct.nameAccount
nameAccount:
object
struct.nameAccount.array
array:
object
struct.nameAccount.array.len
len:
number=32
struct.nameAccount.array.type
type:
string="u8"
struct.tag
tag:
string="u8"
Methods
deserialize()
staticdeserialize(data):PrimaryDomain
Defined in: primary-domain.ts:60
Deserializes raw primary-domain account data.
Parameters
data
Buffer
The raw primary-domain account data
Returns
PrimaryDomain
The deserialized primary-domain account
getKey()
staticgetKey(programId,owner):Promise<[PublicKey,number]>
Defined in: primary-domain.ts:88
Derives the primary-domain account address for an owner.
Parameters
programId
PublicKey
The primary-domain program ID
owner
PublicKey
The public key of the wallet owner
Returns
Promise<[PublicKey, number]>
The derived primary-domain account address and bump seed
getKeySync()
staticgetKeySync(programId,owner): [PublicKey,number]
Defined in: primary-domain.ts:102
Synchronously derives the primary-domain account address for an owner.
Parameters
programId
PublicKey
The primary-domain program ID
owner
PublicKey
The public key of the wallet owner
Returns
[PublicKey, number]
The derived primary-domain account address and bump seed
retrieve()
staticretrieve(connection,key):Promise<PrimaryDomain>
Defined in: primary-domain.ts:71
Fetches and deserializes a primary-domain account.
Parameters
connection
Connection
Solana RPC connection
key
PublicKey
The primary-domain account address
Returns
Promise<PrimaryDomain>
The deserialized primary-domain account