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

zkt-sdk

Package Overview
Dependencies
Maintainers
2
Versions
52
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

zkt-sdk

zkToken | JS SDK

  • 1.3.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
106
increased by1414.29%
Maintainers
2
Weekly downloads
 
Created
Source

zkt-sdk

zkToken | JS SDK

Installation and Running

As a package for typescript project

import { ZkEth } from "zkt-sdk";

const zkEth = new ZkEth("<ETHERJS_BROWSER_PROVIDER>");
const auth = zkEth.authentication("<SXT_ENDPOINT>", "<SECRETS_PROXY_ENDPOINT>");
console.log(zkEth);

Example in React Project

    import { ZkEth } from "zkt-sdk";
    import { ethers } from 'ethers';

    const provider = new ethers.BrowserProvider(window.ethereum, { name: 'polygon', chainId: 137 });

    const zkEth = new ZkEth(provider, 137);

    await zkEth.depositNative(33, '0x3077Bf667dBD81d3c718684Da4DE4Dc8448220E1', 0)

As a bundled js file for the web

  1. Install all dependencies
yarn
  1. Build the bundled js file
yarn run build-web

The build files should be available in ./dist/web folder

  1. Test
yarn run test-web

A new index.html with sample usage code should be available in the ./dist folder. In your browser open http://localhost:9000 and check the console logs. It watches any changes to the html file

Usage
<!DOCTYPE html>
<head>
    <script src="./bundle.js"></script>
    <script>
        // Using the auth
        const zkEth = new ZkEth("<ETHERJS_BROWSER_PROVIDER>");
        const auth = zkEth.authentication("<SXT_ENDPOINT>", "<SECRETS_PROXY_ENDPOINT>");
        console.log(auth)
    </script>
</head>
</html>

As a package file for the nodejs

  1. Install all dependencies
yarn
  1. Generate a node js package
yarn run build-node

Node js version of the files will be generated to dist/node

FAQs

Package last updated on 04 Jun 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