Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@gitcoin/gs-passport-verifier

Package Overview
Dependencies
Maintainers
0
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@gitcoin/gs-passport-verifier

Verify the contents of a Gitcoin Passport

  • 0.0.1
  • latest
  • npm
  • Socket score

Version published
Maintainers
0
Created
Source

Gitcoin Passport SDK: Verifier

Verify the contents of a Gitcoin Passport

Installation

Add to your project...

yarn add @gitcoinco/passport-sdk-verifier

--

Or download this .git repository and install deps manually...

yarn install

Build...

yarn run webpack

Basic Usage

Firstly, we need to import the library/bundle and construct a PassportVerifier instance

// import as a module
import PassportVerifier from "@gitcoinco/passport-sdk-verifier";


// or import the bundle
<script src="./dist/verifier.bundle.js" type="script/javascript"/>

...

// create a new instance pointing at the community clay node on mainnet along with the criteria we wish to score against
const verifier = new PassportVerifier();

// Verify all Stamps held within a Passport
const passport = await verifier.verifyPassport("0x0...");

Browser Usage

If you are using this package in a browser, you may need to asynchronously load @gitcoinco/passport-sdk-verifier'` before using.

// NextJS Example
const [verifier, setVerifier] = useState();

useEffect(() => {
  const initVerifier = async () => {
    // Dynamically load @gitcoinco/passport-sdk-verifier
    const PassportVerifier = (await import("@gitcoinco/passport-sdk-verifier")).PassportVerifier;
    setVerifier(new PassportVerifier("https://ceramic.staging.dpopp.gitcoin.co"));
  };

  initVerifier().then(() => {
    console.log("Verifier inited :)");
  });
}, []);

PassportVerifier

The PassportVerifier instance exposes read-only methods to verify the content of a Gitcoin Passport:


  • verifyPassport - pass in an ethereum address and get back a Passport where each stamps contains a verified: boolean field
PassportVerifier.verifyPassport(address: string, passport?: Passport, additionalStampCheck?: (stamp: Stamp) => boolean): Promise<Passport>
  • verifyStamp - pass in a Stamp and get back a Stamp with the verified: boolean field completed
PassportVerifier.verifyStamp(address: string, stamp: Stamp, additionalStampCheck?: (stamp: Stamp) => boolean): Promise<Stamp>
  • verifyCredential - pass in a VerifiableCredentail and get back a boolean
PassportVerifier.verifyCredential(credential: VerifiableCredential): Promise<boolean>

FAQs

Package last updated on 28 Nov 2024

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc