New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

web3card

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

web3card

A React SDK for querying and displaying universal profiles across platforms

latest
npmnpm
Version
1.0.1
Version published
Weekly downloads
0
-100%
Maintainers
1
Weekly downloads
 
Created
Source

web3card

A React SDK for querying and displaying universal profiles across platforms.

Installation

Install the package using npm:

npm install web3card

Or with yarn:

Usage - Web3Card

Import the Web3Card component in your React project and use it by passing an address prop:

import React from 'react';
import Web3Card from 'web3card';

function MyComponent() {
  return (
    <div>
      <Web3Card address="vitalik.eth" />
      {/* You can use any reference like .eth, .lens, .farcaster, or a blockchain address */}
    </div>
  );
}

Usage - API Functions

web3card provides the following API functions to fetch profiles from different platforms:

  • fetchUniversalProfile(identity: string): This function fetches a universal profile using the provided identity (such as an Ethereum address, ENS name, etc.)

  • fetchENSProfile(identity: string): Fetches a profile associated with an Ethereum Name Service (ENS) identity

  • fetchLensProfile(identity: string): Retrieves a Lens profile using the provided identity

  • fetchFarcasterProfile(identity: string): Fetches a Farcaster profile with the provided identity

  • fetchDotBitProfile(identity: string): Retrieves a DotBit profile using the provided identity

Each function returns a Promise that resolves with the data of the fetched profile or null if an error occurs during the fetch operation. Errors during the fetch operation are logged to the console.

Example Usage

Here's how you might use the fetchENSProfile function:

import { fetchENSProfile } from 'web3card';

async function getProfile() {
  const profile = await fetchENSProfile('vitalik.eth');
  if (profile) {
    console.log(profile);
  } else {
    console.error('Failed to fetch profile');
  }
}

getProfile();

Development

To start the development server:

npm run start

Keywords

web3

FAQs

Package last updated on 16 Oct 2023

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