New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@covalenthq/js-sign

Package Overview
Dependencies
Maintainers
2
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@covalenthq/js-sign

Covalent browser compatible library for typed data signature creation and verification

  • 1.0.22
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2
decreased by-33.33%
Maintainers
2
Weekly downloads
 
Created
Source

js-sign · GitHub license

js-sign library allows browsers and Node.js clients to create signature payload in order to interact with Covalent API. Generally, only one function call is required to create the necessary signature.

Currently, when using some Covalent API endpoints, the only data that required signing is the wallet address.

Installation

Browser javascript

Embed the javascript source in html

<script src="https://cdn.jsdelivr.net/npm/@covalenthq/js-sign/dist/lib.min.js"></script>

Node.JS

Installing module

npm i --save @covalenthq/js-sign

Build from source

The output of the build process is located in dist folder,

npm run build

Download from github gist

  • Please download the single library, covalent-js-sign.js, directly from the github gist,

https://gist.github.com/cloggo/8f1b16ef2bdcfd663e587dba11f2d116#file-covalent-js-sign-js

Testing

All new code changes should be covered with unit tests. You can run the tests with the following command,

npm run test

Configuration and Setup

Private key

Provide private key to process.env.PRIVATE_KEY variable. You can use dotenv or any other way.

process.env.PRIVATE_KEY = ${YOUR_PRIVATE_KEY}

Usage

// import only required for Node.JS
import covalent from '@covalenthq/js-sign';

// To create the payload that include both the typed data challenge and the signature in base64 encoding format,

const privateKey = process.env.PRIVATE_KEY;

const covalentMessage {
  address: "0x71d094E5382CA33B25B92d3A75d5C6f269A78fAe",
  chainId: 1
};

const payload = covalent.createSignaturePayloadB64(privateKey, covalentMessage);


Keywords

FAQs

Package last updated on 16 Sep 2021

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