/lnrjs

A library to deal with lnr domains

Primary LanguageTypeScriptGNU General Public License v2.0GPL-2.0

lnrjs

npm npm bundle size npm

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

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 (
        <LnrConfigProvider config={config}>
            <Component {...pageProps} />
        </LnrConfigProvider>
    )
}

Using the hooks

import { useLnrGetName, useLnrGetAddress } from "lnrjs;

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