# Subnames

[**@justaname.id/sdk**](/sdk-reference/justaname-core-sdk.md) • **Docs**

***

[@justaname.id/sdk](/sdk-reference/justaname-core-sdk/globals.md) / Subnames

## Class: Subnames

### Constructors

#### new Subnames()

> **new Subnames**(`params`): [`Subnames`](/sdk-reference/justaname-core-sdk/classes/subnames.md)

**Parameters**

• **params**: [`SubnamesConfig`](/sdk-reference/justaname-core-sdk/interfaces/subnamesconfig.md)

**Returns**

[`Subnames`](/sdk-reference/justaname-core-sdk/classes/subnames.md)

**Defined in**

[packages/@justaname.id/sdk/src/lib/features/subnames/index.ts:58](https://github.com/JustaName-id/JustaName-sdk/blob/dc845c10af242e3ca87d95ef392516ac0bfa8b95/packages/@justaname.id/sdk/src/lib/features/subnames/index.ts#L58)

### Methods

#### acceptSubname()

> **acceptSubname**(`params`, `headers`): `Promise`<[`SubnameResponse`](/sdk-reference/justaname-core-sdk/interfaces/subnameresponse.md)>

**Parameters**

• **params**: `Omit`<[`MakeOptionalProps`](/sdk-reference/justaname-core-sdk/type-aliases/makeoptionalprops.md)<[`SubnameAcceptRequest`](/sdk-reference/justaname-core-sdk/interfaces/subnameacceptrequest.md), `"chainId"` | `"ensDomain"`>, `"addresses"` | `"text"`> & `object`

• **headers**: [`ApiKeyHeaders`](/sdk-reference/justaname-core-sdk/interfaces/apikeyheaders.md) & [`SIWEHeaders`](/sdk-reference/justaname-core-sdk/interfaces/siweheaders.md)

**Returns**

`Promise`<[`SubnameResponse`](/sdk-reference/justaname-core-sdk/interfaces/subnameresponse.md)>

**Defined in**

[packages/@justaname.id/sdk/src/lib/features/subnames/index.ts:65](https://github.com/JustaName-id/JustaName-sdk/blob/dc845c10af242e3ca87d95ef392516ac0bfa8b95/packages/@justaname.id/sdk/src/lib/features/subnames/index.ts#L65)

***

#### addSubname()

> **addSubname**(`params`, `headers`): `Promise`<[`SubnameResponse`](/sdk-reference/justaname-core-sdk/interfaces/subnameresponse.md)>

**Parameters**

• **params**: `Omit`<[`MakeOptionalProps`](/sdk-reference/justaname-core-sdk/type-aliases/makeoptionalprops.md)<[`SubnameAddRequest`](/sdk-reference/justaname-core-sdk/interfaces/subnameaddrequest.md), `"chainId"` | `"ensDomain"`>, `"addresses"` | `"text"`> & `object`

• **headers**: [`ApiKeyHeaders`](/sdk-reference/justaname-core-sdk/interfaces/apikeyheaders.md) & [`SIWEHeaders`](/sdk-reference/justaname-core-sdk/interfaces/siweheaders.md)

**Returns**

`Promise`<[`SubnameResponse`](/sdk-reference/justaname-core-sdk/interfaces/subnameresponse.md)>

**Defined in**

[packages/@justaname.id/sdk/src/lib/features/subnames/index.ts:137](https://github.com/JustaName-id/JustaName-sdk/blob/dc845c10af242e3ca87d95ef392516ac0bfa8b95/packages/@justaname.id/sdk/src/lib/features/subnames/index.ts#L137)

***

#### getInvitationsByAddress()

> **getInvitationsByAddress**(`params`): `Promise`<[`SubnameGetInvitationsByAddressResponse`](/sdk-reference/justaname-core-sdk/interfaces/subnamegetinvitationsbyaddressresponse.md)>

**Parameters**

• **params**: `Omit`<[`MakeOptionalProps`](/sdk-reference/justaname-core-sdk/type-aliases/makeoptionalprops.md)<[`SubnameGetInvitationsByAddressRequest`](/sdk-reference/justaname-core-sdk/interfaces/subnamegetinvitationsbyaddressrequest.md), `"coinType"` | `"chainId"`>, `"isClaimed"`>

**Returns**

`Promise`<[`SubnameGetInvitationsByAddressResponse`](/sdk-reference/justaname-core-sdk/interfaces/subnamegetinvitationsbyaddressresponse.md)>

**Defined in**

[packages/@justaname.id/sdk/src/lib/features/subnames/index.ts:340](https://github.com/JustaName-id/JustaName-sdk/blob/dc845c10af242e3ca87d95ef392516ac0bfa8b95/packages/@justaname.id/sdk/src/lib/features/subnames/index.ts#L340)

***

#### getPrimaryNameByAddress()

> **getPrimaryNameByAddress**(`params`): `Promise`<`PrimaryNameGetByAddressResponse`>

**Parameters**

• **params**: `Omit`<[`MakeOptionalProps`](/sdk-reference/justaname-core-sdk/type-aliases/makeoptionalprops.md)<`PrimaryNameGetByAddressRequest`, `"chainId"`>, `never`>

**Returns**

`Promise`<`PrimaryNameGetByAddressResponse`>

**Defined in**

[packages/@justaname.id/sdk/src/lib/features/subnames/index.ts:439](https://github.com/JustaName-id/JustaName-sdk/blob/dc845c10af242e3ca87d95ef392516ac0bfa8b95/packages/@justaname.id/sdk/src/lib/features/subnames/index.ts#L439)

***

#### getRecords()

> **getRecords**(`params`): `Promise`<[`SubnameResponse`](/sdk-reference/justaname-core-sdk/interfaces/subnameresponse.md)>

**Parameters**

• **params**: `Omit`<[`MakeOptionalProps`](/sdk-reference/justaname-core-sdk/type-aliases/makeoptionalprops.md)<[`SubnameRecordsRequest`](/sdk-reference/justaname-core-sdk/interfaces/subnamerecordsrequest.md), `"providerUrl"`>, `never`> & `object`

**Returns**

`Promise`<[`SubnameResponse`](/sdk-reference/justaname-core-sdk/interfaces/subnameresponse.md)>

**Defined in**

[packages/@justaname.id/sdk/src/lib/features/subnames/index.ts:419](https://github.com/JustaName-id/JustaName-sdk/blob/dc845c10af242e3ca87d95ef392516ac0bfa8b95/packages/@justaname.id/sdk/src/lib/features/subnames/index.ts#L419)

***

#### getSubname()

> **getSubname**(`params`): `Promise`<[`SubnameResponse`](/sdk-reference/justaname-core-sdk/interfaces/subnameresponse.md)>

**Parameters**

• **params**: `Omit`<[`MakeOptionalProps`](/sdk-reference/justaname-core-sdk/type-aliases/makeoptionalprops.md)<[`SubnameGetBySubnameRequest`](/sdk-reference/justaname-core-sdk/interfaces/subnamegetbysubnamerequest.md), `"chainId"`>, `never`>

**Returns**

`Promise`<[`SubnameResponse`](/sdk-reference/justaname-core-sdk/interfaces/subnameresponse.md)>

**Defined in**

[packages/@justaname.id/sdk/src/lib/features/subnames/index.ts:302](https://github.com/JustaName-id/JustaName-sdk/blob/dc845c10af242e3ca87d95ef392516ac0bfa8b95/packages/@justaname.id/sdk/src/lib/features/subnames/index.ts#L302)

***

#### getSubnamesByAddress()

> **getSubnamesByAddress**(`params`): `Promise`<[`SubnameGetAllByAddressResponse`](/sdk-reference/justaname-core-sdk/interfaces/subnamegetallbyaddressresponse.md)>

**Parameters**

• **params**: `Omit`<[`MakeOptionalProps`](/sdk-reference/justaname-core-sdk/type-aliases/makeoptionalprops.md)<[`SubnameGetAllByAddressRequest`](/sdk-reference/justaname-core-sdk/interfaces/subnamegetallbyaddressrequest.md), `"coinType"` | `"chainId"` | `"isClaimed"`>, `never`>

**Returns**

`Promise`<[`SubnameGetAllByAddressResponse`](/sdk-reference/justaname-core-sdk/interfaces/subnamegetallbyaddressresponse.md)>

**Defined in**

[packages/@justaname.id/sdk/src/lib/features/subnames/index.ts:320](https://github.com/JustaName-id/JustaName-sdk/blob/dc845c10af242e3ca87d95ef392516ac0bfa8b95/packages/@justaname.id/sdk/src/lib/features/subnames/index.ts#L320)

***

#### getSubnamesByEnsDomain()

> **getSubnamesByEnsDomain**(`params`): `Promise`<[`SubnameGetAllByDomainChainIdResponse`](/sdk-reference/justaname-core-sdk/interfaces/subnamegetallbydomainchainidresponse.md)>

**Parameters**

• **params**: `Omit`<[`MakeOptionalProps`](/sdk-reference/justaname-core-sdk/type-aliases/makeoptionalprops.md)<[`SubnameGetAllByDomainChainIdRequest`](/sdk-reference/justaname-core-sdk/interfaces/subnamegetallbydomainchainidrequest.md), `"chainId"` | `"ensDomain"`>, `never`>

**Returns**

`Promise`<[`SubnameGetAllByDomainChainIdResponse`](/sdk-reference/justaname-core-sdk/interfaces/subnamegetallbydomainchainidresponse.md)>

**Defined in**

[packages/@justaname.id/sdk/src/lib/features/subnames/index.ts:360](https://github.com/JustaName-id/JustaName-sdk/blob/dc845c10af242e3ca87d95ef392516ac0bfa8b95/packages/@justaname.id/sdk/src/lib/features/subnames/index.ts#L360)

***

#### getSubnamesByEnsDomainWithCount()

> **getSubnamesByEnsDomainWithCount**(`params`): `Promise`<[`SubnameGetAllByEnsDomainWithCountResponse`](/sdk-reference/justaname-core-sdk/interfaces/subnamegetallbyensdomainwithcountresponse.md)>

**Parameters**

• **params**: `Omit`<[`MakeOptionalProps`](/sdk-reference/justaname-core-sdk/type-aliases/makeoptionalprops.md)<[`SubnameGetAllByEnsDomainWithCountRequest`](/sdk-reference/justaname-core-sdk/interfaces/subnamegetallbyensdomainwithcountrequest.md), `"chainId"`>, `never`>

**Returns**

`Promise`<[`SubnameGetAllByEnsDomainWithCountResponse`](/sdk-reference/justaname-core-sdk/interfaces/subnamegetallbyensdomainwithcountresponse.md)>

**Defined in**

[packages/@justaname.id/sdk/src/lib/features/subnames/index.ts:283](https://github.com/JustaName-id/JustaName-sdk/blob/dc845c10af242e3ca87d95ef392516ac0bfa8b95/packages/@justaname.id/sdk/src/lib/features/subnames/index.ts#L283)

***

#### isSubnameAvailable()

> **isSubnameAvailable**(`params`): `Promise`<[`IsSubnameAvailableResponse`](/sdk-reference/justaname-core-sdk/interfaces/issubnameavailableresponse.md)>

**Parameters**

• **params**: `Omit`<[`MakeOptionalProps`](/sdk-reference/justaname-core-sdk/type-aliases/makeoptionalprops.md)<[`IsSubnameAvailableRequest`](/sdk-reference/justaname-core-sdk/interfaces/issubnameavailablerequest.md), `"chainId"`>, `never`>

**Returns**

`Promise`<[`IsSubnameAvailableResponse`](/sdk-reference/justaname-core-sdk/interfaces/issubnameavailableresponse.md)>

**Defined in**

[packages/@justaname.id/sdk/src/lib/features/subnames/index.ts:401](https://github.com/JustaName-id/JustaName-sdk/blob/dc845c10af242e3ca87d95ef392516ac0bfa8b95/packages/@justaname.id/sdk/src/lib/features/subnames/index.ts#L401)

***

#### rejectSubname()

> **rejectSubname**(`params`, `headers`): `Promise`<[`SubnameResponse`](/sdk-reference/justaname-core-sdk/interfaces/subnameresponse.md)>

**Parameters**

• **params**: `Omit`<[`MakeOptionalProps`](/sdk-reference/justaname-core-sdk/type-aliases/makeoptionalprops.md)<[`SubnameRejectRequest`](/sdk-reference/justaname-core-sdk/interfaces/subnamerejectrequest.md), `"chainId"` | `"ensDomain"`>, `never`>

• **headers**: [`SIWEHeaders`](/sdk-reference/justaname-core-sdk/interfaces/siweheaders.md)

**Returns**

`Promise`<[`SubnameResponse`](/sdk-reference/justaname-core-sdk/interfaces/subnameresponse.md)>

**Defined in**

[packages/@justaname.id/sdk/src/lib/features/subnames/index.ts:254](https://github.com/JustaName-id/JustaName-sdk/blob/dc845c10af242e3ca87d95ef392516ac0bfa8b95/packages/@justaname.id/sdk/src/lib/features/subnames/index.ts#L254)

***

#### reserveSubname()

> **reserveSubname**(`params`): `Promise`<[`SubnameResponse`](/sdk-reference/justaname-core-sdk/interfaces/subnameresponse.md)>

**Parameters**

• **params**: `Omit`<[`MakeOptionalProps`](/sdk-reference/justaname-core-sdk/type-aliases/makeoptionalprops.md)<[`SubnameReserveRequest`](/sdk-reference/justaname-core-sdk/interfaces/subnamereserverequest.md), `"chainId"` | `"ensDomain"`>, `never`> & `object`

**Returns**

`Promise`<[`SubnameResponse`](/sdk-reference/justaname-core-sdk/interfaces/subnameresponse.md)>

**Defined in**

[packages/@justaname.id/sdk/src/lib/features/subnames/index.ts:108](https://github.com/JustaName-id/JustaName-sdk/blob/dc845c10af242e3ca87d95ef392516ac0bfa8b95/packages/@justaname.id/sdk/src/lib/features/subnames/index.ts#L108)

***

#### revokeSubname()

> **revokeSubname**(`params`, `headers`): `Promise`<[`SubnameResponse`](/sdk-reference/justaname-core-sdk/interfaces/subnameresponse.md)>

**Parameters**

• **params**: `Omit`<[`MakeOptionalProps`](/sdk-reference/justaname-core-sdk/type-aliases/makeoptionalprops.md)<[`SubnameRevokeRequest`](/sdk-reference/justaname-core-sdk/interfaces/subnamerevokerequest.md), `"chainId"` | `"ensDomain"`>, `never`> & `object`

• **headers**: [`ApiKeyHeaders`](/sdk-reference/justaname-core-sdk/interfaces/apikeyheaders.md) & [`SIWEHeaders`](/sdk-reference/justaname-core-sdk/interfaces/siweheaders.md)

**Returns**

`Promise`<[`SubnameResponse`](/sdk-reference/justaname-core-sdk/interfaces/subnameresponse.md)>

**Defined in**

[packages/@justaname.id/sdk/src/lib/features/subnames/index.ts:219](https://github.com/JustaName-id/JustaName-sdk/blob/dc845c10af242e3ca87d95ef392516ac0bfa8b95/packages/@justaname.id/sdk/src/lib/features/subnames/index.ts#L219)

***

#### searchSubnames()

> **searchSubnames**(`params`): `Promise`<[`SubnameSearchResponse`](/sdk-reference/justaname-core-sdk/interfaces/subnamesearchresponse.md)>

**Parameters**

• **params**: `Omit`<[`MakeOptionalProps`](/sdk-reference/justaname-core-sdk/type-aliases/makeoptionalprops.md)<[`SubnameSearchRequest`](/sdk-reference/justaname-core-sdk/interfaces/subnamesearchrequest.md), `"chainId"`>, `never`>

**Returns**

`Promise`<[`SubnameSearchResponse`](/sdk-reference/justaname-core-sdk/interfaces/subnamesearchresponse.md)>

**Defined in**

[packages/@justaname.id/sdk/src/lib/features/subnames/index.ts:383](https://github.com/JustaName-id/JustaName-sdk/blob/dc845c10af242e3ca87d95ef392516ac0bfa8b95/packages/@justaname.id/sdk/src/lib/features/subnames/index.ts#L383)

***

#### updateSubname()

> **updateSubname**(`params`, `headers`): `Promise`<[`SubnameResponse`](/sdk-reference/justaname-core-sdk/interfaces/subnameresponse.md)>

**Parameters**

• **params**: `Omit`<[`MakeOptionalProps`](/sdk-reference/justaname-core-sdk/type-aliases/makeoptionalprops.md)<[`SubnameUpdateRequest`](/sdk-reference/justaname-core-sdk/interfaces/subnameupdaterequest.md), `"chainId"` | `"ensDomain"`>, `"addresses"` | `"text"`> & `object`

• **headers**: [`SIWEHeaders`](/sdk-reference/justaname-core-sdk/interfaces/siweheaders.md)

**Returns**

`Promise`<[`SubnameResponse`](/sdk-reference/justaname-core-sdk/interfaces/subnameresponse.md)>

**Defined in**

[packages/@justaname.id/sdk/src/lib/features/subnames/index.ts:188](https://github.com/JustaName-id/JustaName-sdk/blob/dc845c10af242e3ca87d95ef392516ac0bfa8b95/packages/@justaname.id/sdk/src/lib/features/subnames/index.ts#L188)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.justaname.id/sdk-reference/justaname-core-sdk/classes/subnames.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
