Profile

The profile module provides utility functions for handling profile-related operations.

Import

import { defaultOnStatClick } from 'ethereum-identity-kit'
 
// For server side usage
import { defaultOnStatClick } from 'ethereum-identity-kit/utils'

Functions

defaultOnStatClick

Opens a new tab with the EFP profile page for a given address or ENS name, focusing on a specific stat tab.

defaultOnStatClick({
  addressOrName: 'vitalik.eth',
  stat: 'followers',
})

Parameters

ParameterTypeDescription
addressOrNamestringEthereum address or ENS name to open the profile for
statstringThe stat tab to focus on in the profile page

Behavior

The function:

  1. Opens a new tab with the URL https://efp.app/{addressOrName}?tab={stat}
  2. Uses noopener,noreferrer for security when opening the new tab

Example

// Opens https://efp.app/vitalik.eth?tab=followers in a new tab
defaultOnStatClick({
  addressOrName: 'vitalik.eth',
  stat: 'followers',
})