fetchProfileEFPPoaps

Fetches EFP POAPs (Proof of Attendance Protocol) badges for a given address, ENS name, or list.

Usage

import { fetchProfileEFPPoaps } from 'ethereum-identity-kit'
// For server-side usage
import { fetchProfileEFPPoaps } from 'ethereum-identity-kit/utils'
 
const poaps = await fetchProfileEFPPoaps('vitalik.eth')
// or for a list
const listPoaps = await fetchProfileEFPPoaps('0x...', 1)
// or with fresh data
const freshPoaps = await fetchProfileEFPPoaps('vitalik.eth', undefined, true)

Parameters

ParameterTypeDescription
addressOrNameAddress | string | nullEthereum address or ENS name to fetch POAPs for
listnumber | nullOptional list number to fetch POAPs for
freshbooleanOptional flag to fetch fresh data bypassing cache

Return Value

Returns an array of ProfileEFPPoapResponse objects containing POAP badges, or an empty array if the request fails.

Example Response

;[
  {
    eventId: '123',
    participated: 'EFP Early Adopter',
    collection: {
      event: {
        id: 123,
        fancy_id: 'EFP Early Adopter',
        name: 'EFP Early Adopter',
        event_url: 'https://example.com',
        image_url: 'https://example.com/image.png',
        country: 'United States',
        city: 'San Francisco',
        description: 'EFP Early Adopter',
        year: 2021,
        start_date: '2021-01-01',
        end_date: '2021-01-01',
        expiry_date: '2021-01-01',
      };
      tokenId: '123',
      owner: '0x...',
    }
  },
]