The PNS javascript library, with ethers.js under the hood.
DISCLAMER: This repo is currently under active development and is not ready to be used in production
Install @pnslabs/pnsjs, alongside ethers.
npm install @pnslabs/pnsjs ethers
All that's needed to get started is an ethers or web3 provider instance. To create a new PNS instance, you have to pass it in the PNS constructor.
import { PNS } from '@pnslabs/pnsjs';
import { ethers } from 'ethers';
let rpcUrl = 'https://mainnet.infura.io/v3/your-api-key';
const provider = new ethers.providers.JsonRpcProvider(rpcUrl);
const signer = provider.getSigner()
const PNSInstance = new PNS(signer);