Integrating using our SDK

How to access our domain SDK?

You can access the package at this link: https://www.npmjs.com/package/@cronosid/croidjs?activeTab=code

How to set up the Domain SDK?

Before you can begin interacting with Cronos ID, you will need to obtain a reference to the CROID registry.

import CROID, { getCroidAddress } from '@cronosid/croidjs'



const croid = new CROID({ provider, croidAddress: getCroidAddress('25') }) // Cronos Mainnet Chain Id

croid.name('cronos.cro').getAddress() // 0x123

Resolving a name to a Cronos address

var address = await croid.name('cronos.cro').getAddress();

Reverse Resolution

While 'regular' resolution involves mapping from a name to an address, reverse resolution maps from an address back to a name. Cronos ID supports reverse resolution to allow applications to display Cronos ID names in place of hexadecimal addresses.

Exports

CROID Interface

  • Returns a Name Object, that allows you to make record queries.

  • Returns a Resolver Object, allowing you to query names from this specific resolver. Most useful when querying a different resolver that is different than is currently recorded on the registry. E.g. migrating to a new resolver

  • Returns the reverse record for a particular Cronos address.

Name Interface

  • Returns the owner/controller for the current CROID name.

  • Returns the resolver for the current CROID name.

  • Returns the address for the current CROID name for the coinId provided.

  • Returns the contentHash for the current CROID name.

  • Returns the text record for a given key for the current CROID name.

Resolver Interface

  • Static property that returns current resolver address

  • Returns a Name Object that hardcodes the resolver

Who should I contact for support?

If you have any questions about the integration with Cronos ID Domain, drop us a message on our Discord server and we will get in touch with you!

Last updated