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

@zkpass/transgate-js-sdk

v0.3.1

Published

<p align="center"> <img src="assets/logo.png" width="300" alt="transgate-js-sdk.js" /> </p>

Downloads

950

Readme

Transgate JS-SDK

ES Version

The Transgate JS-SDK is a utility package for Transgate that enables developers to easily launch Transgate.

Check out our docs for step-by-step instructions!

Register an develop account

Please register an account on the zkPass Dev Center and create a project. Then you can add schemas for your project.

Installation

You can install the package either using NPM or using Yarn

Using NPM

npm install @zkpass/transgate-js-sdk

Using Yarn

yarn add  @zkpass/transgate-js-sdk

Example

import TransgateConnect from '@zkpass/transgate-js-sdk'

const requestVerifyMessage = async () =>{
  try{
    const appid = "8fb9d43c-2f24-424e-a98d-7ba34a5532f5" //Locate this form on the development platform

    const connector = new TransgateConnect(appid)
    const isAvailable = await connector.isTransgateAvailable()

    if(isAvailable){
      //The schema ID that you add for the project
      const schemaId = "516a720e-29a4-4307-ae7b-5aec286e446e"

      const res = await connector.launch(schemaId)// This method can be invoked in a loop when dealing with multiple schemas

      //You have the flexibility to handle the validation results based on your requirements.        

    }else{
      console.log('Please install zkPass Transgate from https://chromewebstore.google.com/detail/zkpass-transgate/afkoofjocpbclhnldmmaphappihehpma')
    }
  }catch(error){
    console.log('transgate error', error)
  }
}
  

Verify result fields

| Field Name | Description | | ----------------------------- | ------------------------------------------------------------------- | | allocatorAddress | The address of the allocator node | | allocatorSignature | Signature of the task information by the allocator node | | publicFields | Values of public fields defined in schema |
| publicFieldsHash | Hash of public fields values |
| taskId | Unique id of the task allocated by the allocator node |
| uHash | Hash value of user unique id in the data source | | validatorAddress | The address of the validator node |
| validatorSignature | The signature of the verification result by the validator node | | recipient | The address of the user |

Error code

| Error Code | Description | | ------------------ | -------------------------------- | | 100000 | ILLEGAL_NODE | | 100001 | TRANSGATE_NOT_INSTALLED | | 100002 | ILLEGAL_APPID |
| 100003 | ILLEGAL_SCHEMA_ID |
| 100004 | TASK_RPC_ERROR |
| 100005 | CONNECT_NODE_ERROR | | 100006 | ILLEGAL_TASK_INFO | | 110001 | NOT_MATCH_REQUIREMENTS |
| 110002 | VERIFICATION_CANCELED | | 110003 | UNEXPECTED_VERIFY_ERROR |