@catalystdigital/avax-domain-sdk
v1.0.4
Published
This package provides functionality for looking up avax domains with a given address.
Downloads
9
Readme
Introduction
This package provides functionality for looking up avax domains with a given address.
Installation
npm i --save @catalystdigital/avax-domain-sdk
Usage
Quick start
Lookup Resolution
Lookup the .avax/.fire for an EVM / C-Chain address:
import getUsernameForAddress from "@catalystdigital/avax-domain-sdk";
const main = async () => {
const address = "<your-address-here>";
const avaxDomain = await lookupDotAvax(address);
const fireDomain = await lookupDotfire(address);
console.log("AVAX Domain:", avaxDomain);
console.log("FIRE Domain:", fireDomain);
};
main();
Hierarchy Resolution
Use the .avax if it exists, if not use the .fire, if not use the EVM / C-Chain address:
import getUsernameForAddress from "@catalystdigital/avax-domain-sdk";
const main = async () => {
const address = "<your-address-here>";
const username = await getUsernameForAddress(address);
console.log("Username:", username);
};
main();
Resolve Domain Resolution
Turn a .avax/.fire name into an EVM / C-Chain address:
import getUsernameForAddress from "@catalystdigital/avax-domain-sdk";
const main = async () => {
const avaxDomain = "<your-domain-here>";
const fireDomain = "<your-domain-here>";
const addressForAvax = await resolveDotAvax(avaxDomain);
const addressForFire = await resolveDotFire(fireDomain);
console.log("AVAX Domain:", addressForAvax);
console.log("FIRE Domain:", addressForFire);
};
main();