A combination of Dentity and ENS domains to verify basic information for ENS domain owners.
npm i @dentity/ens-clientThe simplest example is to get all verifcations shared by Dentity users with their ENS domain. You can easily get all those verifications by initially add to their ENS domain.
import{EnsPublicClient,createEnsPublicClient}from'@ensdomains/ensjs';import{CredentialTemplate,EnsDentityClient}from'@dentity/ens-client';import{http}from'viem';import{mainnet}from'viem/chains';constclient=createEnsPublicClient({chain: mainnet,// Configure your faucet url heretransport: http(''),})asEnsPublicClient;EnsDentityClient.initialize(clientasany,'alice.eth').then((ensClient)=>{// Get ethereum address of this ENS domain constaddress=ensClient.getEthAddress();console.log('ENS Address:',address);// Get all Dentity verifications of this ENS domainconstverifications=ensClient.getVerifications();console.log('verifications:',verifications);});Currently Dentity is supporting sharing a number of verification types for ENS domain. You can specifically get any verification by passing in a specific credential template. You can then verify the correctness of that verification.
import{EnsPublicClient,createEnsPublicClient}from'@ensdomains/ensjs';import{CredentialTemplate,DentityEnsClient}from'@dentity/ens-client';import{http}from'viem';import{mainnet}from'viem/chains';constclient=createEnsPublicClient({chain: mainnet,// Provider url heretransport: http(''),})asEnsPublicClient;DentityEnsClient.initialize(clientasany,'alice.eth').then((ensClient)=>{// Get ethereum addressconstaddress=ensClient.getEthAddress();console.log('ENS Address:',address);constverifications=ensClient.getVerifications();console.log('verifications:',verifications);// Get credential based on credential template typeconstdiscordVerification=ensClient.getSpecificVerification(CredentialTemplate.Discord,);console.log('discordVerification',discordVerification);DentityEnsClient.verifyVerification(discordVerification).then((verifyVerificationResult)=>{console.log('verifyVerificationResult',verifyVerificationResult);},);});We currently support some of the following CredentialTemplates:
| Template | Description |
|---|---|
Discord | The information is shared from Discord. |
X | The information is shared from X. |
Email | Email of this ENS domain. |
Telegram | The information is shared from Telegram. |
Personhood | The state or fact of ENS domain owner of being an individual or having human characteristics. |
We have 2 examples for both ReactJS and NodeJS applications. You can go to examples folder to see and know the basic concept and how to use it.
We welcome issue reports if any and pull requests for further improvement.