# @testprotocol/reverse-records

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

Latest version **1.0.4** (published 2022-12-12) · ISC license · 0 weekly downloads

## Install

```sh
npm install @testprotocol/reverse-records
pnpm add @testprotocol/reverse-records
yarn add @testprotocol/reverse-records
bun add @testprotocol/reverse-records
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.4 |
| Published | 2022-12-12 |
| First published | 2022-12-12 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 5 |
| Unpacked size | 44.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | testprotocol |

## Links

- npm: https://www.npmjs.com/package/@testprotocol/reverse-records
- Repository: https://github.com/TestProtocol/reverse-records
- Homepage: https://github.com/TestProtocol/reverse-records#readme
- Issues: https://github.com/TestProtocol/reverse-records/issues
- npm.io page: https://npm.io/package/@testprotocol/reverse-records

## Dependencies (5)

- [web3](https://npm.io/package/web3.md) ^1.8.1
- [tslib](https://npm.io/package/tslib.md) ^2.4.1
- [web3-utils](https://npm.io/package/web3-utils.md) ^1.8.1
- [@testprotocol/avatar](https://npm.io/package/@testprotocol/avatar.md) ^1.0.6
- [@ensdomains/eth-ens-namehash](https://npm.io/package/@ensdomains/eth-ens-namehash.md) ^2.0.15

## Recent versions

- 1.0.4 (latest) — 2022-12-12
- 1.0.2 — 2022-12-12
- 1.0.1 — 2022-12-12
- 1.0.0 — 2022-12-12

## README

# @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

```bash
# npm
npm install @testprotocol/reverse-records

# yarn
yarn add @testprotocol/reverse-records
```

### Usage

```js
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.

```js
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.

```js
async getReverse(address: string) => Promise< { name: string; avatar: null; } | { name: string; avatar: string; } | null >;
```

---
_Source: https://npm.io/package/@testprotocol/reverse-records · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
