A small react library with some useful hooks for dealing with LNR domains
yarn add lnrjs
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>
)
}
import { useLnrGetName, useLnrGetAddress } from "lnrjs;
const { name } = useLnrGetName("0x...");
const { address } = useLnrGetAddress("name.og");