Skip to content
This repository was archived by the owner on Mar 21, 2024. It is now read-only.

me3-eth/lens-resolver

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LENS Resolver

Map ENS PublicResolver functions to LENS profile attributes.

This is intended to be used as part of a solution in linking CCIP/Durian/OffchainLookups from ENS resolvers to LENS protocol.

offchain-lookup-gateway

This project fits into the Green Rectangle in the diagram ("Resolve ENS functions against a datasource"), the data source being LENS protocol.

Note: does not follow ENSIP-10

Installation

npm i @me3/lens-resolver

This library only works in Node and has only been tested on v16.13.0. We suggest you use nvm.

Usage

The only mandatory configuration option is rpcUrl. Use your connection URL from your preferred RPC provider (Alchemy, Infura, self-hosted, etc)

const { utils } = require('ethers')
const resovle = require('@me3/lens-resolver)({
  network: 'mainnet', // DEFAULT
  lensUrl: 'https://api.lens.dev/', // DEFAULT
  rpcUrl: 'your.fav.rpc' // REQUIRED
})

const node = utils.namehash('charchar.eth')
const key = 'twitter'
const ensResolverFunction = 'text(bytes32,string)'

const value = await resolve(ensResolverFunction, node, key)

console.log({ value })
// returns 0xcharchar on mainnet

Roadmap

  • support address resolving
  • provide pre- & post-loading hooks to support key/value manipulation

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published