@dcl/content-hash-tree
Version:
Lib to generate and validate a merkle tree of content hashes
12 lines (11 loc) • 560 B
TypeScript
/// <reference types="node" />
import { BigNumber } from 'ethers';
export declare class ContentHashTree {
private readonly tree;
constructor(contentHashes: string[]);
static verifyProof(index: number | BigNumber, contentHash: string, proof: Buffer[], root: Buffer): boolean;
static generateRoot(index: number | BigNumber, contentHash: string, proof: Buffer[]): Buffer;
static toNode(index: number | BigNumber, contentHash: string): Buffer;
getHexRoot(): string;
getProof(index: number | BigNumber, contentHash: string): string[];
}