npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

cip-sdk

v0.1.21

Published

The Canto Identity Protocol SDK provides easy use functions to retrieving user CIP data.

Downloads

1

Readme

Canto Identity Protocol SDK (CIP-SDK)

The Canto Identity Protocol SDK provides easy use functions to retrieving user CIP data.

Canto Identity Protocol

Canto Identity Protocol (CIP) is an on-chain identity protocol that aggregates identity from Subprotocols. Anyone can permissionlessly create a Subprotocol to represent any kind of identity trait – textual, visual, or otherwise. End users freely choose which traits to include in their on-chain identity.

Install

npm i cip-sdk

Example

import { ethers } from 'ethers';
import { CIP } from 'cip-sdk';

// Initialize provider and CIP instance
const provider = new ethers.JsonRpcProvider('<YOUR_CANTO_RPC_URL>');
const cipInstance = new CIP(provider);

// Retrieve user data using CIP
const namespace = await cipInstance.getNamespaceByAddress('<USER_CANTO_ADDRESS>');
const bio = await cipInstance.getBioByAddress('<USER_CANTO_ADDRESS>');
const pfp = await cipInstance.getPfpByAddress('<USER_CANTO_ADDRESS>');

Methods

  • getCID(address): CID - returns the CIP NFT ID of the provided address.
  • getPrimaryData(cid, subprotocolName): sub protocol CID - Method is used to get the users NFT IDs of any subprotocol registered with the user's CID.
  • getNamespaceCID(cid): namespace CID - Method used to get the users registered namespace CID.
  • getBioCID(cid): bio CID - Method used to get the user's registered bio CID.
  • getPfpCID(cid): pfp CID - Method used to get the user's registered pfp CID.
  • getNamespace(namespaceCID): Namespace - Method used to return te user's registered namespace display name and base name.
  • getPfpData(pfpCID): ProfilePictureData - Method used to get the user's profile picture data from profile picture contract. Profile picture data = [nftContractAddress, nftID]
  • getPfpImage(nftContractAddress, nftID): ProfilePictureInfo - Method used to get the user's pfp image data. return value will be src = image src, alt: nft name.
  • getBio(bioCID): bio - Method used to get user's bio information. return value is a string of the registered bio.
  • getBioByAddress(address): bio - Method is an aggregation of getCID, getBioCID and getBio. This method only needs user's address to return the bio.
  • getNamespaceByAddress(address): Namespace - Method used to get user's namespace data. This method is also an aggregation of getCID, getNamespaceCID, and getNamespace.
  • getPfpByAddress(address): ProfilePictureInfo - Method used to get the user's profile picture data. This method is also an aggregation of getCID, getPfpData, getPfpImage. return value will be src = image src, alt: nft name.
  • registerSubprotocol(ordered, primary, active, nftAddress, name, fee): ethers.ContractTransaction - Method used to register new sub protocol to cip.