Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/talentlessguy/get-ens
🗝️ Get text records of an ENS address with ease
https://github.com/talentlessguy/get-ens
blockchain ens ethereum
Last synced: 29 days ago
JSON representation
🗝️ Get text records of an ENS address with ease
- Host: GitHub
- URL: https://github.com/talentlessguy/get-ens
- Owner: talentlessguy
- License: mit
- Created: 2021-08-11T17:24:09.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2023-01-25T16:46:32.000Z (almost 2 years ago)
- Last Synced: 2024-10-02T08:31:04.020Z (about 1 month ago)
- Topics: blockchain, ens, ethereum
- Language: TypeScript
- Homepage:
- Size: 190 KB
- Stars: 39
- Watchers: 3
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
- awesome-node-esm - get-ens - Get text records of an ENS address (Packages / Ethereum)
README
# get-ens
[![Version][v-badge-url]][npm-url] [![Downloads][dl-badge-url]][npm-url] [![GitHub Workflow Status][gh-actions-img]][github-actions] [![Codecov][cov-badge-url]][cov-url] [![][docs-badge]][docs]
Get text records of an [ENS](app.ens.domains) address with ease.
This library simplifies the process of retreiving ENS data with the help of [TheGraph ENS explorer](https://thegraph.com/explorer/subgraph/ensdomains/ens) and ENS [TextResolver](https://github.com/ensdomains/ens-contracts/blob/master/contracts/resolvers/profiles/TextResolver.sol) contract.
## Features
- Fully Typed
- Custom ENS contract address and TheGraph endpoint support
- Reverse ENS lookup if address is passed## Install
```sh
pnpm i get-ens
```## Usage
### Node.js
```ts
import { getDefaultProvider } from '@ethersproject/providers'
import { getENS } from 'get-ens'
import fetch from 'node-fetch'const provider = getDefaultProvider()
// @ts-ignore
globalThis.fetch = fetchconst { address, records, owner } = await getENS({ provider })('foda.eth')
/*
{
address: '0xf75ed978170dfa5ee3d71d95979a34c91cd7042e',
owner: '0xf75ed978170dfa5ee3d71d95979a34c91cd7042e',
records: {
avatar: 'https://slate.textile.io/ipfs/bafkreiddogjj5m6nhru72cqvj7napv3knwyqcvxlfxu4axkwhhlg55t5cu',
color: '#f0da91',
description: 'ⓕ™',
email: '[email protected]',
url: 'https://asf.is',
web: {
github: 'https://github.com/a-s-f',
instagram: 'https://instagram.com/foda.farm',
twitter: 'twitter.com/fodasynthesis'
}
}
}
*/
```### Deno
```ts
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')
```[v-badge-url]: https://img.shields.io/npm/v/get-ens.svg?style=for-the-badge&color=4D48F7&label=&logo=npm
[npm-url]: https://www.npmjs.com/package/get-ens
[cov-badge-url]: https://img.shields.io/coveralls/github/talentlessguy/get-ens?style=for-the-badge&color=4D48F7
[cov-url]: https://coveralls.io/github/talentlessguy/get-ens
[dl-badge-url]: https://img.shields.io/npm/dt/get-ens?style=for-the-badge&color=4D48F7
[github-actions]: https://github.com/talentlessguy/get-ens/actions
[gh-actions-img]: https://img.shields.io/github/actions/workflow/status/talentlessguy/get-ens/main.yml?branch=master&style=for-the-badge&color=4D48F7
[docs-badge]: https://img.shields.io/badge/Docs-4D48F7?style=for-the-badge&logo=deno
[docs]: https://doc.deno.land/https/esm.sh/get-ens