2.1.1 • Published 1 year ago
get-ens v2.1.1
get-ens
Get text records of an ENS address with ease.
This library simplifies the process of retreiving ENS data with the help of TheGraph ENS explorer and ENS TextResolver contract.
Features
- Fully Typed
- Custom ENS contract address and TheGraph endpoint support
- Reverse ENS lookup if address is passed
Install
pnpm i get-ens
Usage
Node.js
import { getDefaultProvider } from '@ethersproject/providers'
import { getENS } from 'get-ens'
import fetch from 'node-fetch'
const provider = getDefaultProvider()
// @ts-ignore
globalThis.fetch = fetch
const { address, records, owner } = await getENS({ provider })('foda.eth')
/*
{
address: '0xf75ed978170dfa5ee3d71d95979a34c91cd7042e',
owner: '0xf75ed978170dfa5ee3d71d95979a34c91cd7042e',
records: {
avatar: 'https://slate.textile.io/ipfs/bafkreiddogjj5m6nhru72cqvj7napv3knwyqcvxlfxu4axkwhhlg55t5cu',
color: '#f0da91',
description: 'ⓕ™',
email: 'foda@just.is',
url: 'https://asf.is',
web: {
github: 'https://github.com/a-s-f',
instagram: 'https://instagram.com/foda.farm',
twitter: 'twitter.com/fodasynthesis'
}
}
}
*/
Deno
import { getENS } from 'https://esm.sh/get-ens'
import { getDefaultProvider } from 'https://esm.sh/@ethersproject/providers'
const provider = getDefaultProvider()
const { address, records, owner } = await getENS({ provider })('foda.eth')
2.1.1
1 year ago
2.1.0
1 year ago
2.0.3
2 years ago
2.0.2
2 years ago
2.0.1
3 years ago
2.0.0
3 years ago
1.0.2
3 years ago
1.0.1
3 years ago
1.0.0
3 years ago
0.2.1
3 years ago
0.1.6
3 years ago
0.1.0
3 years ago
0.1.2
3 years ago
0.0.3
3 years ago
0.1.1
3 years ago
0.1.4
3 years ago
0.1.5
3 years ago
0.0.1
3 years ago
0.0.0
3 years ago