@cronosid/croidjs

1.0.0 • Public • Published

Overview of the API

Setup

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



const croid = new CROID({ provider, croidAddress: getCroidAddress('25') })

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

exports

default - CROID
getCroidAddress
getResolverContract
getCROIDContract
namehash
labelhash

CROID Interface

name(name: String) => Name

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

resolver(address: CronosAddress) => Resolver

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

async getName(address: CronosAddress) => Promise<Name>

Returns the reverse record for a particular Cronos address.

Name Interface

async getOwner() => Promise<CronosAddress>

Returns the owner/controller for the current CROID name.

async getResolver() => Promise<CronosAddress>

Returns the resolver for the current CROID name.

async getAddress(coinId: String) => Promise<CronosAddress>

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

async getContent() => Promise<ContentHash>

Returns the contentHash for the current CROID name.

async getText(key: String) => Promise<String>

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

Resolver Interface

address

Static property that returns current resolver address

name(name) => Name

Returns a Name Object that hardcodes the resolver

/@cronosid/croidjs/

    Package Sidebar

    Install

    npm i @cronosid/croidjs

    Weekly Downloads

    15

    Version

    1.0.0

    License

    ISC

    Unpacked Size

    360 kB

    Total Files

    16

    Last publish

    Collaborators

    • cronosid