Constructors
constructor
- new MerkleTree(leafs): MerkleTree
-
Properties
layers
layers: Buffer[][]
leafs
leafs: Buffer[]
Methods
getHexProof
- getHexProof(idx): string[]
-
Returns string[]
getHexRoot
- getHexRoot(): string
-
Returns string
getLeaf
- getLeaf(index): Buffer
-
Returns Buffer
getLeafArray
- getLeafArray(index): number[]
-
Returns number[]
getProof
- getProof(idx): Buffer[]
-
Returns Buffer[]
getProofArray
- getProofArray(index): any[]
-
Returns any[]
getRoot
- getRoot(): Buffer
-
Returns Buffer
getRootArray
- getRootArray(): number[]
-
Returns number[]
verifyProof
- verifyProof(idx, proof, root): boolean
-
Parameters
-
idx: number
-
proof: Buffer[]
-
root: Buffer
Returns boolean
Static
internalHash
- internalHash(first, second): Buffer
-
Parameters
-
first: Buffer
-
second: undefined | Buffer
Returns Buffer
Static
nodeHash
- nodeHash(data): Buffer
-
Returns Buffer
Static
verifyClaim
- verifyClaim(leaf, proof, root): boolean
-
Parameters
-
leaf: Buffer
-
proof: Buffer[]
-
root: Buffer
Returns boolean