This package has been deprecated

Author message:

Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

@covalenthq/js-sign

1.0.22 • Public • Published

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);

Package Sidebar

Install

npm i @covalenthq/js-sign

Weekly Downloads

11

Version

1.0.22

License

ISC

Unpacked Size

918 kB

Total Files

10

Last publish

Collaborators

  • jagnani73
  • jaypozo_covalent
  • harishraisinghani
  • covalenthq_devops