forked from tornado-packages/tornado-core
Remove node.js specific dependencies and move them back to cli
This commit is contained in:
parent
b5f57e20ee
commit
4fde41b10c
24
dist/data.d.ts
vendored
24
dist/data.d.ts
vendored
@ -1,24 +0,0 @@
|
|||||||
import { AsyncZippable, Unzipped } from 'fflate';
|
|
||||||
import { BaseEvents, MinimalEvents } from './events';
|
|
||||||
export declare function existsAsync(fileOrDir: string): Promise<boolean>;
|
|
||||||
export declare function zipAsync(file: AsyncZippable): Promise<Uint8Array>;
|
|
||||||
export declare function unzipAsync(data: Uint8Array): Promise<Unzipped>;
|
|
||||||
export declare function saveUserFile({ fileName, userDirectory, dataString, }: {
|
|
||||||
fileName: string;
|
|
||||||
userDirectory: string;
|
|
||||||
dataString: string;
|
|
||||||
}): Promise<void>;
|
|
||||||
export declare function loadSavedEvents<T extends MinimalEvents>({ name, userDirectory, deployedBlock, }: {
|
|
||||||
name: string;
|
|
||||||
userDirectory: string;
|
|
||||||
deployedBlock: number;
|
|
||||||
}): Promise<BaseEvents<T>>;
|
|
||||||
export declare function download({ name, cacheDirectory }: {
|
|
||||||
name: string;
|
|
||||||
cacheDirectory: string;
|
|
||||||
}): Promise<string>;
|
|
||||||
export declare function loadCachedEvents<T extends MinimalEvents>({ name, cacheDirectory, deployedBlock, }: {
|
|
||||||
name: string;
|
|
||||||
cacheDirectory: string;
|
|
||||||
deployedBlock: number;
|
|
||||||
}): Promise<BaseEvents<T>>;
|
|
1
dist/events/index.d.ts
vendored
1
dist/events/index.d.ts
vendored
@ -1,3 +1,2 @@
|
|||||||
export * from './types';
|
export * from './types';
|
||||||
export * from './base';
|
export * from './base';
|
||||||
export * from './node';
|
|
||||||
|
76
dist/events/node.d.ts
vendored
76
dist/events/node.d.ts
vendored
@ -1,76 +0,0 @@
|
|||||||
import { BatchBlockOnProgress, BatchEventOnProgress } from '../batch';
|
|
||||||
import { BaseTornadoService, BaseEncryptedNotesService, BaseGovernanceService, BaseRegistryService, BaseTornadoServiceConstructor, BaseEncryptedNotesServiceConstructor, BaseGovernanceServiceConstructor, BaseRegistryServiceConstructor, BaseEchoServiceConstructor, BaseEchoService } from './base';
|
|
||||||
import type { BaseEvents, DepositsEvents, WithdrawalsEvents, EncryptedNotesEvents, RegistersEvents, AllGovernanceEvents, EchoEvents } from './types';
|
|
||||||
export type NodeTornadoServiceConstructor = BaseTornadoServiceConstructor & {
|
|
||||||
cacheDirectory?: string;
|
|
||||||
userDirectory?: string;
|
|
||||||
};
|
|
||||||
export declare class NodeTornadoService extends BaseTornadoService {
|
|
||||||
cacheDirectory?: string;
|
|
||||||
userDirectory?: string;
|
|
||||||
constructor({ netId, provider, graphApi, subgraphName, Tornado, type, amount, currency, deployedBlock, fetchDataOptions, cacheDirectory, userDirectory, }: NodeTornadoServiceConstructor);
|
|
||||||
updateEventProgress({ type, fromBlock, toBlock, count }: Parameters<BatchEventOnProgress>[0]): void;
|
|
||||||
updateTransactionProgress({ currentIndex, totalIndex }: Parameters<BatchBlockOnProgress>[0]): void;
|
|
||||||
updateBlockProgress({ currentIndex, totalIndex }: Parameters<BatchBlockOnProgress>[0]): void;
|
|
||||||
updateGraphProgress({ type, fromBlock, toBlock, count }: Parameters<BatchEventOnProgress>[0]): void;
|
|
||||||
getEventsFromDB(): Promise<BaseEvents<DepositsEvents | WithdrawalsEvents>>;
|
|
||||||
getEventsFromCache(): Promise<BaseEvents<DepositsEvents | WithdrawalsEvents>>;
|
|
||||||
saveEvents({ events, lastBlock }: BaseEvents<DepositsEvents | WithdrawalsEvents>): Promise<void>;
|
|
||||||
}
|
|
||||||
export type NodeEchoServiceConstructor = BaseEchoServiceConstructor & {
|
|
||||||
cacheDirectory?: string;
|
|
||||||
userDirectory?: string;
|
|
||||||
};
|
|
||||||
export declare class NodeEchoService extends BaseEchoService {
|
|
||||||
cacheDirectory?: string;
|
|
||||||
userDirectory?: string;
|
|
||||||
constructor({ netId, provider, graphApi, subgraphName, Echoer, deployedBlock, fetchDataOptions, cacheDirectory, userDirectory, }: NodeEchoServiceConstructor);
|
|
||||||
updateEventProgress({ type, fromBlock, toBlock, count }: Parameters<BatchEventOnProgress>[0]): void;
|
|
||||||
updateGraphProgress({ type, fromBlock, toBlock, count }: Parameters<BatchEventOnProgress>[0]): void;
|
|
||||||
getEventsFromDB(): Promise<BaseEvents<EchoEvents>>;
|
|
||||||
getEventsFromCache(): Promise<BaseEvents<EchoEvents>>;
|
|
||||||
saveEvents({ events, lastBlock }: BaseEvents<EchoEvents>): Promise<void>;
|
|
||||||
}
|
|
||||||
export type NodeEncryptedNotesServiceConstructor = BaseEncryptedNotesServiceConstructor & {
|
|
||||||
cacheDirectory?: string;
|
|
||||||
userDirectory?: string;
|
|
||||||
};
|
|
||||||
export declare class NodeEncryptedNotesService extends BaseEncryptedNotesService {
|
|
||||||
cacheDirectory?: string;
|
|
||||||
userDirectory?: string;
|
|
||||||
constructor({ netId, provider, graphApi, subgraphName, Router, deployedBlock, fetchDataOptions, cacheDirectory, userDirectory, }: NodeEncryptedNotesServiceConstructor);
|
|
||||||
updateEventProgress({ type, fromBlock, toBlock, count }: Parameters<BatchEventOnProgress>[0]): void;
|
|
||||||
updateGraphProgress({ type, fromBlock, toBlock, count }: Parameters<BatchEventOnProgress>[0]): void;
|
|
||||||
getEventsFromDB(): Promise<BaseEvents<EncryptedNotesEvents>>;
|
|
||||||
getEventsFromCache(): Promise<BaseEvents<EncryptedNotesEvents>>;
|
|
||||||
saveEvents({ events, lastBlock }: BaseEvents<EncryptedNotesEvents>): Promise<void>;
|
|
||||||
}
|
|
||||||
export type NodeGovernanceServiceConstructor = BaseGovernanceServiceConstructor & {
|
|
||||||
cacheDirectory?: string;
|
|
||||||
userDirectory?: string;
|
|
||||||
};
|
|
||||||
export declare class NodeGovernanceService extends BaseGovernanceService {
|
|
||||||
cacheDirectory?: string;
|
|
||||||
userDirectory?: string;
|
|
||||||
constructor({ netId, provider, graphApi, subgraphName, Governance, deployedBlock, fetchDataOptions, cacheDirectory, userDirectory, }: NodeGovernanceServiceConstructor);
|
|
||||||
updateEventProgress({ type, fromBlock, toBlock, count }: Parameters<BatchEventOnProgress>[0]): void;
|
|
||||||
updateGraphProgress({ type, fromBlock, toBlock, count }: Parameters<BatchEventOnProgress>[0]): void;
|
|
||||||
updateTransactionProgress({ currentIndex, totalIndex }: Parameters<BatchBlockOnProgress>[0]): void;
|
|
||||||
getEventsFromDB(): Promise<BaseEvents<AllGovernanceEvents>>;
|
|
||||||
getEventsFromCache(): Promise<BaseEvents<AllGovernanceEvents>>;
|
|
||||||
saveEvents({ events, lastBlock }: BaseEvents<AllGovernanceEvents>): Promise<void>;
|
|
||||||
}
|
|
||||||
export type NodeRegistryServiceConstructor = BaseRegistryServiceConstructor & {
|
|
||||||
cacheDirectory?: string;
|
|
||||||
userDirectory?: string;
|
|
||||||
};
|
|
||||||
export declare class NodeRegistryService extends BaseRegistryService {
|
|
||||||
cacheDirectory?: string;
|
|
||||||
userDirectory?: string;
|
|
||||||
constructor({ netId, provider, graphApi, subgraphName, RelayerRegistry, deployedBlock, fetchDataOptions, cacheDirectory, userDirectory, }: NodeRegistryServiceConstructor);
|
|
||||||
updateEventProgress({ type, fromBlock, toBlock, count }: Parameters<BatchEventOnProgress>[0]): void;
|
|
||||||
updateGraphProgress({ type, fromBlock, toBlock, count }: Parameters<BatchEventOnProgress>[0]): void;
|
|
||||||
getEventsFromDB(): Promise<BaseEvents<RegistersEvents>>;
|
|
||||||
getEventsFromCache(): Promise<BaseEvents<RegistersEvents>>;
|
|
||||||
saveEvents({ events, lastBlock }: BaseEvents<RegistersEvents>): Promise<void>;
|
|
||||||
}
|
|
3
dist/index.d.ts
vendored
3
dist/index.d.ts
vendored
@ -3,7 +3,6 @@ export * from './graphql';
|
|||||||
export * from './schemas';
|
export * from './schemas';
|
||||||
export * from './typechain';
|
export * from './typechain';
|
||||||
export * from './batch';
|
export * from './batch';
|
||||||
export * from './data';
|
|
||||||
export * from './deposits';
|
export * from './deposits';
|
||||||
export * from './encryptedNotes';
|
export * from './encryptedNotes';
|
||||||
export * from './fees';
|
export * from './fees';
|
||||||
@ -11,12 +10,10 @@ export * from './merkleTree';
|
|||||||
export * from './mimc';
|
export * from './mimc';
|
||||||
export * from './multicall';
|
export * from './multicall';
|
||||||
export * from './networkConfig';
|
export * from './networkConfig';
|
||||||
export * from './parser';
|
|
||||||
export * from './pedersen';
|
export * from './pedersen';
|
||||||
export * from './prices';
|
export * from './prices';
|
||||||
export * from './providers';
|
export * from './providers';
|
||||||
export * from './relayerClient';
|
export * from './relayerClient';
|
||||||
export * from './tokens';
|
export * from './tokens';
|
||||||
export * from './treeCache';
|
|
||||||
export * from './utils';
|
export * from './utils';
|
||||||
export * from './websnark';
|
export * from './websnark';
|
||||||
|
1384
dist/index.js
vendored
1384
dist/index.js
vendored
File diff suppressed because it is too large
Load Diff
1360
dist/index.mjs
vendored
1360
dist/index.mjs
vendored
File diff suppressed because it is too large
Load Diff
26632
dist/index.umd.js
vendored
26632
dist/index.umd.js
vendored
File diff suppressed because one or more lines are too long
10
dist/parser.d.ts
vendored
10
dist/parser.d.ts
vendored
@ -1,10 +0,0 @@
|
|||||||
export declare function parseNumber(value?: string | number): number;
|
|
||||||
export declare function parseUrl(value?: string): string;
|
|
||||||
export declare function parseRelayer(value?: string): string;
|
|
||||||
export declare function parseAddress(value?: string): string;
|
|
||||||
export declare function parseMnemonic(value?: string): string;
|
|
||||||
export declare function parseKey(value?: string): string;
|
|
||||||
/**
|
|
||||||
* Recovery key shouldn't have a 0x prefix (Also this is how the UI generates)
|
|
||||||
*/
|
|
||||||
export declare function parseRecoveryKey(value?: string): string;
|
|
35
dist/treeCache.d.ts
vendored
35
dist/treeCache.d.ts
vendored
@ -1,35 +0,0 @@
|
|||||||
/**
|
|
||||||
* 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 './events';
|
|
||||||
import type { NetIdType } from './networkConfig';
|
|
||||||
export interface TreeCacheConstructor {
|
|
||||||
netId: NetIdType;
|
|
||||||
amount: string;
|
|
||||||
currency: string;
|
|
||||||
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 {
|
|
||||||
netId: NetIdType;
|
|
||||||
amount: string;
|
|
||||||
currency: string;
|
|
||||||
userDirectory: string;
|
|
||||||
PARTS_COUNT: number;
|
|
||||||
constructor({ netId, amount, currency, userDirectory, PARTS_COUNT }: TreeCacheConstructor);
|
|
||||||
getInstanceName(): string;
|
|
||||||
createTree(events: DepositsEvents[], tree: MerkleTree): Promise<void>;
|
|
||||||
}
|
|
13
package.json
13
package.json
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@tornado/core",
|
"name": "@tornado/core",
|
||||||
"version": "1.0.0",
|
"version": "1.0.1",
|
||||||
"description": "An SDK for building applications on top of Privacy Pools",
|
"description": "An SDK for building applications on top of Privacy Pools",
|
||||||
"main": "./dist/index.js",
|
"main": "./dist/index.js",
|
||||||
"module": "./dist/index.mjs",
|
"module": "./dist/index.mjs",
|
||||||
@ -37,7 +37,6 @@
|
|||||||
"@tornado/snarkjs": "^0.1.20",
|
"@tornado/snarkjs": "^0.1.20",
|
||||||
"@tornado/websnark": "^0.0.4",
|
"@tornado/websnark": "^0.0.4",
|
||||||
"ajv": "^8.12.0",
|
"ajv": "^8.12.0",
|
||||||
"bloomfilter.js": "^1.0.2",
|
|
||||||
"bn.js": "^5.2.1",
|
"bn.js": "^5.2.1",
|
||||||
"circomlibjs": "0.1.7",
|
"circomlibjs": "0.1.7",
|
||||||
"cross-fetch": "^4.0.0",
|
"cross-fetch": "^4.0.0",
|
||||||
@ -45,15 +44,7 @@
|
|||||||
"ffjavascript": "0.2.48",
|
"ffjavascript": "0.2.48",
|
||||||
"fflate": "^0.8.2"
|
"fflate": "^0.8.2"
|
||||||
},
|
},
|
||||||
"optionalDependencies": {
|
"optionalDependencies": {},
|
||||||
"@colors/colors": "1.5.0",
|
|
||||||
"cli-table3": "^0.6.4",
|
|
||||||
"commander": "^12.0.0",
|
|
||||||
"http-proxy-agent": "^7.0.2",
|
|
||||||
"https-proxy-agent": "^7.0.4",
|
|
||||||
"moment": "^2.30.1",
|
|
||||||
"socks-proxy-agent": "^8.0.3"
|
|
||||||
},
|
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@rollup/plugin-commonjs": "^25.0.7",
|
"@rollup/plugin-commonjs": "^25.0.7",
|
||||||
"@rollup/plugin-json": "^6.1.0",
|
"@rollup/plugin-json": "^6.1.0",
|
||||||
|
@ -7,6 +7,9 @@ import pkgJson from './package.json' assert { type: 'json' };
|
|||||||
const external = Object.keys(pkgJson.dependencies).concat(
|
const external = Object.keys(pkgJson.dependencies).concat(
|
||||||
Object.keys(pkgJson.optionalDependencies),
|
Object.keys(pkgJson.optionalDependencies),
|
||||||
[
|
[
|
||||||
|
'http-proxy-agent',
|
||||||
|
'https-proxy-agent',
|
||||||
|
'socks-proxy-agent',
|
||||||
'@tornado/websnark/src/utils',
|
'@tornado/websnark/src/utils',
|
||||||
'@tornado/websnark/src/groth16',
|
'@tornado/websnark/src/groth16',
|
||||||
]
|
]
|
||||||
|
146
src/data.ts
146
src/data.ts
@ -1,146 +0,0 @@
|
|||||||
import path from 'path';
|
|
||||||
import { stat, mkdir, readFile, writeFile } from 'fs/promises';
|
|
||||||
import { zip, unzip, AsyncZippable, Unzipped } from 'fflate';
|
|
||||||
import { BaseEvents, MinimalEvents } from './events';
|
|
||||||
|
|
||||||
export async function existsAsync(fileOrDir: string): Promise<boolean> {
|
|
||||||
try {
|
|
||||||
await stat(fileOrDir);
|
|
||||||
|
|
||||||
return true;
|
|
||||||
} catch {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
export function zipAsync(file: AsyncZippable): Promise<Uint8Array> {
|
|
||||||
return new Promise((res, rej) => {
|
|
||||||
zip(file, { mtime: new Date('1/1/1980') }, (err, data) => {
|
|
||||||
if (err) {
|
|
||||||
rej(err);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
res(data);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
export function unzipAsync(data: Uint8Array): Promise<Unzipped> {
|
|
||||||
return new Promise((res, rej) => {
|
|
||||||
unzip(data, {}, (err, data) => {
|
|
||||||
if (err) {
|
|
||||||
rej(err);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
res(data);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
export async function saveUserFile({
|
|
||||||
fileName,
|
|
||||||
userDirectory,
|
|
||||||
dataString,
|
|
||||||
}: {
|
|
||||||
fileName: string;
|
|
||||||
userDirectory: string;
|
|
||||||
dataString: string;
|
|
||||||
}) {
|
|
||||||
fileName = fileName.toLowerCase();
|
|
||||||
|
|
||||||
const filePath = path.join(userDirectory, fileName);
|
|
||||||
|
|
||||||
const payload = await zipAsync({
|
|
||||||
[fileName]: new TextEncoder().encode(dataString),
|
|
||||||
});
|
|
||||||
|
|
||||||
if (!(await existsAsync(userDirectory))) {
|
|
||||||
await mkdir(userDirectory, { recursive: true });
|
|
||||||
}
|
|
||||||
|
|
||||||
await writeFile(filePath + '.zip', payload);
|
|
||||||
await writeFile(filePath, dataString);
|
|
||||||
}
|
|
||||||
|
|
||||||
export async function loadSavedEvents<T extends MinimalEvents>({
|
|
||||||
name,
|
|
||||||
userDirectory,
|
|
||||||
deployedBlock,
|
|
||||||
}: {
|
|
||||||
name: string;
|
|
||||||
userDirectory: string;
|
|
||||||
deployedBlock: number;
|
|
||||||
}): Promise<BaseEvents<T>> {
|
|
||||||
const filePath = path.join(userDirectory, `${name}.json`.toLowerCase());
|
|
||||||
|
|
||||||
if (!(await existsAsync(filePath))) {
|
|
||||||
return {
|
|
||||||
events: [] as T[],
|
|
||||||
lastBlock: null,
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
|
||||||
const events = JSON.parse(await readFile(filePath, { encoding: 'utf8' })) as T[];
|
|
||||||
|
|
||||||
return {
|
|
||||||
events,
|
|
||||||
lastBlock: events && events.length ? events[events.length - 1].blockNumber : deployedBlock,
|
|
||||||
};
|
|
||||||
} catch (err) {
|
|
||||||
console.log('Method loadSavedEvents has error');
|
|
||||||
console.log(err);
|
|
||||||
return {
|
|
||||||
events: [],
|
|
||||||
lastBlock: deployedBlock,
|
|
||||||
};
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
export async function download({ name, cacheDirectory }: { name: string; cacheDirectory: string }) {
|
|
||||||
const fileName = `${name}.json`.toLowerCase();
|
|
||||||
const zipName = `${fileName}.zip`;
|
|
||||||
const zipPath = path.join(cacheDirectory, zipName);
|
|
||||||
|
|
||||||
const data = await readFile(zipPath);
|
|
||||||
const { [fileName]: content } = await unzipAsync(data);
|
|
||||||
|
|
||||||
return new TextDecoder().decode(content);
|
|
||||||
}
|
|
||||||
|
|
||||||
export async function loadCachedEvents<T extends MinimalEvents>({
|
|
||||||
name,
|
|
||||||
cacheDirectory,
|
|
||||||
deployedBlock,
|
|
||||||
}: {
|
|
||||||
name: string;
|
|
||||||
cacheDirectory: string;
|
|
||||||
deployedBlock: number;
|
|
||||||
}): Promise<BaseEvents<T>> {
|
|
||||||
try {
|
|
||||||
const module = await download({ cacheDirectory, name });
|
|
||||||
|
|
||||||
if (module) {
|
|
||||||
const events = JSON.parse(module);
|
|
||||||
|
|
||||||
const lastBlock = events && events.length ? events[events.length - 1].blockNumber : deployedBlock;
|
|
||||||
|
|
||||||
return {
|
|
||||||
events,
|
|
||||||
lastBlock,
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
return {
|
|
||||||
events: [],
|
|
||||||
lastBlock: deployedBlock,
|
|
||||||
};
|
|
||||||
} catch (err) {
|
|
||||||
console.log('Method loadCachedEvents has error');
|
|
||||||
console.log(err);
|
|
||||||
return {
|
|
||||||
events: [],
|
|
||||||
lastBlock: deployedBlock,
|
|
||||||
};
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,3 +1,2 @@
|
|||||||
export * from './types';
|
export * from './types';
|
||||||
export * from './base';
|
export * from './base';
|
||||||
export * from './node';
|
|
||||||
|
@ -1,780 +0,0 @@
|
|||||||
import Table from 'cli-table3';
|
|
||||||
import moment from 'moment';
|
|
||||||
import { BatchBlockOnProgress, BatchEventOnProgress } from '../batch';
|
|
||||||
import { saveUserFile, loadSavedEvents, loadCachedEvents } from '../data';
|
|
||||||
import {
|
|
||||||
BaseTornadoService,
|
|
||||||
BaseEncryptedNotesService,
|
|
||||||
BaseGovernanceService,
|
|
||||||
BaseRegistryService,
|
|
||||||
BaseTornadoServiceConstructor,
|
|
||||||
BaseEncryptedNotesServiceConstructor,
|
|
||||||
BaseGovernanceServiceConstructor,
|
|
||||||
BaseRegistryServiceConstructor,
|
|
||||||
BaseEchoServiceConstructor,
|
|
||||||
BaseEchoService,
|
|
||||||
} from './base';
|
|
||||||
import type {
|
|
||||||
BaseEvents,
|
|
||||||
DepositsEvents,
|
|
||||||
WithdrawalsEvents,
|
|
||||||
EncryptedNotesEvents,
|
|
||||||
RegistersEvents,
|
|
||||||
AllGovernanceEvents,
|
|
||||||
EchoEvents,
|
|
||||||
} from './types';
|
|
||||||
|
|
||||||
export type NodeTornadoServiceConstructor = BaseTornadoServiceConstructor & {
|
|
||||||
cacheDirectory?: string;
|
|
||||||
userDirectory?: string;
|
|
||||||
};
|
|
||||||
|
|
||||||
export class NodeTornadoService extends BaseTornadoService {
|
|
||||||
cacheDirectory?: string;
|
|
||||||
userDirectory?: string;
|
|
||||||
|
|
||||||
constructor({
|
|
||||||
netId,
|
|
||||||
provider,
|
|
||||||
graphApi,
|
|
||||||
subgraphName,
|
|
||||||
Tornado,
|
|
||||||
type,
|
|
||||||
amount,
|
|
||||||
currency,
|
|
||||||
deployedBlock,
|
|
||||||
fetchDataOptions,
|
|
||||||
cacheDirectory,
|
|
||||||
userDirectory,
|
|
||||||
}: NodeTornadoServiceConstructor) {
|
|
||||||
super({
|
|
||||||
netId,
|
|
||||||
provider,
|
|
||||||
graphApi,
|
|
||||||
subgraphName,
|
|
||||||
Tornado,
|
|
||||||
type,
|
|
||||||
amount,
|
|
||||||
currency,
|
|
||||||
deployedBlock,
|
|
||||||
fetchDataOptions,
|
|
||||||
});
|
|
||||||
|
|
||||||
this.cacheDirectory = cacheDirectory;
|
|
||||||
this.userDirectory = userDirectory;
|
|
||||||
}
|
|
||||||
|
|
||||||
updateEventProgress({ type, fromBlock, toBlock, count }: Parameters<BatchEventOnProgress>[0]) {
|
|
||||||
if (toBlock) {
|
|
||||||
console.log(`fromBlock - ${fromBlock}`);
|
|
||||||
console.log(`toBlock - ${toBlock}`);
|
|
||||||
|
|
||||||
if (count) {
|
|
||||||
console.log(`downloaded ${type} events count - ${count}`);
|
|
||||||
console.log('____________________________________________');
|
|
||||||
console.log(`Fetched ${type} events from ${fromBlock} to ${toBlock}\n`);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
updateTransactionProgress({ currentIndex, totalIndex }: Parameters<BatchBlockOnProgress>[0]) {
|
|
||||||
if (totalIndex) {
|
|
||||||
console.log(`Fetched ${currentIndex} deposit txs of ${totalIndex}`);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
updateBlockProgress({ currentIndex, totalIndex }: Parameters<BatchBlockOnProgress>[0]) {
|
|
||||||
if (totalIndex) {
|
|
||||||
console.log(`Fetched ${currentIndex} withdrawal blocks of ${totalIndex}`);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
updateGraphProgress({ type, fromBlock, toBlock, count }: Parameters<BatchEventOnProgress>[0]) {
|
|
||||||
if (toBlock) {
|
|
||||||
console.log(`fromBlock - ${fromBlock}`);
|
|
||||||
console.log(`toBlock - ${toBlock}`);
|
|
||||||
|
|
||||||
if (count) {
|
|
||||||
console.log(`downloaded ${type} events from graph node count - ${count}`);
|
|
||||||
console.log('____________________________________________');
|
|
||||||
console.log(`Fetched ${type} events from graph node ${fromBlock} to ${toBlock}\n`);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
async getEventsFromDB() {
|
|
||||||
if (!this.userDirectory) {
|
|
||||||
console.log(
|
|
||||||
'Updating events for',
|
|
||||||
this.amount,
|
|
||||||
this.currency.toUpperCase(),
|
|
||||||
`${this.getType().toLowerCase()}s\n`,
|
|
||||||
);
|
|
||||||
console.log(`savedEvents count - ${0}`);
|
|
||||||
console.log(`savedEvents lastBlock - ${this.deployedBlock}\n`);
|
|
||||||
|
|
||||||
return {
|
|
||||||
events: [],
|
|
||||||
lastBlock: this.deployedBlock,
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
const savedEvents = await loadSavedEvents<DepositsEvents | WithdrawalsEvents>({
|
|
||||||
name: this.getInstanceName(),
|
|
||||||
userDirectory: this.userDirectory,
|
|
||||||
deployedBlock: this.deployedBlock,
|
|
||||||
});
|
|
||||||
|
|
||||||
console.log('Updating events for', this.amount, this.currency.toUpperCase(), `${this.getType().toLowerCase()}s\n`);
|
|
||||||
console.log(`savedEvents count - ${savedEvents.events.length}`);
|
|
||||||
console.log(`savedEvents lastBlock - ${savedEvents.lastBlock}\n`);
|
|
||||||
|
|
||||||
return savedEvents;
|
|
||||||
}
|
|
||||||
|
|
||||||
async getEventsFromCache() {
|
|
||||||
if (!this.cacheDirectory) {
|
|
||||||
console.log(`cachedEvents count - ${0}`);
|
|
||||||
console.log(`cachedEvents lastBlock - ${this.deployedBlock}\n`);
|
|
||||||
|
|
||||||
return {
|
|
||||||
events: [],
|
|
||||||
lastBlock: this.deployedBlock,
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
const cachedEvents = await loadCachedEvents<DepositsEvents | WithdrawalsEvents>({
|
|
||||||
name: this.getInstanceName(),
|
|
||||||
cacheDirectory: this.cacheDirectory,
|
|
||||||
deployedBlock: this.deployedBlock,
|
|
||||||
});
|
|
||||||
|
|
||||||
console.log(`cachedEvents count - ${cachedEvents.events.length}`);
|
|
||||||
console.log(`cachedEvents lastBlock - ${cachedEvents.lastBlock}\n`);
|
|
||||||
|
|
||||||
return cachedEvents;
|
|
||||||
}
|
|
||||||
|
|
||||||
async saveEvents({ events, lastBlock }: BaseEvents<DepositsEvents | WithdrawalsEvents>) {
|
|
||||||
const instanceName = this.getInstanceName();
|
|
||||||
|
|
||||||
console.log('\ntotalEvents count - ', events.length);
|
|
||||||
console.log(
|
|
||||||
`totalEvents lastBlock - ${events[events.length - 1] ? events[events.length - 1].blockNumber : lastBlock}\n`,
|
|
||||||
);
|
|
||||||
|
|
||||||
const eventTable = new Table();
|
|
||||||
|
|
||||||
eventTable.push(
|
|
||||||
[{ colSpan: 2, content: `${this.getType()}s`, hAlign: 'center' }],
|
|
||||||
['Instance', `${this.netId} chain ${this.amount} ${this.currency.toUpperCase()}`],
|
|
||||||
['Anonymity set', `${events.length} equal user ${this.getType().toLowerCase()}s`],
|
|
||||||
[{ colSpan: 2, content: `Latest ${this.getType().toLowerCase()}s` }],
|
|
||||||
...events
|
|
||||||
.slice(events.length - 10)
|
|
||||||
.reverse()
|
|
||||||
.map(({ timestamp }, index) => {
|
|
||||||
const eventIndex = events.length - index;
|
|
||||||
const eventTime = moment.unix(timestamp).fromNow();
|
|
||||||
|
|
||||||
return [eventIndex, eventTime];
|
|
||||||
}),
|
|
||||||
);
|
|
||||||
|
|
||||||
console.log(eventTable.toString() + '\n');
|
|
||||||
|
|
||||||
if (this.userDirectory) {
|
|
||||||
await saveUserFile({
|
|
||||||
fileName: instanceName + '.json',
|
|
||||||
userDirectory: this.userDirectory,
|
|
||||||
dataString: JSON.stringify(events, null, 2) + '\n',
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
export type NodeEchoServiceConstructor = BaseEchoServiceConstructor & {
|
|
||||||
cacheDirectory?: string;
|
|
||||||
userDirectory?: string;
|
|
||||||
};
|
|
||||||
|
|
||||||
export class NodeEchoService extends BaseEchoService {
|
|
||||||
cacheDirectory?: string;
|
|
||||||
userDirectory?: string;
|
|
||||||
|
|
||||||
constructor({
|
|
||||||
netId,
|
|
||||||
provider,
|
|
||||||
graphApi,
|
|
||||||
subgraphName,
|
|
||||||
Echoer,
|
|
||||||
deployedBlock,
|
|
||||||
fetchDataOptions,
|
|
||||||
cacheDirectory,
|
|
||||||
userDirectory,
|
|
||||||
}: NodeEchoServiceConstructor) {
|
|
||||||
super({
|
|
||||||
netId,
|
|
||||||
provider,
|
|
||||||
graphApi,
|
|
||||||
subgraphName,
|
|
||||||
Echoer,
|
|
||||||
deployedBlock,
|
|
||||||
fetchDataOptions,
|
|
||||||
});
|
|
||||||
|
|
||||||
this.cacheDirectory = cacheDirectory;
|
|
||||||
this.userDirectory = userDirectory;
|
|
||||||
}
|
|
||||||
|
|
||||||
updateEventProgress({ type, fromBlock, toBlock, count }: Parameters<BatchEventOnProgress>[0]) {
|
|
||||||
if (toBlock) {
|
|
||||||
console.log(`fromBlock - ${fromBlock}`);
|
|
||||||
console.log(`toBlock - ${toBlock}`);
|
|
||||||
|
|
||||||
if (count) {
|
|
||||||
console.log(`downloaded ${type} events count - ${count}`);
|
|
||||||
console.log('____________________________________________');
|
|
||||||
console.log(`Fetched ${type} events from ${fromBlock} to ${toBlock}\n`);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
updateGraphProgress({ type, fromBlock, toBlock, count }: Parameters<BatchEventOnProgress>[0]) {
|
|
||||||
if (toBlock) {
|
|
||||||
console.log(`fromBlock - ${fromBlock}`);
|
|
||||||
console.log(`toBlock - ${toBlock}`);
|
|
||||||
|
|
||||||
if (count) {
|
|
||||||
console.log(`downloaded ${type} events from graph node count - ${count}`);
|
|
||||||
console.log('____________________________________________');
|
|
||||||
console.log(`Fetched ${type} events from graph node ${fromBlock} to ${toBlock}\n`);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
async getEventsFromDB() {
|
|
||||||
if (!this.userDirectory) {
|
|
||||||
console.log(`Updating events for ${this.netId} chain echo events\n`);
|
|
||||||
console.log(`savedEvents count - ${0}`);
|
|
||||||
console.log(`savedEvents lastBlock - ${this.deployedBlock}\n`);
|
|
||||||
|
|
||||||
return {
|
|
||||||
events: [],
|
|
||||||
lastBlock: this.deployedBlock,
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
const savedEvents = await loadSavedEvents<EchoEvents>({
|
|
||||||
name: this.getInstanceName(),
|
|
||||||
userDirectory: this.userDirectory,
|
|
||||||
deployedBlock: this.deployedBlock,
|
|
||||||
});
|
|
||||||
|
|
||||||
console.log(`Updating events for ${this.netId} chain echo events\n`);
|
|
||||||
console.log(`savedEvents count - ${savedEvents.events.length}`);
|
|
||||||
console.log(`savedEvents lastBlock - ${savedEvents.lastBlock}\n`);
|
|
||||||
|
|
||||||
return savedEvents;
|
|
||||||
}
|
|
||||||
|
|
||||||
async getEventsFromCache() {
|
|
||||||
if (!this.cacheDirectory) {
|
|
||||||
console.log(`cachedEvents count - ${0}`);
|
|
||||||
console.log(`cachedEvents lastBlock - ${this.deployedBlock}\n`);
|
|
||||||
|
|
||||||
return {
|
|
||||||
events: [],
|
|
||||||
lastBlock: this.deployedBlock,
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
const cachedEvents = await loadCachedEvents<EchoEvents>({
|
|
||||||
name: this.getInstanceName(),
|
|
||||||
cacheDirectory: this.cacheDirectory,
|
|
||||||
deployedBlock: this.deployedBlock,
|
|
||||||
});
|
|
||||||
|
|
||||||
console.log(`cachedEvents count - ${cachedEvents.events.length}`);
|
|
||||||
console.log(`cachedEvents lastBlock - ${cachedEvents.lastBlock}\n`);
|
|
||||||
|
|
||||||
return cachedEvents;
|
|
||||||
}
|
|
||||||
|
|
||||||
async saveEvents({ events, lastBlock }: BaseEvents<EchoEvents>) {
|
|
||||||
const instanceName = this.getInstanceName();
|
|
||||||
|
|
||||||
console.log('\ntotalEvents count - ', events.length);
|
|
||||||
console.log(
|
|
||||||
`totalEvents lastBlock - ${events[events.length - 1] ? events[events.length - 1].blockNumber : lastBlock}\n`,
|
|
||||||
);
|
|
||||||
|
|
||||||
const eventTable = new Table();
|
|
||||||
|
|
||||||
eventTable.push(
|
|
||||||
[{ colSpan: 2, content: 'Echo Accounts', hAlign: 'center' }],
|
|
||||||
['Network', `${this.netId} chain`],
|
|
||||||
['Events', `${events.length} events`],
|
|
||||||
[{ colSpan: 2, content: 'Latest events' }],
|
|
||||||
...events
|
|
||||||
.slice(events.length - 10)
|
|
||||||
.reverse()
|
|
||||||
.map(({ blockNumber }, index) => {
|
|
||||||
const eventIndex = events.length - index;
|
|
||||||
|
|
||||||
return [eventIndex, blockNumber];
|
|
||||||
}),
|
|
||||||
);
|
|
||||||
|
|
||||||
console.log(eventTable.toString() + '\n');
|
|
||||||
|
|
||||||
if (this.userDirectory) {
|
|
||||||
await saveUserFile({
|
|
||||||
fileName: instanceName + '.json',
|
|
||||||
userDirectory: this.userDirectory,
|
|
||||||
dataString: JSON.stringify(events, null, 2) + '\n',
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
export type NodeEncryptedNotesServiceConstructor = BaseEncryptedNotesServiceConstructor & {
|
|
||||||
cacheDirectory?: string;
|
|
||||||
userDirectory?: string;
|
|
||||||
};
|
|
||||||
|
|
||||||
export class NodeEncryptedNotesService extends BaseEncryptedNotesService {
|
|
||||||
cacheDirectory?: string;
|
|
||||||
userDirectory?: string;
|
|
||||||
|
|
||||||
constructor({
|
|
||||||
netId,
|
|
||||||
provider,
|
|
||||||
graphApi,
|
|
||||||
subgraphName,
|
|
||||||
Router,
|
|
||||||
deployedBlock,
|
|
||||||
fetchDataOptions,
|
|
||||||
cacheDirectory,
|
|
||||||
userDirectory,
|
|
||||||
}: NodeEncryptedNotesServiceConstructor) {
|
|
||||||
super({
|
|
||||||
netId,
|
|
||||||
provider,
|
|
||||||
graphApi,
|
|
||||||
subgraphName,
|
|
||||||
Router,
|
|
||||||
deployedBlock,
|
|
||||||
fetchDataOptions,
|
|
||||||
});
|
|
||||||
|
|
||||||
this.cacheDirectory = cacheDirectory;
|
|
||||||
this.userDirectory = userDirectory;
|
|
||||||
}
|
|
||||||
|
|
||||||
updateEventProgress({ type, fromBlock, toBlock, count }: Parameters<BatchEventOnProgress>[0]) {
|
|
||||||
if (toBlock) {
|
|
||||||
console.log(`fromBlock - ${fromBlock}`);
|
|
||||||
console.log(`toBlock - ${toBlock}`);
|
|
||||||
|
|
||||||
if (count) {
|
|
||||||
console.log(`downloaded ${type} events count - ${count}`);
|
|
||||||
console.log('____________________________________________');
|
|
||||||
console.log(`Fetched ${type} events from ${fromBlock} to ${toBlock}\n`);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
updateGraphProgress({ type, fromBlock, toBlock, count }: Parameters<BatchEventOnProgress>[0]) {
|
|
||||||
if (toBlock) {
|
|
||||||
console.log(`fromBlock - ${fromBlock}`);
|
|
||||||
console.log(`toBlock - ${toBlock}`);
|
|
||||||
|
|
||||||
if (count) {
|
|
||||||
console.log(`downloaded ${type} events from graph node count - ${count}`);
|
|
||||||
console.log('____________________________________________');
|
|
||||||
console.log(`Fetched ${type} events from graph node ${fromBlock} to ${toBlock}\n`);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
async getEventsFromDB() {
|
|
||||||
if (!this.userDirectory) {
|
|
||||||
console.log(`Updating events for ${this.netId} chain encrypted events\n`);
|
|
||||||
console.log(`savedEvents count - ${0}`);
|
|
||||||
console.log(`savedEvents lastBlock - ${this.deployedBlock}\n`);
|
|
||||||
|
|
||||||
return {
|
|
||||||
events: [],
|
|
||||||
lastBlock: this.deployedBlock,
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
const savedEvents = await loadSavedEvents<EncryptedNotesEvents>({
|
|
||||||
name: this.getInstanceName(),
|
|
||||||
userDirectory: this.userDirectory,
|
|
||||||
deployedBlock: this.deployedBlock,
|
|
||||||
});
|
|
||||||
|
|
||||||
console.log(`Updating events for ${this.netId} chain encrypted events\n`);
|
|
||||||
console.log(`savedEvents count - ${savedEvents.events.length}`);
|
|
||||||
console.log(`savedEvents lastBlock - ${savedEvents.lastBlock}\n`);
|
|
||||||
|
|
||||||
return savedEvents;
|
|
||||||
}
|
|
||||||
|
|
||||||
async getEventsFromCache() {
|
|
||||||
if (!this.cacheDirectory) {
|
|
||||||
console.log(`cachedEvents count - ${0}`);
|
|
||||||
console.log(`cachedEvents lastBlock - ${this.deployedBlock}\n`);
|
|
||||||
|
|
||||||
return {
|
|
||||||
events: [],
|
|
||||||
lastBlock: this.deployedBlock,
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
const cachedEvents = await loadCachedEvents<EncryptedNotesEvents>({
|
|
||||||
name: this.getInstanceName(),
|
|
||||||
cacheDirectory: this.cacheDirectory,
|
|
||||||
deployedBlock: this.deployedBlock,
|
|
||||||
});
|
|
||||||
|
|
||||||
console.log(`cachedEvents count - ${cachedEvents.events.length}`);
|
|
||||||
console.log(`cachedEvents lastBlock - ${cachedEvents.lastBlock}\n`);
|
|
||||||
|
|
||||||
return cachedEvents;
|
|
||||||
}
|
|
||||||
|
|
||||||
async saveEvents({ events, lastBlock }: BaseEvents<EncryptedNotesEvents>) {
|
|
||||||
const instanceName = this.getInstanceName();
|
|
||||||
|
|
||||||
console.log('\ntotalEvents count - ', events.length);
|
|
||||||
console.log(
|
|
||||||
`totalEvents lastBlock - ${events[events.length - 1] ? events[events.length - 1].blockNumber : lastBlock}\n`,
|
|
||||||
);
|
|
||||||
|
|
||||||
const eventTable = new Table();
|
|
||||||
|
|
||||||
eventTable.push(
|
|
||||||
[{ colSpan: 2, content: 'Encrypted Notes', hAlign: 'center' }],
|
|
||||||
['Network', `${this.netId} chain`],
|
|
||||||
['Events', `${events.length} events`],
|
|
||||||
[{ colSpan: 2, content: 'Latest events' }],
|
|
||||||
...events
|
|
||||||
.slice(events.length - 10)
|
|
||||||
.reverse()
|
|
||||||
.map(({ blockNumber }, index) => {
|
|
||||||
const eventIndex = events.length - index;
|
|
||||||
|
|
||||||
return [eventIndex, blockNumber];
|
|
||||||
}),
|
|
||||||
);
|
|
||||||
|
|
||||||
console.log(eventTable.toString() + '\n');
|
|
||||||
|
|
||||||
if (this.userDirectory) {
|
|
||||||
await saveUserFile({
|
|
||||||
fileName: instanceName + '.json',
|
|
||||||
userDirectory: this.userDirectory,
|
|
||||||
dataString: JSON.stringify(events, null, 2) + '\n',
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
export type NodeGovernanceServiceConstructor = BaseGovernanceServiceConstructor & {
|
|
||||||
cacheDirectory?: string;
|
|
||||||
userDirectory?: string;
|
|
||||||
};
|
|
||||||
|
|
||||||
export class NodeGovernanceService extends BaseGovernanceService {
|
|
||||||
cacheDirectory?: string;
|
|
||||||
userDirectory?: string;
|
|
||||||
|
|
||||||
constructor({
|
|
||||||
netId,
|
|
||||||
provider,
|
|
||||||
graphApi,
|
|
||||||
subgraphName,
|
|
||||||
Governance,
|
|
||||||
deployedBlock,
|
|
||||||
fetchDataOptions,
|
|
||||||
cacheDirectory,
|
|
||||||
userDirectory,
|
|
||||||
}: NodeGovernanceServiceConstructor) {
|
|
||||||
super({
|
|
||||||
netId,
|
|
||||||
provider,
|
|
||||||
graphApi,
|
|
||||||
subgraphName,
|
|
||||||
Governance,
|
|
||||||
deployedBlock,
|
|
||||||
fetchDataOptions,
|
|
||||||
});
|
|
||||||
|
|
||||||
this.cacheDirectory = cacheDirectory;
|
|
||||||
this.userDirectory = userDirectory;
|
|
||||||
}
|
|
||||||
|
|
||||||
updateEventProgress({ type, fromBlock, toBlock, count }: Parameters<BatchEventOnProgress>[0]) {
|
|
||||||
if (toBlock) {
|
|
||||||
console.log(`fromBlock - ${fromBlock}`);
|
|
||||||
console.log(`toBlock - ${toBlock}`);
|
|
||||||
|
|
||||||
if (count) {
|
|
||||||
console.log(`downloaded ${type} events count - ${count}`);
|
|
||||||
console.log('____________________________________________');
|
|
||||||
console.log(`Fetched ${type} events from ${fromBlock} to ${toBlock}\n`);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
updateGraphProgress({ type, fromBlock, toBlock, count }: Parameters<BatchEventOnProgress>[0]) {
|
|
||||||
if (toBlock) {
|
|
||||||
console.log(`fromBlock - ${fromBlock}`);
|
|
||||||
console.log(`toBlock - ${toBlock}`);
|
|
||||||
|
|
||||||
if (count) {
|
|
||||||
console.log(`downloaded ${type} events from graph node count - ${count}`);
|
|
||||||
console.log('____________________________________________');
|
|
||||||
console.log(`Fetched ${type} events from graph node ${fromBlock} to ${toBlock}\n`);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
updateTransactionProgress({ currentIndex, totalIndex }: Parameters<BatchBlockOnProgress>[0]) {
|
|
||||||
if (totalIndex) {
|
|
||||||
console.log(`Fetched ${currentIndex} governance txs of ${totalIndex}`);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
async getEventsFromDB() {
|
|
||||||
if (!this.userDirectory) {
|
|
||||||
console.log(`Updating events for ${this.netId} chain governance events\n`);
|
|
||||||
console.log(`savedEvents count - ${0}`);
|
|
||||||
console.log(`savedEvents lastBlock - ${this.deployedBlock}\n`);
|
|
||||||
|
|
||||||
return {
|
|
||||||
events: [],
|
|
||||||
lastBlock: this.deployedBlock,
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
const savedEvents = await loadSavedEvents<AllGovernanceEvents>({
|
|
||||||
name: this.getInstanceName(),
|
|
||||||
userDirectory: this.userDirectory,
|
|
||||||
deployedBlock: this.deployedBlock,
|
|
||||||
});
|
|
||||||
|
|
||||||
console.log(`Updating events for ${this.netId} chain governance events\n`);
|
|
||||||
console.log(`savedEvents count - ${savedEvents.events.length}`);
|
|
||||||
console.log(`savedEvents lastBlock - ${savedEvents.lastBlock}\n`);
|
|
||||||
|
|
||||||
return savedEvents;
|
|
||||||
}
|
|
||||||
|
|
||||||
async getEventsFromCache() {
|
|
||||||
if (!this.cacheDirectory) {
|
|
||||||
console.log(`cachedEvents count - ${0}`);
|
|
||||||
console.log(`cachedEvents lastBlock - ${this.deployedBlock}\n`);
|
|
||||||
|
|
||||||
return {
|
|
||||||
events: [],
|
|
||||||
lastBlock: this.deployedBlock,
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
const cachedEvents = await loadCachedEvents<AllGovernanceEvents>({
|
|
||||||
name: this.getInstanceName(),
|
|
||||||
cacheDirectory: this.cacheDirectory,
|
|
||||||
deployedBlock: this.deployedBlock,
|
|
||||||
});
|
|
||||||
|
|
||||||
console.log(`cachedEvents count - ${cachedEvents.events.length}`);
|
|
||||||
console.log(`cachedEvents lastBlock - ${cachedEvents.lastBlock}\n`);
|
|
||||||
|
|
||||||
return cachedEvents;
|
|
||||||
}
|
|
||||||
|
|
||||||
async saveEvents({ events, lastBlock }: BaseEvents<AllGovernanceEvents>) {
|
|
||||||
const instanceName = this.getInstanceName();
|
|
||||||
|
|
||||||
console.log('\ntotalEvents count - ', events.length);
|
|
||||||
console.log(
|
|
||||||
`totalEvents lastBlock - ${events[events.length - 1] ? events[events.length - 1].blockNumber : lastBlock}\n`,
|
|
||||||
);
|
|
||||||
|
|
||||||
const eventTable = new Table();
|
|
||||||
|
|
||||||
eventTable.push(
|
|
||||||
[{ colSpan: 2, content: 'Governance Events', hAlign: 'center' }],
|
|
||||||
['Network', `${this.netId} chain`],
|
|
||||||
['Events', `${events.length} events`],
|
|
||||||
[{ colSpan: 2, content: 'Latest events' }],
|
|
||||||
...events
|
|
||||||
.slice(events.length - 10)
|
|
||||||
.reverse()
|
|
||||||
.map(({ blockNumber }, index) => {
|
|
||||||
const eventIndex = events.length - index;
|
|
||||||
|
|
||||||
return [eventIndex, blockNumber];
|
|
||||||
}),
|
|
||||||
);
|
|
||||||
|
|
||||||
console.log(eventTable.toString() + '\n');
|
|
||||||
|
|
||||||
if (this.userDirectory) {
|
|
||||||
await saveUserFile({
|
|
||||||
fileName: instanceName + '.json',
|
|
||||||
userDirectory: this.userDirectory,
|
|
||||||
dataString: JSON.stringify(events, null, 2) + '\n',
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
export type NodeRegistryServiceConstructor = BaseRegistryServiceConstructor & {
|
|
||||||
cacheDirectory?: string;
|
|
||||||
userDirectory?: string;
|
|
||||||
};
|
|
||||||
|
|
||||||
export class NodeRegistryService extends BaseRegistryService {
|
|
||||||
cacheDirectory?: string;
|
|
||||||
userDirectory?: string;
|
|
||||||
|
|
||||||
constructor({
|
|
||||||
netId,
|
|
||||||
provider,
|
|
||||||
graphApi,
|
|
||||||
subgraphName,
|
|
||||||
RelayerRegistry,
|
|
||||||
deployedBlock,
|
|
||||||
fetchDataOptions,
|
|
||||||
cacheDirectory,
|
|
||||||
userDirectory,
|
|
||||||
}: NodeRegistryServiceConstructor) {
|
|
||||||
super({
|
|
||||||
netId,
|
|
||||||
provider,
|
|
||||||
graphApi,
|
|
||||||
subgraphName,
|
|
||||||
RelayerRegistry,
|
|
||||||
deployedBlock,
|
|
||||||
fetchDataOptions,
|
|
||||||
});
|
|
||||||
|
|
||||||
this.cacheDirectory = cacheDirectory;
|
|
||||||
this.userDirectory = userDirectory;
|
|
||||||
}
|
|
||||||
|
|
||||||
updateEventProgress({ type, fromBlock, toBlock, count }: Parameters<BatchEventOnProgress>[0]) {
|
|
||||||
if (toBlock) {
|
|
||||||
console.log(`fromBlock - ${fromBlock}`);
|
|
||||||
console.log(`toBlock - ${toBlock}`);
|
|
||||||
|
|
||||||
if (count) {
|
|
||||||
console.log(`downloaded ${type} events count - ${count}`);
|
|
||||||
console.log('____________________________________________');
|
|
||||||
console.log(`Fetched ${type} events from ${fromBlock} to ${toBlock}\n`);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
updateGraphProgress({ type, fromBlock, toBlock, count }: Parameters<BatchEventOnProgress>[0]) {
|
|
||||||
if (toBlock) {
|
|
||||||
console.log(`fromBlock - ${fromBlock}`);
|
|
||||||
console.log(`toBlock - ${toBlock}`);
|
|
||||||
|
|
||||||
if (count) {
|
|
||||||
console.log(`downloaded ${type} events from graph node count - ${count}`);
|
|
||||||
console.log('____________________________________________');
|
|
||||||
console.log(`Fetched ${type} events from graph node ${fromBlock} to ${toBlock}\n`);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
async getEventsFromDB() {
|
|
||||||
if (!this.userDirectory) {
|
|
||||||
console.log(`Updating events for ${this.netId} chain registry events\n`);
|
|
||||||
console.log(`savedEvents count - ${0}`);
|
|
||||||
console.log(`savedEvents lastBlock - ${this.deployedBlock}\n`);
|
|
||||||
|
|
||||||
return {
|
|
||||||
events: [],
|
|
||||||
lastBlock: this.deployedBlock,
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
const savedEvents = await loadSavedEvents<RegistersEvents>({
|
|
||||||
name: this.getInstanceName(),
|
|
||||||
userDirectory: this.userDirectory,
|
|
||||||
deployedBlock: this.deployedBlock,
|
|
||||||
});
|
|
||||||
|
|
||||||
console.log(`Updating events for ${this.netId} chain registry events\n`);
|
|
||||||
console.log(`savedEvents count - ${savedEvents.events.length}`);
|
|
||||||
console.log(`savedEvents lastBlock - ${savedEvents.lastBlock}\n`);
|
|
||||||
|
|
||||||
return savedEvents;
|
|
||||||
}
|
|
||||||
|
|
||||||
async getEventsFromCache() {
|
|
||||||
if (!this.cacheDirectory) {
|
|
||||||
console.log(`cachedEvents count - ${0}`);
|
|
||||||
console.log(`cachedEvents lastBlock - ${this.deployedBlock}\n`);
|
|
||||||
|
|
||||||
return {
|
|
||||||
events: [],
|
|
||||||
lastBlock: this.deployedBlock,
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
const cachedEvents = await loadCachedEvents<RegistersEvents>({
|
|
||||||
name: this.getInstanceName(),
|
|
||||||
cacheDirectory: this.cacheDirectory,
|
|
||||||
deployedBlock: this.deployedBlock,
|
|
||||||
});
|
|
||||||
|
|
||||||
console.log(`cachedEvents count - ${cachedEvents.events.length}`);
|
|
||||||
console.log(`cachedEvents lastBlock - ${cachedEvents.lastBlock}\n`);
|
|
||||||
|
|
||||||
return cachedEvents;
|
|
||||||
}
|
|
||||||
|
|
||||||
async saveEvents({ events, lastBlock }: BaseEvents<RegistersEvents>) {
|
|
||||||
const instanceName = this.getInstanceName();
|
|
||||||
|
|
||||||
console.log('\ntotalEvents count - ', events.length);
|
|
||||||
console.log(
|
|
||||||
`totalEvents lastBlock - ${events[events.length - 1] ? events[events.length - 1].blockNumber : lastBlock}\n`,
|
|
||||||
);
|
|
||||||
|
|
||||||
const eventTable = new Table();
|
|
||||||
|
|
||||||
eventTable.push(
|
|
||||||
[{ colSpan: 2, content: 'Registered Relayers', hAlign: 'center' }],
|
|
||||||
['Network', `${this.netId} chain`],
|
|
||||||
['Events', `${events.length} events`],
|
|
||||||
[{ colSpan: 2, content: 'Latest events' }],
|
|
||||||
...events
|
|
||||||
.slice(events.length - 10)
|
|
||||||
.reverse()
|
|
||||||
.map(({ blockNumber }, index) => {
|
|
||||||
const eventIndex = events.length - index;
|
|
||||||
|
|
||||||
return [eventIndex, blockNumber];
|
|
||||||
}),
|
|
||||||
);
|
|
||||||
|
|
||||||
console.log(eventTable.toString() + '\n');
|
|
||||||
|
|
||||||
if (this.userDirectory) {
|
|
||||||
await saveUserFile({
|
|
||||||
fileName: instanceName + '.json',
|
|
||||||
userDirectory: this.userDirectory,
|
|
||||||
dataString: JSON.stringify(events, null, 2) + '\n',
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -3,7 +3,6 @@ export * from './graphql';
|
|||||||
export * from './schemas';
|
export * from './schemas';
|
||||||
export * from './typechain';
|
export * from './typechain';
|
||||||
export * from './batch';
|
export * from './batch';
|
||||||
export * from './data';
|
|
||||||
export * from './deposits';
|
export * from './deposits';
|
||||||
export * from './encryptedNotes';
|
export * from './encryptedNotes';
|
||||||
export * from './fees';
|
export * from './fees';
|
||||||
@ -11,12 +10,10 @@ export * from './merkleTree';
|
|||||||
export * from './mimc';
|
export * from './mimc';
|
||||||
export * from './multicall';
|
export * from './multicall';
|
||||||
export * from './networkConfig';
|
export * from './networkConfig';
|
||||||
export * from './parser';
|
|
||||||
export * from './pedersen';
|
export * from './pedersen';
|
||||||
export * from './prices';
|
export * from './prices';
|
||||||
export * from './providers';
|
export * from './providers';
|
||||||
export * from './relayerClient';
|
export * from './relayerClient';
|
||||||
export * from './tokens';
|
export * from './tokens';
|
||||||
export * from './treeCache';
|
|
||||||
export * from './utils';
|
export * from './utils';
|
||||||
export * from './websnark';
|
export * from './websnark';
|
||||||
|
@ -1,77 +0,0 @@
|
|||||||
import { InvalidArgumentError } from 'commander';
|
|
||||||
import { computeAddress, getAddress, Mnemonic } from 'ethers';
|
|
||||||
import { validateUrl } from './utils';
|
|
||||||
|
|
||||||
export function parseNumber(value?: string | number): number {
|
|
||||||
if (!value || isNaN(Number(value))) {
|
|
||||||
throw new InvalidArgumentError('Invalid Number');
|
|
||||||
}
|
|
||||||
return Number(value);
|
|
||||||
}
|
|
||||||
|
|
||||||
export function parseUrl(value?: string): string {
|
|
||||||
if (!value || !validateUrl(value, ['http:', 'https:'])) {
|
|
||||||
throw new InvalidArgumentError('Invalid URL');
|
|
||||||
}
|
|
||||||
return value;
|
|
||||||
}
|
|
||||||
|
|
||||||
export function parseRelayer(value?: string): string {
|
|
||||||
if (!value || !(value.endsWith('.eth') || validateUrl(value, ['http:', 'https:']))) {
|
|
||||||
throw new InvalidArgumentError('Invalid Relayer ETH address or URL');
|
|
||||||
}
|
|
||||||
return value;
|
|
||||||
}
|
|
||||||
|
|
||||||
export function parseAddress(value?: string): string {
|
|
||||||
if (!value) {
|
|
||||||
throw new InvalidArgumentError('Invalid Address');
|
|
||||||
}
|
|
||||||
try {
|
|
||||||
return getAddress(value);
|
|
||||||
} catch {
|
|
||||||
throw new InvalidArgumentError('Invalid Address');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
export function parseMnemonic(value?: string): string {
|
|
||||||
if (!value) {
|
|
||||||
throw new InvalidArgumentError('Invalid Mnemonic');
|
|
||||||
}
|
|
||||||
try {
|
|
||||||
Mnemonic.fromPhrase(value);
|
|
||||||
} catch {
|
|
||||||
throw new InvalidArgumentError('Invalid Mnemonic');
|
|
||||||
}
|
|
||||||
return value;
|
|
||||||
}
|
|
||||||
|
|
||||||
export function parseKey(value?: string): string {
|
|
||||||
if (!value) {
|
|
||||||
throw new InvalidArgumentError('Invalid Private Key');
|
|
||||||
}
|
|
||||||
if (value.length === 64) {
|
|
||||||
value = '0x' + value;
|
|
||||||
}
|
|
||||||
try {
|
|
||||||
computeAddress(value);
|
|
||||||
} catch {
|
|
||||||
throw new InvalidArgumentError('Invalid Private Key');
|
|
||||||
}
|
|
||||||
return value;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Recovery key shouldn't have a 0x prefix (Also this is how the UI generates)
|
|
||||||
*/
|
|
||||||
export function parseRecoveryKey(value?: string): string {
|
|
||||||
if (!value) {
|
|
||||||
throw new InvalidArgumentError('Invalid Recovery Key');
|
|
||||||
}
|
|
||||||
try {
|
|
||||||
computeAddress('0x' + value);
|
|
||||||
} catch {
|
|
||||||
throw new InvalidArgumentError('Invalid Recovery Key');
|
|
||||||
}
|
|
||||||
return value;
|
|
||||||
}
|
|
@ -1,9 +1,6 @@
|
|||||||
import type { EventEmitter } from 'stream';
|
import type { EventEmitter } from 'stream';
|
||||||
import type { RequestOptions } from 'http';
|
import type { RequestOptions } from 'http';
|
||||||
import crossFetch from 'cross-fetch';
|
import crossFetch from 'cross-fetch';
|
||||||
import { HttpProxyAgent } from 'http-proxy-agent';
|
|
||||||
import { HttpsProxyAgent } from 'https-proxy-agent';
|
|
||||||
import { SocksProxyAgent } from 'socks-proxy-agent';
|
|
||||||
import {
|
import {
|
||||||
FetchRequest,
|
FetchRequest,
|
||||||
JsonRpcApiProvider,
|
JsonRpcApiProvider,
|
||||||
@ -72,6 +69,12 @@ export function getHttpAgent({
|
|||||||
torPort?: number;
|
torPort?: number;
|
||||||
retry: number;
|
retry: number;
|
||||||
}): NodeAgent | undefined {
|
}): NodeAgent | undefined {
|
||||||
|
/* eslint-disable @typescript-eslint/no-var-requires */
|
||||||
|
const { HttpProxyAgent } = require('http-proxy-agent');
|
||||||
|
const { HttpsProxyAgent } = require('https-proxy-agent');
|
||||||
|
const { SocksProxyAgent } = require('socks-proxy-agent');
|
||||||
|
/* eslint-enable @typescript-eslint/no-var-requires */
|
||||||
|
|
||||||
if (torPort) {
|
if (torPort) {
|
||||||
return new SocksProxyAgent(`socks5h://tor${retry}@127.0.0.1:${torPort}`);
|
return new SocksProxyAgent(`socks5h://tor${retry}@127.0.0.1:${torPort}`);
|
||||||
}
|
}
|
||||||
@ -518,7 +521,8 @@ export class TornadoWallet extends Wallet {
|
|||||||
{ gasPriceBump, gasLimitBump, gasFailover, bumpNonce }: TornadoWalletOptions = {},
|
{ gasPriceBump, gasLimitBump, gasFailover, bumpNonce }: TornadoWalletOptions = {},
|
||||||
) {
|
) {
|
||||||
super(key, provider);
|
super(key, provider);
|
||||||
this.gasPriceBump = gasPriceBump ?? 0;
|
// 10% bump from the recommended fee
|
||||||
|
this.gasPriceBump = gasPriceBump ?? 1000;
|
||||||
// 30% bump from the recommended gaslimit
|
// 30% bump from the recommended gaslimit
|
||||||
this.gasLimitBump = gasLimitBump ?? 3000;
|
this.gasLimitBump = gasLimitBump ?? 3000;
|
||||||
this.gasFailover = gasFailover ?? false;
|
this.gasFailover = gasFailover ?? false;
|
||||||
@ -552,7 +556,8 @@ export class TornadoVoidSigner extends VoidSigner {
|
|||||||
{ gasPriceBump, gasLimitBump, gasFailover, bumpNonce }: TornadoWalletOptions = {},
|
{ gasPriceBump, gasLimitBump, gasFailover, bumpNonce }: TornadoWalletOptions = {},
|
||||||
) {
|
) {
|
||||||
super(address, provider);
|
super(address, provider);
|
||||||
this.gasPriceBump = gasPriceBump ?? 0;
|
// 10% bump from the recommended fee
|
||||||
|
this.gasPriceBump = gasPriceBump ?? 1000;
|
||||||
// 30% bump from the recommended gaslimit
|
// 30% bump from the recommended gaslimit
|
||||||
this.gasLimitBump = gasLimitBump ?? 3000;
|
this.gasLimitBump = gasLimitBump ?? 3000;
|
||||||
this.gasFailover = gasFailover ?? false;
|
this.gasFailover = gasFailover ?? false;
|
||||||
@ -580,7 +585,8 @@ export class TornadoRpcSigner extends JsonRpcSigner {
|
|||||||
{ gasPriceBump, gasLimitBump, gasFailover, bumpNonce }: TornadoWalletOptions = {},
|
{ gasPriceBump, gasLimitBump, gasFailover, bumpNonce }: TornadoWalletOptions = {},
|
||||||
) {
|
) {
|
||||||
super(provider, address);
|
super(provider, address);
|
||||||
this.gasPriceBump = gasPriceBump ?? 0;
|
// 10% bump from the recommended fee
|
||||||
|
this.gasPriceBump = gasPriceBump ?? 1000;
|
||||||
// 30% bump from the recommended gaslimit
|
// 30% bump from the recommended gaslimit
|
||||||
this.gasLimitBump = gasLimitBump ?? 3000;
|
this.gasLimitBump = gasLimitBump ?? 3000;
|
||||||
this.gasFailover = gasFailover ?? false;
|
this.gasFailover = gasFailover ?? false;
|
||||||
|
113
src/treeCache.ts
113
src/treeCache.ts
@ -1,113 +0,0 @@
|
|||||||
/**
|
|
||||||
* 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 BloomFilter from 'bloomfilter.js';
|
|
||||||
import { saveUserFile } from './data';
|
|
||||||
import { DepositsEvents } from './events';
|
|
||||||
import type { NetIdType } from './networkConfig';
|
|
||||||
|
|
||||||
export interface TreeCacheConstructor {
|
|
||||||
netId: NetIdType;
|
|
||||||
amount: string;
|
|
||||||
currency: string;
|
|
||||||
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 class TreeCache {
|
|
||||||
netId: NetIdType;
|
|
||||||
amount: string;
|
|
||||||
currency: string;
|
|
||||||
userDirectory: string;
|
|
||||||
|
|
||||||
PARTS_COUNT: number;
|
|
||||||
|
|
||||||
constructor({ netId, amount, currency, userDirectory, PARTS_COUNT = 4 }: TreeCacheConstructor) {
|
|
||||||
this.netId = netId;
|
|
||||||
this.amount = amount;
|
|
||||||
this.currency = currency;
|
|
||||||
this.userDirectory = userDirectory;
|
|
||||||
|
|
||||||
this.PARTS_COUNT = PARTS_COUNT;
|
|
||||||
}
|
|
||||||
|
|
||||||
getInstanceName(): string {
|
|
||||||
return `deposits_${this.netId}_${this.currency}_${this.amount}`;
|
|
||||||
}
|
|
||||||
|
|
||||||
async createTree(events: DepositsEvents[], tree: MerkleTree) {
|
|
||||||
const bloom = new BloomFilter(events.length);
|
|
||||||
|
|
||||||
console.log(`Creating cached tree for ${this.getInstanceName()}\n`);
|
|
||||||
|
|
||||||
// events indexed by commitment
|
|
||||||
const eventsData = events.reduce(
|
|
||||||
(acc, { leafIndex, commitment, ...rest }, i) => {
|
|
||||||
if (leafIndex !== i) {
|
|
||||||
throw new Error(`leafIndex (${leafIndex}) !== i (${i})`);
|
|
||||||
}
|
|
||||||
|
|
||||||
acc[commitment] = { ...rest, leafIndex };
|
|
||||||
|
|
||||||
return acc;
|
|
||||||
},
|
|
||||||
{} as { [key in string]: treeMetadata },
|
|
||||||
);
|
|
||||||
|
|
||||||
const slices = tree.getTreeSlices(this.PARTS_COUNT);
|
|
||||||
|
|
||||||
await Promise.all(
|
|
||||||
slices.map(async (slice, index) => {
|
|
||||||
const metadata = slice.elements.reduce((acc, curr) => {
|
|
||||||
if (index < this.PARTS_COUNT - 1) {
|
|
||||||
bloom.add(curr);
|
|
||||||
}
|
|
||||||
acc.push(eventsData[curr]);
|
|
||||||
return acc;
|
|
||||||
}, [] as treeMetadata[]);
|
|
||||||
|
|
||||||
const dataString =
|
|
||||||
JSON.stringify(
|
|
||||||
{
|
|
||||||
...slice,
|
|
||||||
metadata,
|
|
||||||
},
|
|
||||||
null,
|
|
||||||
2,
|
|
||||||
) + '\n';
|
|
||||||
|
|
||||||
const fileName = `${this.getInstanceName()}_slice${index + 1}.json`;
|
|
||||||
|
|
||||||
await saveUserFile({
|
|
||||||
fileName,
|
|
||||||
userDirectory: this.userDirectory,
|
|
||||||
dataString,
|
|
||||||
});
|
|
||||||
}),
|
|
||||||
);
|
|
||||||
|
|
||||||
const dataString = bloom.serialize() + '\n';
|
|
||||||
|
|
||||||
const fileName = `${this.getInstanceName()}_bloom.json`;
|
|
||||||
|
|
||||||
await saveUserFile({
|
|
||||||
fileName,
|
|
||||||
userDirectory: this.userDirectory,
|
|
||||||
dataString,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
25
src/types/bloomfilter.js.d.ts
vendored
25
src/types/bloomfilter.js.d.ts
vendored
@ -1,25 +0,0 @@
|
|||||||
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
||||||
declare module 'bloomfilter.js' {
|
|
||||||
export default class BloomFilter {
|
|
||||||
m: number;
|
|
||||||
k: number;
|
|
||||||
size: number;
|
|
||||||
bitview: any;
|
|
||||||
|
|
||||||
constructor(n: number, false_postive_tolerance?: number);
|
|
||||||
|
|
||||||
calculateHash(x: number, m: number, i: number): number;
|
|
||||||
|
|
||||||
test(data: any): boolean;
|
|
||||||
|
|
||||||
add(data: any): void;
|
|
||||||
|
|
||||||
bytelength(): number;
|
|
||||||
|
|
||||||
view(): Uint8Array;
|
|
||||||
|
|
||||||
serialize(): string;
|
|
||||||
|
|
||||||
deserialize(serialized: string): BloomFilter;
|
|
||||||
}
|
|
||||||
}
|
|
@ -14,14 +14,10 @@ const esbuildLoader = {
|
|||||||
|
|
||||||
const commonAlias = {
|
const commonAlias = {
|
||||||
fs: false,
|
fs: false,
|
||||||
'fs/promises': false,
|
|
||||||
'path': false,
|
'path': false,
|
||||||
'url': false,
|
'url': false,
|
||||||
'worker_threads': false,
|
'worker_threads': false,
|
||||||
'fflate': 'fflate/browser',
|
'fflate': 'fflate/browser',
|
||||||
'@colors/colors': false,
|
|
||||||
'cli-table3': false,
|
|
||||||
'commander': false,
|
|
||||||
'http-proxy-agent': false,
|
'http-proxy-agent': false,
|
||||||
'https-proxy-agent': false,
|
'https-proxy-agent': false,
|
||||||
'socks-proxy-agent': false,
|
'socks-proxy-agent': false,
|
||||||
|
125
yarn.lock
125
yarn.lock
@ -35,11 +35,6 @@
|
|||||||
js-tokens "^4.0.0"
|
js-tokens "^4.0.0"
|
||||||
picocolors "^1.0.0"
|
picocolors "^1.0.0"
|
||||||
|
|
||||||
"@colors/colors@1.5.0":
|
|
||||||
version "1.5.0"
|
|
||||||
resolved "https://registry.yarnpkg.com/@colors/colors/-/colors-1.5.0.tgz#bb504579c1cae923e6576a4f5da43d25f97bdbd9"
|
|
||||||
integrity sha512-ooWCrlZP11i8GImSjTHYHLkvFDP48nS4+204nGb1RiX/WXYHmJA2III9/e2DWVabCESdW7hBAEzHRqUn9OUVvQ==
|
|
||||||
|
|
||||||
"@discoveryjs/json-ext@^0.5.0":
|
"@discoveryjs/json-ext@^0.5.0":
|
||||||
version "0.5.7"
|
version "0.5.7"
|
||||||
resolved "https://registry.yarnpkg.com/@discoveryjs/json-ext/-/json-ext-0.5.7.tgz#1d572bfbbe14b7704e0ba0f39b74815b84870d70"
|
resolved "https://registry.yarnpkg.com/@discoveryjs/json-ext/-/json-ext-0.5.7.tgz#1d572bfbbe14b7704e0ba0f39b74815b84870d70"
|
||||||
@ -1268,13 +1263,6 @@ aes-js@4.0.0-beta.5:
|
|||||||
resolved "https://registry.yarnpkg.com/aes-js/-/aes-js-4.0.0-beta.5.tgz#8d2452c52adedebc3a3e28465d858c11ca315873"
|
resolved "https://registry.yarnpkg.com/aes-js/-/aes-js-4.0.0-beta.5.tgz#8d2452c52adedebc3a3e28465d858c11ca315873"
|
||||||
integrity sha512-G965FqalsNyrPqgEGON7nIx1e/OVENSgiEIzyC63haUMuvNnwIgIjMs52hlTCKhkBny7A2ORNlfY9Zu+jmGk1Q==
|
integrity sha512-G965FqalsNyrPqgEGON7nIx1e/OVENSgiEIzyC63haUMuvNnwIgIjMs52hlTCKhkBny7A2ORNlfY9Zu+jmGk1Q==
|
||||||
|
|
||||||
agent-base@^7.0.2, agent-base@^7.1.0, agent-base@^7.1.1:
|
|
||||||
version "7.1.1"
|
|
||||||
resolved "https://registry.yarnpkg.com/agent-base/-/agent-base-7.1.1.tgz#bdbded7dfb096b751a2a087eeeb9664725b2e317"
|
|
||||||
integrity sha512-H0TSyFNDMomMNJQBn8wFV5YC/2eJ+VXECwOadZJT554xP6cODZHPX3H9QMQECxvrgiSOP1pHjy1sMWQVYJOUOA==
|
|
||||||
dependencies:
|
|
||||||
debug "^4.3.4"
|
|
||||||
|
|
||||||
ajv-keywords@^3.5.2:
|
ajv-keywords@^3.5.2:
|
||||||
version "3.5.2"
|
version "3.5.2"
|
||||||
resolved "https://registry.yarnpkg.com/ajv-keywords/-/ajv-keywords-3.5.2.tgz#31f29da5ab6e00d1c2d329acf7b5929614d5014d"
|
resolved "https://registry.yarnpkg.com/ajv-keywords/-/ajv-keywords-3.5.2.tgz#31f29da5ab6e00d1c2d329acf7b5929614d5014d"
|
||||||
@ -1546,11 +1534,6 @@ blakejs@^1.1.0:
|
|||||||
resolved "https://registry.yarnpkg.com/blakejs/-/blakejs-1.2.1.tgz#5057e4206eadb4a97f7c0b6e197a505042fc3814"
|
resolved "https://registry.yarnpkg.com/blakejs/-/blakejs-1.2.1.tgz#5057e4206eadb4a97f7c0b6e197a505042fc3814"
|
||||||
integrity sha512-QXUSXI3QVc/gJME0dBpXrag1kbzOqCjCX8/b54ntNyW6sjtoqxqRk3LTmXzaJoh71zMsDCjM+47jS7XiwN/+fQ==
|
integrity sha512-QXUSXI3QVc/gJME0dBpXrag1kbzOqCjCX8/b54ntNyW6sjtoqxqRk3LTmXzaJoh71zMsDCjM+47jS7XiwN/+fQ==
|
||||||
|
|
||||||
bloomfilter.js@^1.0.2:
|
|
||||||
version "1.0.2"
|
|
||||||
resolved "https://registry.yarnpkg.com/bloomfilter.js/-/bloomfilter.js-1.0.2.tgz#63449e4b055dc08e5e4db75367d48cc0a395e704"
|
|
||||||
integrity sha512-x3SG+7/NlT5m6hHy1GCerNoWm38kxWZeUIsBs1LaMwnTLM0hidmGalhAfXH07DtP3s9QAp+JAQagpgVIxtUl9g==
|
|
||||||
|
|
||||||
bn.js@^4.0.0, bn.js@^4.1.0, bn.js@^4.11.9:
|
bn.js@^4.0.0, bn.js@^4.1.0, bn.js@^4.11.9:
|
||||||
version "4.12.0"
|
version "4.12.0"
|
||||||
resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-4.12.0.tgz#775b3f278efbb9718eec7361f483fb36fbbfea88"
|
resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-4.12.0.tgz#775b3f278efbb9718eec7361f483fb36fbbfea88"
|
||||||
@ -1786,15 +1769,6 @@ cli-cursor@^2.1.0:
|
|||||||
dependencies:
|
dependencies:
|
||||||
restore-cursor "^2.0.0"
|
restore-cursor "^2.0.0"
|
||||||
|
|
||||||
cli-table3@^0.6.4:
|
|
||||||
version "0.6.4"
|
|
||||||
resolved "https://registry.yarnpkg.com/cli-table3/-/cli-table3-0.6.4.tgz#d1c536b8a3f2e7bec58f67ac9e5769b1b30088b0"
|
|
||||||
integrity sha512-Lm3L0p+/npIQWNIiyF/nAn7T5dnOwR3xNTHXYEBFBFVPXzCVNZ5lqEC/1eo/EVfpDsQ1I+TX4ORPQgp+UI0CRw==
|
|
||||||
dependencies:
|
|
||||||
string-width "^4.2.0"
|
|
||||||
optionalDependencies:
|
|
||||||
"@colors/colors" "1.5.0"
|
|
||||||
|
|
||||||
cli-width@^2.0.0:
|
cli-width@^2.0.0:
|
||||||
version "2.2.1"
|
version "2.2.1"
|
||||||
resolved "https://registry.yarnpkg.com/cli-width/-/cli-width-2.2.1.tgz#b0433d0b4e9c847ef18868a4ef16fd5fc8271c48"
|
resolved "https://registry.yarnpkg.com/cli-width/-/cli-width-2.2.1.tgz#b0433d0b4e9c847ef18868a4ef16fd5fc8271c48"
|
||||||
@ -1884,11 +1858,6 @@ commander@^10.0.1:
|
|||||||
resolved "https://registry.yarnpkg.com/commander/-/commander-10.0.1.tgz#881ee46b4f77d1c1dccc5823433aa39b022cbe06"
|
resolved "https://registry.yarnpkg.com/commander/-/commander-10.0.1.tgz#881ee46b4f77d1c1dccc5823433aa39b022cbe06"
|
||||||
integrity sha512-y4Mg2tXshplEbSGzx7amzPwKKOCGuoSRP/CjEdwwk0FOGlUbq6lKuoyDZTNZkmxHdJtp54hdfY/JUrdL7Xfdug==
|
integrity sha512-y4Mg2tXshplEbSGzx7amzPwKKOCGuoSRP/CjEdwwk0FOGlUbq6lKuoyDZTNZkmxHdJtp54hdfY/JUrdL7Xfdug==
|
||||||
|
|
||||||
commander@^12.0.0:
|
|
||||||
version "12.0.0"
|
|
||||||
resolved "https://registry.yarnpkg.com/commander/-/commander-12.0.0.tgz#b929db6df8546080adfd004ab215ed48cf6f2592"
|
|
||||||
integrity sha512-MwVNWlYjDTtOjX5PiD7o5pK0UrFU/OYgcJfjjK4RaHZETNtjJqrZa9Y9ds88+A+f+d5lv+561eZ+yCKoS3gbAA==
|
|
||||||
|
|
||||||
commander@^2.20.0:
|
commander@^2.20.0:
|
||||||
version "2.20.3"
|
version "2.20.3"
|
||||||
resolved "https://registry.yarnpkg.com/commander/-/commander-2.20.3.tgz#fd485e84c03eb4881c20722ba48035e8531aeb33"
|
resolved "https://registry.yarnpkg.com/commander/-/commander-2.20.3.tgz#fd485e84c03eb4881c20722ba48035e8531aeb33"
|
||||||
@ -2026,13 +1995,6 @@ data-view-byte-offset@^1.0.0:
|
|||||||
es-errors "^1.3.0"
|
es-errors "^1.3.0"
|
||||||
is-data-view "^1.0.1"
|
is-data-view "^1.0.1"
|
||||||
|
|
||||||
debug@4, debug@^4.0.1, debug@^4.3.1, debug@^4.3.2, debug@^4.3.4:
|
|
||||||
version "4.3.4"
|
|
||||||
resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.4.tgz#1319f6579357f2338d3337d2cdd4914bb5dcc865"
|
|
||||||
integrity sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==
|
|
||||||
dependencies:
|
|
||||||
ms "2.1.2"
|
|
||||||
|
|
||||||
debug@^3.2.7:
|
debug@^3.2.7:
|
||||||
version "3.2.7"
|
version "3.2.7"
|
||||||
resolved "https://registry.yarnpkg.com/debug/-/debug-3.2.7.tgz#72580b7e9145fb39b6676f9c5e5fb100b934179a"
|
resolved "https://registry.yarnpkg.com/debug/-/debug-3.2.7.tgz#72580b7e9145fb39b6676f9c5e5fb100b934179a"
|
||||||
@ -2040,6 +2002,13 @@ debug@^3.2.7:
|
|||||||
dependencies:
|
dependencies:
|
||||||
ms "^2.1.1"
|
ms "^2.1.1"
|
||||||
|
|
||||||
|
debug@^4.0.1, debug@^4.3.1, debug@^4.3.2, debug@^4.3.4:
|
||||||
|
version "4.3.4"
|
||||||
|
resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.4.tgz#1319f6579357f2338d3337d2cdd4914bb5dcc865"
|
||||||
|
integrity sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==
|
||||||
|
dependencies:
|
||||||
|
ms "2.1.2"
|
||||||
|
|
||||||
decamelize@^1.2.0:
|
decamelize@^1.2.0:
|
||||||
version "1.2.0"
|
version "1.2.0"
|
||||||
resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290"
|
resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290"
|
||||||
@ -2169,11 +2138,6 @@ emoji-regex@^7.0.1:
|
|||||||
resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-7.0.3.tgz#933a04052860c85e83c122479c4748a8e4c72156"
|
resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-7.0.3.tgz#933a04052860c85e83c122479c4748a8e4c72156"
|
||||||
integrity sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==
|
integrity sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==
|
||||||
|
|
||||||
emoji-regex@^8.0.0:
|
|
||||||
version "8.0.0"
|
|
||||||
resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-8.0.0.tgz#e818fd69ce5ccfcb404594f842963bf53164cc37"
|
|
||||||
integrity sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==
|
|
||||||
|
|
||||||
emojis-list@^3.0.0:
|
emojis-list@^3.0.0:
|
||||||
version "3.0.0"
|
version "3.0.0"
|
||||||
resolved "https://registry.yarnpkg.com/emojis-list/-/emojis-list-3.0.0.tgz#5570662046ad29e2e916e71aae260abdff4f6a78"
|
resolved "https://registry.yarnpkg.com/emojis-list/-/emojis-list-3.0.0.tgz#5570662046ad29e2e916e71aae260abdff4f6a78"
|
||||||
@ -3142,27 +3106,11 @@ hmac-drbg@^1.0.1:
|
|||||||
minimalistic-assert "^1.0.0"
|
minimalistic-assert "^1.0.0"
|
||||||
minimalistic-crypto-utils "^1.0.1"
|
minimalistic-crypto-utils "^1.0.1"
|
||||||
|
|
||||||
http-proxy-agent@^7.0.2:
|
|
||||||
version "7.0.2"
|
|
||||||
resolved "https://registry.yarnpkg.com/http-proxy-agent/-/http-proxy-agent-7.0.2.tgz#9a8b1f246866c028509486585f62b8f2c18c270e"
|
|
||||||
integrity sha512-T1gkAiYYDWYx3V5Bmyu7HcfcvL7mUrTWiM6yOfa3PIphViJ/gFPbvidQ+veqSOHci/PxBcDabeUNCzpOODJZig==
|
|
||||||
dependencies:
|
|
||||||
agent-base "^7.1.0"
|
|
||||||
debug "^4.3.4"
|
|
||||||
|
|
||||||
https-browserify@^1.0.0:
|
https-browserify@^1.0.0:
|
||||||
version "1.0.0"
|
version "1.0.0"
|
||||||
resolved "https://registry.yarnpkg.com/https-browserify/-/https-browserify-1.0.0.tgz#ec06c10e0a34c0f2faf199f7fd7fc78fffd03c73"
|
resolved "https://registry.yarnpkg.com/https-browserify/-/https-browserify-1.0.0.tgz#ec06c10e0a34c0f2faf199f7fd7fc78fffd03c73"
|
||||||
integrity sha512-J+FkSdyD+0mA0N+81tMotaRMfSL9SGi+xpD3T6YApKsc3bGSXJlfXri3VyFOeYkfLRQisDk1W+jIFFKBeUBbBg==
|
integrity sha512-J+FkSdyD+0mA0N+81tMotaRMfSL9SGi+xpD3T6YApKsc3bGSXJlfXri3VyFOeYkfLRQisDk1W+jIFFKBeUBbBg==
|
||||||
|
|
||||||
https-proxy-agent@^7.0.4:
|
|
||||||
version "7.0.4"
|
|
||||||
resolved "https://registry.yarnpkg.com/https-proxy-agent/-/https-proxy-agent-7.0.4.tgz#8e97b841a029ad8ddc8731f26595bad868cb4168"
|
|
||||||
integrity sha512-wlwpilI7YdjSkWaQ/7omYBMTliDcmCN8OLihO6I9B86g06lMyAoqgoDpV0XqoaPOKj+0DIdAvnsWfyAAhmimcg==
|
|
||||||
dependencies:
|
|
||||||
agent-base "^7.0.2"
|
|
||||||
debug "4"
|
|
||||||
|
|
||||||
iconv-lite@^0.4.24:
|
iconv-lite@^0.4.24:
|
||||||
version "0.4.24"
|
version "0.4.24"
|
||||||
resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.24.tgz#2022b4b25fbddc21d2f524974a474aafe733908b"
|
resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.24.tgz#2022b4b25fbddc21d2f524974a474aafe733908b"
|
||||||
@ -3257,14 +3205,6 @@ invert-kv@^2.0.0:
|
|||||||
resolved "https://registry.yarnpkg.com/invert-kv/-/invert-kv-2.0.0.tgz#7393f5afa59ec9ff5f67a27620d11c226e3eec02"
|
resolved "https://registry.yarnpkg.com/invert-kv/-/invert-kv-2.0.0.tgz#7393f5afa59ec9ff5f67a27620d11c226e3eec02"
|
||||||
integrity sha512-wPVv/y/QQ/Uiirj/vh3oP+1Ww+AWehmi1g5fFWGPF6IpCBCDVrhgHRMvrLfdYcwDh3QJbGXDW4JAuzxElLSqKA==
|
integrity sha512-wPVv/y/QQ/Uiirj/vh3oP+1Ww+AWehmi1g5fFWGPF6IpCBCDVrhgHRMvrLfdYcwDh3QJbGXDW4JAuzxElLSqKA==
|
||||||
|
|
||||||
ip-address@^9.0.5:
|
|
||||||
version "9.0.5"
|
|
||||||
resolved "https://registry.yarnpkg.com/ip-address/-/ip-address-9.0.5.tgz#117a960819b08780c3bd1f14ef3c1cc1d3f3ea5a"
|
|
||||||
integrity sha512-zHtQzGojZXTwZTHQqra+ETKd4Sn3vgi7uBmlPoXVWZqYvuKmtI0l/VZTjqGmJY9x88GGOaZ9+G9ES8hC4T4X8g==
|
|
||||||
dependencies:
|
|
||||||
jsbn "1.1.0"
|
|
||||||
sprintf-js "^1.1.3"
|
|
||||||
|
|
||||||
is-arguments@^1.0.4:
|
is-arguments@^1.0.4:
|
||||||
version "1.1.1"
|
version "1.1.1"
|
||||||
resolved "https://registry.yarnpkg.com/is-arguments/-/is-arguments-1.1.1.tgz#15b3f88fda01f2a97fec84ca761a560f123efa9b"
|
resolved "https://registry.yarnpkg.com/is-arguments/-/is-arguments-1.1.1.tgz#15b3f88fda01f2a97fec84ca761a560f123efa9b"
|
||||||
@ -3346,11 +3286,6 @@ is-fullwidth-code-point@^2.0.0:
|
|||||||
resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz#a3b30a5c4f199183167aaab93beefae3ddfb654f"
|
resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz#a3b30a5c4f199183167aaab93beefae3ddfb654f"
|
||||||
integrity sha512-VHskAKYM8RfSFXwee5t5cbN5PZeq1Wrh6qd5bkyiXIf6UQcN6w/A0eXM9r6t8d+GYOh+o6ZhiEnb88LN/Y8m2w==
|
integrity sha512-VHskAKYM8RfSFXwee5t5cbN5PZeq1Wrh6qd5bkyiXIf6UQcN6w/A0eXM9r6t8d+GYOh+o6ZhiEnb88LN/Y8m2w==
|
||||||
|
|
||||||
is-fullwidth-code-point@^3.0.0:
|
|
||||||
version "3.0.0"
|
|
||||||
resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz#f116f8064fe90b3f7844a38997c0b75051269f1d"
|
|
||||||
integrity sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==
|
|
||||||
|
|
||||||
is-generator-function@^1.0.7:
|
is-generator-function@^1.0.7:
|
||||||
version "1.0.10"
|
version "1.0.10"
|
||||||
resolved "https://registry.yarnpkg.com/is-generator-function/-/is-generator-function-1.0.10.tgz#f1558baf1ac17e0deea7c0415c438351ff2b3c72"
|
resolved "https://registry.yarnpkg.com/is-generator-function/-/is-generator-function-1.0.10.tgz#f1558baf1ac17e0deea7c0415c438351ff2b3c72"
|
||||||
@ -3516,11 +3451,6 @@ js-yaml@^4.1.0:
|
|||||||
dependencies:
|
dependencies:
|
||||||
argparse "^2.0.1"
|
argparse "^2.0.1"
|
||||||
|
|
||||||
jsbn@1.1.0:
|
|
||||||
version "1.1.0"
|
|
||||||
resolved "https://registry.yarnpkg.com/jsbn/-/jsbn-1.1.0.tgz#b01307cb29b618a1ed26ec79e911f803c4da0040"
|
|
||||||
integrity sha512-4bYVV3aAMtDTTu4+xsDYa6sy9GyJ69/amsu9sYF2zqjiEoZA5xJi3BrfX3uY+/IekIu7MwdObdbDWpoZdBv3/A==
|
|
||||||
|
|
||||||
json-buffer@3.0.1:
|
json-buffer@3.0.1:
|
||||||
version "3.0.1"
|
version "3.0.1"
|
||||||
resolved "https://registry.yarnpkg.com/json-buffer/-/json-buffer-3.0.1.tgz#9338802a30d3b6605fbe0613e094008ca8c05a13"
|
resolved "https://registry.yarnpkg.com/json-buffer/-/json-buffer-3.0.1.tgz#9338802a30d3b6605fbe0613e094008ca8c05a13"
|
||||||
@ -3808,11 +3738,6 @@ mkdirp@^1.0.4:
|
|||||||
resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-1.0.4.tgz#3eb5ed62622756d79a5f0e2a221dfebad75c2f7e"
|
resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-1.0.4.tgz#3eb5ed62622756d79a5f0e2a221dfebad75c2f7e"
|
||||||
integrity sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==
|
integrity sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==
|
||||||
|
|
||||||
moment@^2.30.1:
|
|
||||||
version "2.30.1"
|
|
||||||
resolved "https://registry.yarnpkg.com/moment/-/moment-2.30.1.tgz#f8c91c07b7a786e30c59926df530b4eac96974ae"
|
|
||||||
integrity sha512-uEmtNhbDOrWPFS+hdjFCBfy9f2YoyzRpwcl+DqpC6taX21FzsTLQVbMV/W7PzNSX6x/bhC1zA3c2UQ5NzH6how==
|
|
||||||
|
|
||||||
ms@2.1.2:
|
ms@2.1.2:
|
||||||
version "2.1.2"
|
version "2.1.2"
|
||||||
resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009"
|
resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009"
|
||||||
@ -4667,28 +4592,6 @@ slice-ansi@^2.1.0:
|
|||||||
astral-regex "^1.0.0"
|
astral-regex "^1.0.0"
|
||||||
is-fullwidth-code-point "^2.0.0"
|
is-fullwidth-code-point "^2.0.0"
|
||||||
|
|
||||||
smart-buffer@^4.2.0:
|
|
||||||
version "4.2.0"
|
|
||||||
resolved "https://registry.yarnpkg.com/smart-buffer/-/smart-buffer-4.2.0.tgz#6e1d71fa4f18c05f7d0ff216dd16a481d0e8d9ae"
|
|
||||||
integrity sha512-94hK0Hh8rPqQl2xXc3HsaBoOXKV20MToPkcXvwbISWLEs+64sBq5kFgn2kJDHb1Pry9yrP0dxrCI9RRci7RXKg==
|
|
||||||
|
|
||||||
socks-proxy-agent@^8.0.3:
|
|
||||||
version "8.0.3"
|
|
||||||
resolved "https://registry.yarnpkg.com/socks-proxy-agent/-/socks-proxy-agent-8.0.3.tgz#6b2da3d77364fde6292e810b496cb70440b9b89d"
|
|
||||||
integrity sha512-VNegTZKhuGq5vSD6XNKlbqWhyt/40CgoEw8XxD6dhnm8Jq9IEa3nIa4HwnM8XOqU0CdB0BwWVXusqiFXfHB3+A==
|
|
||||||
dependencies:
|
|
||||||
agent-base "^7.1.1"
|
|
||||||
debug "^4.3.4"
|
|
||||||
socks "^2.7.1"
|
|
||||||
|
|
||||||
socks@^2.7.1:
|
|
||||||
version "2.8.1"
|
|
||||||
resolved "https://registry.yarnpkg.com/socks/-/socks-2.8.1.tgz#22c7d9dd7882649043cba0eafb49ae144e3457af"
|
|
||||||
integrity sha512-B6w7tkwNid7ToxjZ08rQMT8M9BJAf8DKx8Ft4NivzH0zBUfd6jldGcisJn/RLgxcX3FPNDdNQCUEMMT79b+oCQ==
|
|
||||||
dependencies:
|
|
||||||
ip-address "^9.0.5"
|
|
||||||
smart-buffer "^4.2.0"
|
|
||||||
|
|
||||||
source-list-map@^2.0.0:
|
source-list-map@^2.0.0:
|
||||||
version "2.0.1"
|
version "2.0.1"
|
||||||
resolved "https://registry.yarnpkg.com/source-list-map/-/source-list-map-2.0.1.tgz#3993bd873bfc48479cca9ea3a547835c7c154b34"
|
resolved "https://registry.yarnpkg.com/source-list-map/-/source-list-map-2.0.1.tgz#3993bd873bfc48479cca9ea3a547835c7c154b34"
|
||||||
@ -4707,11 +4610,6 @@ source-map@^0.6.0, source-map@~0.6.1:
|
|||||||
resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263"
|
resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263"
|
||||||
integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==
|
integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==
|
||||||
|
|
||||||
sprintf-js@^1.1.3:
|
|
||||||
version "1.1.3"
|
|
||||||
resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.1.3.tgz#4914b903a2f8b685d17fdf78a70e917e872e444a"
|
|
||||||
integrity sha512-Oo+0REFV59/rz3gfJNKQiBlwfHaSESl1pcGyABQsnnIfWOFt6JNj5gCog2U6MLZ//IGYD+nA8nI+mTShREReaA==
|
|
||||||
|
|
||||||
sprintf-js@~1.0.2:
|
sprintf-js@~1.0.2:
|
||||||
version "1.0.3"
|
version "1.0.3"
|
||||||
resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c"
|
resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c"
|
||||||
@ -4766,15 +4664,6 @@ string-width@^3.0.0:
|
|||||||
is-fullwidth-code-point "^2.0.0"
|
is-fullwidth-code-point "^2.0.0"
|
||||||
strip-ansi "^5.1.0"
|
strip-ansi "^5.1.0"
|
||||||
|
|
||||||
string-width@^4.2.0:
|
|
||||||
version "4.2.3"
|
|
||||||
resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010"
|
|
||||||
integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==
|
|
||||||
dependencies:
|
|
||||||
emoji-regex "^8.0.0"
|
|
||||||
is-fullwidth-code-point "^3.0.0"
|
|
||||||
strip-ansi "^6.0.1"
|
|
||||||
|
|
||||||
string.prototype.trim@^1.2.9:
|
string.prototype.trim@^1.2.9:
|
||||||
version "1.2.9"
|
version "1.2.9"
|
||||||
resolved "https://registry.yarnpkg.com/string.prototype.trim/-/string.prototype.trim-1.2.9.tgz#b6fa326d72d2c78b6df02f7759c73f8f6274faa4"
|
resolved "https://registry.yarnpkg.com/string.prototype.trim/-/string.prototype.trim-1.2.9.tgz#b6fa326d72d2c78b6df02f7759c73f8f6274faa4"
|
||||||
|
Loading…
Reference in New Issue
Block a user