import { BigNumber } from '@pigi/core-utils' ; export interface MerkleTreeNode { key : BigNumber ; hash : Buffer ; value : Buffer ; } export interface MerkleTreeInclusionProof { rootHash : Buffer ; key : BigNumber ; value : Buffer ; siblings : Buffer [ ] ; } export interface MerkleUpdate { key : BigNumber ; oldValue : Buffer ; oldValueProofSiblings : Buffer [ ] ; newValue : Buffer ; } export interface MerkleTree { returns getRootHash ( ) : Promise < Buffer > ; param leafKey param leafValue return update ( leafKey , leafValue ) : Promise < boolean > ; param updates return batchUpdate ( updates ) : Promise < boolean > ; param leafKey param leafValue returns throws getMerkleProof ( leafKey , leafValue ) : Promise < MerkleTreeInclusionProof > ; param leafKey param rootHash returns getLeaf ( leafKey , rootHash ? ) : Promise < Buffer > ; returns getHeight ( ) : number ; } export interface SparseMerkleTree extends MerkleTree { param inclusionProof return verifyAndStore ( inclusionProof ) : Promise < boolean > ; param leafKey param numExistingNodes returns verifyAndStorePartiallyEmptyPath ( leafKey , numExistingNodes ? ) : Promise < boolean > ; }