1.0.4 • Published 1 year ago
lnrjs v1.0.4
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
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");