An open API service indexing awesome lists of open source software.

https://github.com/oscgu/lnrjs

A library to deal with lnr domains
https://github.com/oscgu/lnrjs

domains ethereum

Last synced: 3 months ago
JSON representation

A library to deal with lnr domains

Awesome Lists containing this project

README

          

# lnrjs

![npm](https://img.shields.io/npm/v/lnrjs)
![npm bundle size](https://img.shields.io/bundlephobia/min/lnrjs)
![npm](https://img.shields.io/npm/dw/lnrjs)

A small react library with some useful hooks for dealing with LNR domains

## Installation

`yarn add lnrjs`

## Getting started

You can use the hooks as they are, if you dont mind the rate limit of the
public provider being used. See below how to change that.

`_app.tsx`
```typescript
import type { AppProps } from 'next/app'
import { LnrConfigProvider, LnrConfig } from "lnrjs";

export default function App({ Component, pageProps }: AppProps) {
const config: LnrConfig = {
provider: new ethers.providers.AlchemyProvider(1, "your-api-key")
};

return (



)
}
```

## Using the hooks

```typescript
import { useLnrGetName, useLnrGetAddress } from "lnrjs;

const { name } = useLnrGetName("0x...");
const { address } = useLnrGetAddress("name.og");
```