Skip to main content
Version: 5.14.1

Class: MerkleTree

merkle.MerkleTree

Constructors​

constructor​

• new MerkleTree(leafHashes)

Parameters​

NameType
leafHashesstring[]

Defined in​

src/utils/merkle.ts:11

Properties​

leaves​

• leaves: string[]

Defined in​

src/utils/merkle.ts:5


branches​

• branches: string[][] = []

Defined in​

src/utils/merkle.ts:7


root​

• root: string

Defined in​

src/utils/merkle.ts:9

Methods​

hash​

â–¸ Static hash(a, b): string

Parameters​

NameType
astring
bstring

Returns​

string

Defined in​

src/utils/merkle.ts:34


build​

â–¸ Private build(leaves): string

Parameters​

NameType
leavesstring[]

Returns​

string

Defined in​

src/utils/merkle.ts:16


getProof​

â–¸ getProof(leaf, branch?, hashPath?): string[]

Parameters​

NameTypeDefault value
leafstringundefined
branchstring[]undefined
hashPathstring[][]

Returns​

string[]

Defined in​

src/utils/merkle.ts:39