> For the complete documentation index, see [llms.txt](https://docs.thoth.id/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.thoth.id/sdk-reference.md). Agents can also search and read this documentation through its [MCP server](https://docs.thoth.id/~gitbook/mcp).

# SDK Reference

Every class and method in the thoth.id SDK, with parameters, return values and examples.

Start with a group, or jump to a method in the table below. Upgrading from v2? Read [Migrating from v2](https://docs.thoth.id/sdk-reference/migrating-from-v2.md).

The SDK works on mainnet (the default) and testnet: pass `{ network: "testnet" }` to the [constructor](https://docs.thoth.id/sdk-reference/object-management/constructor.md) for testnet.

Install the SDK from [npm](https://www.npmjs.com/package/thoth-id-sdk) with `npm install thoth-id-sdk`. See the [Quickstart](https://docs.thoth.id/getting-started/quickstart.md) for setup.

<table data-view="cards"><thead><tr><th></th><th></th><th data-hidden data-card-target data-type="content-ref"></th><th data-hidden data-card-cover data-type="image">Cover image</th></tr></thead><tbody><tr><td><strong>Object Management</strong></td><td>Create the SDK instance and point it at a node and contract.</td><td><a href="https://docs.thoth.id/sdk-reference/object-management.md">Object Management</a></td><td><a href="https://2559695096-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8NQqK3W76Bj7LGhFgkFC%2Fuploads%2FKFy8Ow8dfR18RndJojBR%2Fsdk-group-01.jpg?alt=media&amp;token=fc18d24f-656d-4d96-8b65-1d95f18c2ba8">sdk-group-01.jpg</a></td></tr><tr><td><strong>Name Methods</strong></td><td>Resolve, validate and inspect names and their owners.</td><td><a href="https://docs.thoth.id/sdk-reference/name-methods.md">Name Methods</a></td><td><a href="https://2559695096-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8NQqK3W76Bj7LGhFgkFC%2Fuploads%2FkEtw1UK9vMKCk8acJrak%2Fsdk-group-02.jpg?alt=media&amp;token=7851634e-dc38-4e2e-8d78-2488196b8fb7">sdk-group-02.jpg</a></td></tr><tr><td><strong>Contract &#x26; Fees</strong></td><td>Fees and multipliers, plus the contract's domain, managers and profile limits.</td><td><a href="https://docs.thoth.id/sdk-reference/fee-information.md">Fee Information</a></td><td><a href="https://2559695096-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8NQqK3W76Bj7LGhFgkFC%2Fuploads%2FH66wzSpzEDbPFIxHpVes%2Fsdk-group-contract-fees.jpg?alt=media&amp;token=9460a70a-cc99-4ade-a644-910b7a0a9e5d">sdk-group-contract-fees.jpg</a></td></tr></tbody></table>

## Classes

### ThothIdSDK

The main class for interacting with the thoth.id nano contracts.

## Methods

| Method                                                                                                             | Description                                                                   |
| ------------------------------------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------- |
| [`constructor`](https://docs.thoth.id/sdk-reference/object-management/constructor.md)                              | Creates a new instance of the SDK.                                            |
| [`loadContractIds`](https://docs.thoth.id/sdk-reference/object-management/loadcontractids.md)                      | Collects the map of domain suffixes and contract IDs from the node.           |
| [`refreshContractIds`](https://docs.thoth.id/sdk-reference/object-management/refreshcontractids.md)                | Discards the cached map and collects it again.                                |
| [`exportContractIds`](https://docs.thoth.id/sdk-reference/object-management/exportcontractids.md)                  | Returns a copy of the cached map, to save and reuse later.                    |
| [`setContractIds`](https://docs.thoth.id/sdk-reference/object-management/setcontractids.md)                        | Seeds the instance with a previously saved map.                               |
| [`getDomains`](https://docs.thoth.id/sdk-reference/object-management/getdomains.md)                                | Lists the domain suffixes the instance knows about.                           |
| [`getContractIdForDomain`](https://docs.thoth.id/sdk-reference/object-management/getcontractidfordomain.md)        | Returns the cached contract ID of a domain suffix.                            |
| [`getBlockedDomains`](https://docs.thoth.id/sdk-reference/object-management/getblockeddomains.md)                  | Lists the domains whose registry runs an untrusted blueprint.                 |
| [`setNetwork`](https://docs.thoth.id/sdk-reference/object-management/setnetwork.md)                                | Switches to another network's node and blueprints (testnet or mainnet).       |
| [`setNodeUrl`](https://docs.thoth.id/sdk-reference/object-management/setnodeurl.md)                                | Sets the Hathor full-node URL.                                                |
| [`setContractId`](https://docs.thoth.id/sdk-reference/object-management/setcontractid.md)                          | Sets a specific contract ID to be used for all calls.                         |
| [`setBlueprintIds`](https://docs.thoth.id/sdk-reference/object-management/setblueprintids.md)                      | Sets the blueprint IDs used to discover and trust domain contracts.           |
| [`setBlueprintId`](https://docs.thoth.id/sdk-reference/object-management/setblueprintid.md)                        | Sets a single blueprint ID; shorthand for setBlueprintIds.                    |
| [`isNameAvailable`](https://docs.thoth.id/sdk-reference/name-methods/isnameavailable.md)                           | Checks if a name is available to be registered.                               |
| [`resolveName`](https://docs.thoth.id/sdk-reference/name-methods/resolvename.md)                                   | Resolves a name to its associated wallet address.                             |
| [`getNameData`](https://docs.thoth.id/sdk-reference/name-methods/getnamedata.md)                                   | Retrieves the raw data associated with a name.                                |
| [`getProfileData`](https://docs.thoth.id/sdk-reference/name-methods/getprofiledata.md)                             | Retrieves the profile data associated with a name.                            |
| [`getNameOwner`](https://docs.thoth.id/sdk-reference/name-methods/getnameowner.md)                                 | Gets the owner's address for a given name.                                    |
| [`getNameExpirationInfo`](https://docs.thoth.id/sdk-reference/name-methods/getnameexpirationinfo.md)               | Gets expiration information for a name.                                       |
| [`getNameExpirationDate`](https://docs.thoth.id/sdk-reference/name-methods/getnameexpirationdate.md)               | Gets the exact expiration date of a name.                                     |
| [`validateName`](https://docs.thoth.id/sdk-reference/name-methods/validatename.md)                                 | Validates the format of a name.                                               |
| [`checkNameOwnership`](https://docs.thoth.id/sdk-reference/name-methods/checknameownership.md)                     | Checks if a given address owns a name.                                        |
| [`checkNameStatus`](https://docs.thoth.id/sdk-reference/name-methods/checknamestatus.md)                           | Checks the current status of a name (e.g., active, expired).                  |
| [`getFeeInfo`](https://docs.thoth.id/sdk-reference/fee-information/getfeeinfo.md)                                  | Gets information about the fees for a name.                                   |
| [`calculateFee`](https://docs.thoth.id/sdk-reference/fee-information/calculatefee.md)                              | Calculates the registration or renewal fee for a name.                        |
| [`getFeeMultiplier`](https://docs.thoth.id/sdk-reference/fee-information/getfeemultiplier.md)                      | Gets the fee multiplier for a name of a certain length for a given domain.    |
| [`getFeeStructure`](https://docs.thoth.id/sdk-reference/fee-information/getfeestructure.md)                        | Retrieves the entire fee structure of a specific contract.                    |
| [`getManagerNames`](https://docs.thoth.id/sdk-reference/contract-information/getmanagernames.md)                   | Gets all names managed by a specific address on a given domain.               |
| [`getManagerPrimaryName`](https://docs.thoth.id/sdk-reference/contract-information/getmanagerprimaryname.md)       | Gets the primary name set for a manager address on a given domain.            |
| [`getDevAddress`](https://docs.thoth.id/sdk-reference/contract-information/getdevaddress.md)                       | Gets the developer address of the contract for a given domain.                |
| [`getContractDomain`](https://docs.thoth.id/sdk-reference/contract-information/getcontractdomain.md)               | Gets the domain of the contract (e.g., `.htr`).                               |
| [`getGracePeriodDays`](https://docs.thoth.id/sdk-reference/contract-information/getgraceperioddays.md)             | Gets the grace period for name renewals for a given domain.                   |
| [`getMaxProfileDataEntries`](https://docs.thoth.id/sdk-reference/contract-information/getmaxprofiledataentries.md) | Gets the maximum number of data entries in a profile for a given domain.      |
| [`getMaxProfileKeyLength`](https://docs.thoth.id/sdk-reference/contract-information/getmaxprofilekeylength.md)     | Gets the maximum length of a profile data key for a given domain.             |
| [`getMaxProfileValueLength`](https://docs.thoth.id/sdk-reference/contract-information/getmaxprofilevaluelength.md) | Gets the maximum length of a profile data value for a given domain.           |
| [`getMaxTokenSymbolLength`](https://docs.thoth.id/sdk-reference/contract-information/getmaxtokensymbollength.md)   | Gets the maximum length of a token symbol for a given domain.                 |
| [`getMaxTotalProfileSize`](https://docs.thoth.id/sdk-reference/contract-information/getmaxtotalprofilesize.md)     | Gets the maximum total size of a profile for a given domain.                  |
| [`validateKeyFormat`](https://docs.thoth.id/sdk-reference/misc/validatekeyformat.md)                               | Validates the format of a key-value pair for profile data for a given domain. |
| [`callMultiple`](https://docs.thoth.id/sdk-reference/misc/callmultiple.md)                                         | Allows making multiple view calls to a specific contract in a single request. |
| [`callMultipleSettled`](https://docs.thoth.id/sdk-reference/misc/callmultiplesettled.md)                           | Like callMultiple, but returns each call's own outcome.                       |
