@testprotocol/reverse-records
TypeScript icon, indicating that this package has built-in type declarations

1.0.4 • Public • Published

@testprotocol/reverse-records

Getting started

Prerequisites

  • Have your web3 provider ready (infura, etc)
  • You must have both a MATIC and ETH Provider

And you're good to go!

Installation

# npm
npm install @testprotocol/reverse-records

# yarn
yarn add @testprotocol/reverse-records

Usage

import { Reverse } from "@testprotocol/reverse-records";

const reverse = new Reverse(
  "https://polygon-mainnet.infura.io/v3/<API_KEY>", // MATIC Provider
  "https://mainnet.infura.io/v3/<API_KEY>" // ETH Provider
);

async function getName() {
  const reverseName = await avatar.getName(
    "0x123abc123abc123abc123abc123abc123abc123a"
  );
  // reverseName = example.name
}

async function getReverse() {
  const reverse = await avatar.getReverse(
    "0x123abc123abc123abc123abc123abc123abc123a"
  );
  // name = { name: "example.name" , avatar: ... }
}

Functions

getName

Returns reverse name of a given address. If the given address does not have a reverse record, it returns null.

async getName(address: string) => Promise<string | null>;

getReverse

Returns an object with the reverse name and the avatar. If the given address does not have a reverse record, it returns null.

async getReverse(address: string) => Promise< { name: string; avatar: null; } | { name: string; avatar: string; } | null >;

Readme

Keywords

none

Package Sidebar

Install

npm i @testprotocol/reverse-records

Weekly Downloads

1

Version

1.0.4

License

ISC

Unpacked Size

45.3 kB

Total Files

20

Last publish

Collaborators

  • testprotocol