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.
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
npm i @me3/lens-resolverThis library only works in Node and has only been tested on v16.13.0. We suggest
you use nvm.
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- support address resolving
- provide pre- & post-loading hooks to support key/value manipulation
