https://github.com/ensdomains/ensjs
ENS javascript library for contract interaction
https://github.com/ensdomains/ensjs
Last synced: about 1 month ago
JSON representation
ENS javascript library for contract interaction
- Host: GitHub
- URL: https://github.com/ensdomains/ensjs
- Owner: ensdomains
- License: mit
- Created: 2022-03-16T04:21:31.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2025-01-13T18:22:57.000Z (3 months ago)
- Last Synced: 2025-03-12T03:04:03.837Z (about 1 month ago)
- Language: TypeScript
- Size: 335 MB
- Stars: 136
- Watchers: 18
- Forks: 63
- Open Issues: 16
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-web3 - ensjs - Javascript bindings for the Ethereum Name Service. (Software Development / JavaScript)
README
# 
The ultimate ENS javascript library, with [viem](https://github.com/wagmi-dev/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](https://github.com/wagmi-dev/viem).
```sh
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.```ts
// 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](https://github.com/ensdomains/ensjs-v3/tree/main/docs). Full docs site coming soon.