Quickstart
(Very fast) quickstart
This is an example of simple usage of thoth.id Sdk:
import { ThothIdSDK } from "thoth-id-sdk";
async function main() {
// ... code ...
const sdk = new ThothIdSDK();
await sdk.loadContractIds();
const walletAddr = await sdk.resolveName("example.htr");
// --- more code
}
main();For more information read other sections.
Overview
First, import and instantiate the Sdk. The Sdk is configured by default to connect to the main Hathor network and the main thoth.id contract API.
After creating an instance of the Sdk, you must call loadContractIds() to fetch the map of available domain suffixes and their corresponding contract IDs. It must be done because the Sdk does not store information about Hathor Network Contract Ids.
It is possible to change nodeUrl and contractApiUrl, but we recommend using the default values. Custom URLs are intended primarily for testing purposes.
Using a specific contractId (for testing) 🧪
contractId (for testing) 🧪For testing or development purposes, you can instantiate the Sdk with a specific contractId. This will bypass the contract resolution from the contractApiUrl and force the Sdk to use the provided contractId for all calls.
The next section will show examples of usage.
Last updated

