JSPM

@ensdomains/ensjs

4.0.3-alpha.12
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 44577
  • Score
    100M100P100Q161178F
  • License MIT

ENS javascript library for contract interaction

Package Exports

  • @ensdomains/ensjs
  • @ensdomains/ensjs/contracts
  • @ensdomains/ensjs/dns
  • @ensdomains/ensjs/package.json
  • @ensdomains/ensjs/public
  • @ensdomains/ensjs/subgraph
  • @ensdomains/ensjs/utils
  • @ensdomains/ensjs/wallet

Readme

ENSjs

The ultimate ENS javascript library, with viem under the hood.

Features

  • Super fast response times
  • Easy call batchability
  • Written in TypeScript
  • Supports the most cutting edge ENS features
  • Full tree-shaking support

Installation

Install @ensdomains/ensjs, alongside viem.

npm install @ensdomains/ensjs viem

Getting Started

The most simple way to get started is to create a public ENS client, with a supported chain and transport imported from viem. The public client has all the read functions available on it, as well as all subgraph functions.

// Import viem transport, viem chain, and ENSjs
import { http } from 'viem'
import { mainnet } from 'viem/chains'
import { createEnsPublicClient } from '@ensdomains/ensjs'

// Create the client
const client = createEnsPublicClient({
  chain: mainnet,
  transport: http(),
})

// Use the client
const ethAddress = client.getAddressRecord({ name: 'ens.eth' })

Docs

Docs can be found here. Full docs site coming soon.