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

@checkerchain/elrond-merkle-tree-generator

Package Overview
Dependencies
Maintainers
4
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@checkerchain/elrond-merkle-tree-generator

A JS Library to generate the merkle tree and gets it's root and proof for any given distribution for Elrond

  • 1.0.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
4
Created
Source

Merkle Tree Generator for Elrond

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 Merkle Tree Generator is to install it as a dependency:

# If you use npm:
npm i @checkerchain/elrond-merkle-tree-generator

# Or if you use Yarn:
yarn add @checkerchain/elrond-merkle-tree-generator

Example

  1. The first step is to import the function generateTree from the package.
import { generateTree } from '@checkerchain/elrond-merkle-tree-generator';

or

const { generateTree } = require('@checkerchain/elrond-merkle-tree-generator');
  1. The next step is to send a array of data to the generate tree function. The format of data should be:

    data = [
       {
          index: '01',
          wallet: 'erd13wsm72uc0c2fwgtpwjn0xlrzfdh7kg59jmrnfcjh9fhqsp7g5yas5sy69l',
          amount: '1000000',
       },
       {
          index: '02',
          wallet: 'erd14pgqys8lzhdfnuseev4yh3hfrq2423u8wxkd3fkxsvvpvyannzrs88l2nt',
          amount: '1000000',
       },
       ....
    ]
    
    const result = generateTree(data);
    console.log(result);
    
  2. 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.

Keywords

FAQs

Package last updated on 23 Aug 2022

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