fetchProfileLists

Fetches all lists associated with a given address or ENS name.

Usage

import { fetchProfileLists } from 'ethereum-identity-kit'
// For server-side usage
import { fetchProfileLists } from 'ethereum-identity-kit/utils'
 
const lists = await fetchProfileLists('vitalik.eth')
// or with fresh data
const freshLists = await fetchProfileLists('vitalik.eth', true)

Parameters

ParameterTypeDescription
addressOrNamestringEthereum address or ENS name to fetch lists for
freshbooleanOptional flag to fetch fresh data bypassing cache

Return Value

Returns a ProfileListsResponse object containing:

  • primary_list: The primary list number (or null if none)
  • lists: Array of all lists associated with the address

Example Response

{
  primary_list: "123",
  lists: [
    "123",
    "456",
  ]
}