@alph-name-service/ans-sdk
TypeScript icon, indicating that this package has built-in type declarations

0.1.0 • Public • Published

ANS-SDK

JS/TS SDK for integrating the Alephium Name Service protocol.

Install

npm install @alph-name-service/ans-sdk

Usage

const ans = new ANS("mainnet");
const testProfile = await ans.getProfile("<address>");
// returns {name: "...", imgUri: "..."}
// if profile exists, undefined otherwise
const testRecord = await ans.getRecord("<name>");
// returns {owner: ..., manager: ..., ttl: ...}
// if name exists, undefined otherwise
const resolvedAddress = await ans.resolveName("<name>");
// returns the resolved address string
// if name exists, undefined otherwise
console.log({ resolvedAddress, testProfile, testRecord });

Readme

Keywords

Package Sidebar

Install

npm i @alph-name-service/ans-sdk

Weekly Downloads

13

Version

0.1.0

License

MIT

Unpacked Size

84.7 kB

Total Files

6

Last publish

Collaborators

  • alph-names