js-sign
This library help create Covalent signature which is intended to authenticate the data communicate with Covalent API endpoints. 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
<script src="https://cdn.jsdelivr.net/npm/covalent-js-sign/dist/lib.min.js"></script>
Node.JS
npm i --save covalent-js-sign
Private library inclusion
- 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
Usage
import { createSignaturePayloadB64 } from 'covalent-js-sign';
const privateKey = "59e96b740f0af54f2d4335ddd033816fa24348b4097d3fddad4f6edc939f52e9";
const walletAddress = "0x71d094E5382CA33B25B92d3A75d5C6f269A78fAe";
const chainId = "1";
const payload = createSignaturePayloadB64(privateKey, walletAddress, chainId);
const payload = covalent.createSignaturePayloadB64(privateKey, walletAddress, chainId);