sns-namechecker

1.1.8 • Public • Published

SNS-NameChecker

A library created to allow new dapp developers on Shibarium to integrate SNS. The functions allow to retrieve:

  • The primary domain from an address
  • The address that a domain belongs to
  • The records (if set) of a domain

Installation

npm install sns-namechecker

Importing the library

import {
  resolveName,
  resolveAddress,
  getRecord,
  getNFTs,
} from "sns-namechecker";

Example Usage

const domain = await resolveAddress("elon"); // This returns an address from the domain name
const address = await resolveName("0x123456789101112131415"); // Returns a name from an address
const records = await getRecord("ryoshi"); // Returns the records of a domain
const nfts = await getNFTsByAddress(walletAddress); // Fetches all nfts the address owns

When rendering the image on the front end you will need to add the following as a prefix "data:image/svg+xml;base64,": since it returns raw svg data. Example:

<img src={`data:image/svg+xml;base64,${image}`} />

To fetch all the nfts, recent nfts, total amount of nfts

const nftInfo = await fetchAllNFTs();

Readme

Keywords

Package Sidebar

Install

npm i sns-namechecker

Weekly Downloads

1

Version

1.1.8

License

MIT

Unpacked Size

1.17 MB

Total Files

5

Last publish

Collaborators

  • yeyo8711