Package Exports
- xype-resolver
- xype-resolver/lib/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (xype-resolver) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
🚀🚀 xype-resolver 🚀🚀
XYPE Domain Name Resolver Library
Install
npm install xype-resolver
Usage
Import and initialization
import { XypeResolver } from 'xype-resolver';
const xypeResolver = await XypeResolver.init(RPC_NODE);
Name resolution
- This function should be used when the input is a human readable name or alias like
alex.sxt
. The sample code:
const addr = await xypeResolver.resolveName('alex.sxt');
Lookup the address
- This function performs reverse resolution returning the primary alias of the given address. Typically it is used when the Ethereum account is connected to the dApp. The sample code:
const addr = await xypeResolver.lookupAddress(
'0x084B5B4967b6EaB4EeDc628C12c7E63292cD5FC6'
);
Running tests
npm run test