export const enum NodeType { BRANCH = 'branch' , LEAF = 'leaf' } export interface NodeData { readonly value : Buffer ; readonly hash : Buffer ; } export interface NodeInfo { readonly type : NodeType ; readonly hash : Buffer ; readonly value : Buffer ; readonly leftHash : Buffer ; readonly rightHash : Buffer ; readonly layerIndex : number ; readonly nodeIndex : number ; } export const enum NodeSide { LEFT = 0 , RIGHT } export interface Proof { readonly siblingHashes : ReadonlyArray < Buffer > ; readonly idxs : ReadonlyArray < number > ; readonly size : number ; } export interface NodeLocation { readonly layerIndex : number ; readonly nodeIndex : number ; } export interface Database { get ( key ) : Promise < Buffer > ; set ( key , value ) : Promise < void > ; } export interface MerkleRootInfo { readonly value : Buffer ; readonly appendPath : Buffer [ ] ; readonly size : number ; }