diff --git a/README.md b/README.md index 792d600..7896d7c 100644 --- a/README.md +++ b/README.md @@ -1 +1,37 @@ -# +# Merkle Tree Generator for Zilliqa + +A Simple Javascript library to generate Merkle Tree and get its root and proof for any type of Merkle Tree Distribution + +## Installation + +The recommend way to use MetaMask React with a React app is to install it as a dependency: + +```shell +# If you use npm: +npm i merkle-tree-zilliqa-js + +# Or if you use Yarn: +yarn add merkle-tree-zilliqa-js +``` + +## Example + +1. The first step is to import the function generateTree from the package. + +```javascript +import { generateTree } from 'merkle-tree-zilliqa-js'; +``` + +2. The next step is to send a array of data to the generate tree function. Make sure that the data has the following format: + +[ +{ +wallet:"zil..............", +amount:"10000000000", +} +] +Note: Make sure that the wallet passed is in the base32 format i.e zil............. + +3. And boom, you are done! It returns you with the merkle root and proof for all the passed wallets, which can be passed on Smart Contracts for claiming the rewards. + +This is just the initial version of the package, feel free to contribute more to it. diff --git a/package-lock.json b/package-lock.json index 4c2a900..cd7f7de 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1350,11 +1350,6 @@ "resolved": "https://registry.npmjs.org/blakejs/-/blakejs-1.1.1.tgz", "integrity": "sha512-bLG6PHOCZJKNshTjGRBvET0vTciwQE6zFKOKKXPDJfwFBd4Ac0yBfPZqcGvGJap50l7ktvlpFqc2jGVaUgbJgg==" }, - "bn.js": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.2.0.tgz", - "integrity": "sha512-D7iWRBvnZE8ecXiLj/9wbxH7Tk79fAh8IHaTNq1RWRixsS02W+5qS+iE9yq6RYl0asXx5tw0bLhmT5pIfbSquw==" - }, "brace-expansion": { "version": "1.1.11", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", diff --git a/package.json b/package.json index 9553c98..9e94d27 100644 --- a/package.json +++ b/package.json @@ -40,7 +40,6 @@ "dependencies": { "@zilliqa-js/crypto": "^3.3.3", "@zilliqa-js/util": "^3.3.3", - "bn.js": "^5.2.0", "js-sha256": "^0.9.0", "merkletreejs": "^0.2.27" }