Skip to main content

JavaScript SDK API Reference / States / NameRegistryState

Class: NameRegistryState

Defined in: state.ts:25

Deserialized header and payload of an SNS name registry account.

Constructors

Constructor

new NameRegistryState(obj): NameRegistryState

Defined in: state.ts:45

Parameters

obj

NameRegistryStateParams

Returns

NameRegistryState

Properties

class

class: PublicKey

Defined in: state.ts:33

Registry class address.


data

data: Buffer<ArrayBufferLike> | undefined

Defined in: state.ts:35

Registry data after the fixed header.


owner

owner: PublicKey

Defined in: state.ts:31

Registry owner address.


parentName

parentName: PublicKey

Defined in: state.ts:29

Parent registry address.


HEADER_LEN

static HEADER_LEN: number = 96

Defined in: state.ts:27

Fixed byte length of the registry header.


schema

static schema: object

Defined in: state.ts:37

struct

struct: object

struct.class

class: object

struct.class.array

array: object

struct.class.array.len

len: number = 32

struct.class.array.type

type: string = "u8"

struct.owner

owner: object

struct.owner.array

array: object

struct.owner.array.len

len: number = 32

struct.owner.array.type

type: string = "u8"

struct.parentName

parentName: object

struct.parentName.array

array: object

struct.parentName.array.len

len: number = 32

struct.parentName.array.type

type: string = "u8"

Methods

_retrieveBatch()

static _retrieveBatch(connection, nameAccountKeys): Promise<(NameRegistryState | undefined)[]>

Defined in: state.ts:80

Fetches one RPC-sized batch of name registry accounts.

Parameters

connection

Connection

nameAccountKeys

PublicKey[]

Returns

Promise<(NameRegistryState | undefined)[]>


deserialize()

static deserialize(data): NameRegistryState

Defined in: state.ts:52

Deserializes raw name registry account data.

Parameters

data

Buffer

Returns

NameRegistryState


retrieve()

static retrieve(connection, nameAccountKey): Promise<{ nftOwner: PublicKey | null; registry: NameRegistryState; }>

Defined in: state.ts:60

Fetches a name registry account and its tokenized-domain owner, if any.

Parameters

connection

Connection

nameAccountKey

PublicKey

Returns

Promise<{ nftOwner: PublicKey | null; registry: NameRegistryState; }>


retrieveBatch()

static retrieveBatch(connection, nameAccountKeys): Promise<(NameRegistryState | undefined)[]>

Defined in: state.ts:96

Fetches and deserializes name registry accounts in batches of up to 100.

Parameters

connection

Connection

nameAccountKeys

PublicKey[]

Returns

Promise<(NameRegistryState | undefined)[]>