@alph-name-service/ans-sdk
Version:
SDK for integrating with the Alephium Name Service protocol
26 lines (20 loc) • 679 B
Markdown
JS/TS SDK for integrating the Alephium Name Service protocol.
```
npm install @alph-name-service/ans-sdk
```
```js
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 });
```