tovarish-relayer/lib/services/treeCache.d.ts

40 lines
1.1 KiB
TypeScript
Raw Permalink Normal View History

2024-11-13 04:42:13 +03:00
/**
* Create tree cache file from node.js
*
* Only works for node.js, modified from https://github.com/tornadocash/tornado-classic-ui/blob/master/scripts/updateTree.js
*/
import { MerkleTree } from '@tornado/fixed-merkle-tree';
import { DepositsEvents } from '@tornado/core';
import type { NetIdType } from '@tornado/core';
export interface TreeCacheConstructor {
userDirectory: string;
PARTS_COUNT?: number;
LEAVES?: number;
zeroElement?: string;
}
export interface treeMetadata {
blockNumber: number;
logIndex: number;
transactionHash: string;
timestamp: number;
from: string;
leafIndex: number;
}
export declare class TreeCache {
userDirectory: string;
PARTS_COUNT: number;
2024-11-19 13:22:27 +03:00
constructor({ userDirectory, PARTS_COUNT }: TreeCacheConstructor);
static getInstanceName({ netId, amount, currency, }: {
netId: NetIdType;
amount: string;
currency: string;
}): string;
createTree({ netId, amount, currency, events, tree, }: {
netId: NetIdType;
amount: string;
currency: string;
events: DepositsEvents[];
tree: MerkleTree;
}): Promise<void>;
2024-11-13 04:42:13 +03:00
}