@ensdomains/ensjs
TypeScript icon, indicating that this package has built-in type declarations

3.7.0 • Public • Published

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.

/@ensdomains/ensjs/

    Package Sidebar

    Install

    npm i @ensdomains/ensjs

    Weekly Downloads

    25,031

    Version

    3.7.0

    License

    MIT

    Unpacked Size

    2.44 MB

    Total Files

    906

    Last publish

    Collaborators

    • davidchu
    • taytems
    • makoto_inoue
    • decanus
    • nickjohnson
    • jefflau
    • mdt.
    • leeondamiky