Class: MerkleTree
merkle.MerkleTree
Constructors​
constructor​
• new MerkleTree(leafHashes
)
Parameters​
Name | Type |
---|---|
leafHashes | string [] |
Defined in​
Properties​
leaves​
• leaves: string
[]
Defined in​
branches​
• branches: string
[][] = []
Defined in​
root​
• root: string
Defined in​
Methods​
hash​
â–¸ Static
hash(a
, b
): string
Parameters​
Name | Type |
---|---|
a | string |
b | string |
Returns​
string
Defined in​
build​
â–¸ Private
build(leaves
): string
Parameters​
Name | Type |
---|---|
leaves | string [] |
Returns​
string
Defined in​
getProof​
â–¸ getProof(leaf
, branch?
, hashPath?
): string
[]
Parameters​
Name | Type | Default value |
---|---|---|
leaf | string | undefined |
branch | string [] | undefined |
hashPath | string [] | [] |
Returns​
string
[]