2024-12-04 03:30:35 +00:00
|
|
|
import { MerkleTree, PartialMerkleTree, Element, TreeEdge } from 'fixed-merkle-tree';
|
2024-12-23 02:55:45 +00:00
|
|
|
import type { Tornado } from 'tornado-contracts';
|
2024-04-29 15:55:15 +00:00
|
|
|
import type { DepositType } from './deposits';
|
|
|
|
import type { DepositsEvents } from './events';
|
|
|
|
import type { NetIdType } from './networkConfig';
|
2024-10-16 14:19:49 +00:00
|
|
|
export interface MerkleTreeConstructor extends DepositType {
|
2024-04-29 15:55:15 +00:00
|
|
|
Tornado: Tornado;
|
|
|
|
commitmentHex?: string;
|
|
|
|
merkleTreeHeight?: number;
|
|
|
|
emptyElement?: string;
|
|
|
|
merkleWorkerPath?: string;
|
2024-10-16 14:19:49 +00:00
|
|
|
}
|
2024-04-29 15:55:15 +00:00
|
|
|
export declare class MerkleTreeService {
|
|
|
|
currency: string;
|
|
|
|
amount: string;
|
|
|
|
netId: NetIdType;
|
|
|
|
Tornado: Tornado;
|
|
|
|
commitmentHex?: string;
|
|
|
|
instanceName: string;
|
|
|
|
merkleTreeHeight: number;
|
|
|
|
emptyElement: string;
|
|
|
|
merkleWorkerPath?: string;
|
|
|
|
constructor({ netId, amount, currency, Tornado, commitmentHex, merkleTreeHeight, emptyElement, merkleWorkerPath, }: MerkleTreeConstructor);
|
|
|
|
createTree(events: Element[]): Promise<MerkleTree>;
|
|
|
|
createPartialTree({ edge, elements }: {
|
|
|
|
edge: TreeEdge;
|
|
|
|
elements: Element[];
|
|
|
|
}): Promise<PartialMerkleTree>;
|
|
|
|
verifyTree(events: DepositsEvents[]): Promise<MerkleTree>;
|
|
|
|
}
|