Skip to content

electroneum/ensjs

 
 

Repository files navigation

ENSjs for Electroneum

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

This is the electroneum/ensjs fork of ensdomains/ensjs, adapted for Electroneum ENS: the registrar TLD is .etn and the supported chain is Electroneum testnet (electroneumTestnet, chain id 5201420). The companion contracts live in electroneum/ens-contracts and are published as @etn-sc/ens-contracts.

Features

  • Super fast response times
  • Easy call batchability
  • Written in TypeScript
  • Full tree-shaking support

Installation

Install @etn-sc/ensjs, alongside viem.

npm install @etn-sc/ensjs viem

Getting Started

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

// Import viem transport, viem chain, and ENSjs
import { http } from 'viem'
import { electroneumTestnet } from 'viem/chains'
import { createEnsPublicClient } from '@etn-sc/ensjs'

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

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

Note: there is no ENS subgraph for Electroneum yet, so the /subgraph functions are not usable until one is deployed.

Docs

Docs can be found in the upstream repo here — the API is identical apart from the .etn TLD and supported chains.

About

ENS JavaScript library for contract interaction

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • TypeScript 94.9%
  • JavaScript 5.1%