Socket
Book a DemoInstallSign in
Socket

@justaname.id/hybrid-primary-name

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@justaname.id/hybrid-primary-name

**Hybrid Primary Name** is a Viem extension package that enables reverse ENS resolution to fetch the primary ENS name associated with a given Ethereum address. It integrates seamlessly with both Viem's `createPublicClient` and ENS's `createEnsPublicClient

0.0.7
latest
Source
npmnpm
Version published
Weekly downloads
6
-66.67%
Maintainers
1
Weekly downloads
 
Created
Source

Hybrid Primary Name

Hybrid Primary Name is a Viem extension package that enables reverse ENS resolution to fetch the primary ENS name associated with a given Ethereum address. It integrates seamlessly with both Viem's createPublicClient and ENS's createEnsPublicClient.

Table of Contents

  • Hybrid Primary Name

Installation

Install the package via npm or yarn:

npm install @justaname.id/hybrid-primary-name
# or
yarn add @justaname.id/hybrid-primary-name

Initialization

Using Viem's createPublicClient with ENS Contracts

import { createPublicClient, http } from 'viem';
import { addEnsContracts } from '@ensdomains/ensjs';
import { mainnet, sepolia } from 'viem/chains';
import { primaryName } from '@justaname.id/hybrid-primary-name';

const client = createPublicClient({
        chain: addEnsContracts(**mainnet or sepolia**),
        transport: http(**Provider URL**),
    }).extend(primaryName())

Using ENS's createEnsPublicClient

import { http } from 'viem';
import { createEnsPublicClient } from '@ensdomains/ensjs'
import { mainnet, sepolia } from 'viem/chains';
import { primaryName } from '@justaname.id/hybrid-primary-name';

const client = createEnsPublicClient({
        chain: **mainnet or sepolia**,
        transport: http(**Provider URL**),
    }).extend(primaryName())

Usage

The getEnsFromAddress method returns the primary ENS name associated with the given Ethereum address.

await client.getEnsFromAddress(**Address**),

Keywords

ethereum

FAQs

Package last updated on 20 Dec 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.