Compare commits
1 Commits
a32659b8e4
...
72c6b92b07
| Author | SHA1 | Date | |
|---|---|---|---|
| 72c6b92b07 |
1
dist/events/base.d.ts
vendored
1
dist/events/base.d.ts
vendored
@ -112,7 +112,6 @@ export declare class BaseMultiTornadoService extends BaseEventsService<MultiDepo
|
|||||||
constructor(serviceConstructor: BaseMultiTornadoServiceConstructor);
|
constructor(serviceConstructor: BaseMultiTornadoServiceConstructor);
|
||||||
getInstanceName(): string;
|
getInstanceName(): string;
|
||||||
getTovarishType(): string;
|
getTovarishType(): string;
|
||||||
updateEventProgress({ percentage, type, fromBlock, toBlock, count }: Parameters<BatchEventOnProgress>[0]): void;
|
|
||||||
formatEvents(events: EventLog[]): Promise<(MultiDepositsEvents | MultiWithdrawalsEvents)[]>;
|
formatEvents(events: EventLog[]): Promise<(MultiDepositsEvents | MultiWithdrawalsEvents)[]>;
|
||||||
validateEvents<S>({ events, newEvents, }: BaseEvents<MultiDepositsEvents | MultiWithdrawalsEvents> & {
|
validateEvents<S>({ events, newEvents, }: BaseEvents<MultiDepositsEvents | MultiWithdrawalsEvents> & {
|
||||||
newEvents: (MultiDepositsEvents | MultiWithdrawalsEvents)[];
|
newEvents: (MultiDepositsEvents | MultiWithdrawalsEvents)[];
|
||||||
|
|||||||
62
dist/index.js
vendored
62
dist/index.js
vendored
@ -1702,6 +1702,61 @@ const withdrawalsEventsSchema = {
|
|||||||
additionalProperties: false
|
additionalProperties: false
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
const tornadoEventsSchema = {
|
||||||
|
type: "array",
|
||||||
|
items: {
|
||||||
|
anyOf: [
|
||||||
|
// depositsEvents
|
||||||
|
{
|
||||||
|
type: "object",
|
||||||
|
properties: {
|
||||||
|
...baseEventsSchemaProperty,
|
||||||
|
event: { type: "string" },
|
||||||
|
instanceAddress: { type: "string" },
|
||||||
|
commitment: bytes32SchemaType,
|
||||||
|
leafIndex: { type: "number" },
|
||||||
|
timestamp: { type: "number" },
|
||||||
|
from: addressSchemaType
|
||||||
|
},
|
||||||
|
required: [
|
||||||
|
...baseEventsSchemaRequired,
|
||||||
|
"event",
|
||||||
|
"instanceAddress",
|
||||||
|
"commitment",
|
||||||
|
"leafIndex",
|
||||||
|
"timestamp",
|
||||||
|
"from"
|
||||||
|
],
|
||||||
|
additionalProperties: false
|
||||||
|
},
|
||||||
|
// withdrawalEvents
|
||||||
|
{
|
||||||
|
type: "object",
|
||||||
|
properties: {
|
||||||
|
...baseEventsSchemaProperty,
|
||||||
|
event: { type: "string" },
|
||||||
|
instanceAddress: { type: "string" },
|
||||||
|
nullifierHash: bytes32SchemaType,
|
||||||
|
to: addressSchemaType,
|
||||||
|
relayerAddress: addressSchemaType,
|
||||||
|
fee: bnSchemaType,
|
||||||
|
timestamp: { type: "number" }
|
||||||
|
},
|
||||||
|
required: [
|
||||||
|
...baseEventsSchemaRequired,
|
||||||
|
"event",
|
||||||
|
"instanceAddress",
|
||||||
|
"nullifierHash",
|
||||||
|
"to",
|
||||||
|
"relayerAddress",
|
||||||
|
"fee",
|
||||||
|
"timestamp"
|
||||||
|
],
|
||||||
|
additionalProperties: false
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
};
|
||||||
const echoEventsSchema = {
|
const echoEventsSchema = {
|
||||||
type: "array",
|
type: "array",
|
||||||
items: {
|
items: {
|
||||||
@ -1728,6 +1783,9 @@ const encryptedNotesSchema = {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
function getEventsSchemaValidator(type) {
|
function getEventsSchemaValidator(type) {
|
||||||
|
if (type === "tornado") {
|
||||||
|
return ajv.compile(tornadoEventsSchema);
|
||||||
|
}
|
||||||
if (type === "deposit") {
|
if (type === "deposit") {
|
||||||
return ajv.compile(depositsEventsSchema);
|
return ajv.compile(depositsEventsSchema);
|
||||||
}
|
}
|
||||||
@ -2424,9 +2482,6 @@ class BaseMultiTornadoService extends BaseEventsService {
|
|||||||
getTovarishType() {
|
getTovarishType() {
|
||||||
return "tornado";
|
return "tornado";
|
||||||
}
|
}
|
||||||
updateEventProgress({ percentage, type, fromBlock, toBlock, count }) {
|
|
||||||
console.log({ percentage, type, fromBlock, toBlock, count });
|
|
||||||
}
|
|
||||||
async formatEvents(events) {
|
async formatEvents(events) {
|
||||||
const txs = await this.batchTransactionService.getBatchTransactions([
|
const txs = await this.batchTransactionService.getBatchTransactions([
|
||||||
...new Set(
|
...new Set(
|
||||||
@ -10719,6 +10774,7 @@ exports.substring = substring;
|
|||||||
exports.toContentHash = toContentHash;
|
exports.toContentHash = toContentHash;
|
||||||
exports.toFixedHex = toFixedHex;
|
exports.toFixedHex = toFixedHex;
|
||||||
exports.toFixedLength = toFixedLength;
|
exports.toFixedLength = toFixedLength;
|
||||||
|
exports.tornadoEventsSchema = tornadoEventsSchema;
|
||||||
exports.unpackEncryptedMessage = unpackEncryptedMessage;
|
exports.unpackEncryptedMessage = unpackEncryptedMessage;
|
||||||
exports.unzipAsync = unzipAsync;
|
exports.unzipAsync = unzipAsync;
|
||||||
exports.validateUrl = validateUrl;
|
exports.validateUrl = validateUrl;
|
||||||
|
|||||||
63
dist/index.mjs
vendored
63
dist/index.mjs
vendored
@ -1680,6 +1680,61 @@ const withdrawalsEventsSchema = {
|
|||||||
additionalProperties: false
|
additionalProperties: false
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
const tornadoEventsSchema = {
|
||||||
|
type: "array",
|
||||||
|
items: {
|
||||||
|
anyOf: [
|
||||||
|
// depositsEvents
|
||||||
|
{
|
||||||
|
type: "object",
|
||||||
|
properties: {
|
||||||
|
...baseEventsSchemaProperty,
|
||||||
|
event: { type: "string" },
|
||||||
|
instanceAddress: { type: "string" },
|
||||||
|
commitment: bytes32SchemaType,
|
||||||
|
leafIndex: { type: "number" },
|
||||||
|
timestamp: { type: "number" },
|
||||||
|
from: addressSchemaType
|
||||||
|
},
|
||||||
|
required: [
|
||||||
|
...baseEventsSchemaRequired,
|
||||||
|
"event",
|
||||||
|
"instanceAddress",
|
||||||
|
"commitment",
|
||||||
|
"leafIndex",
|
||||||
|
"timestamp",
|
||||||
|
"from"
|
||||||
|
],
|
||||||
|
additionalProperties: false
|
||||||
|
},
|
||||||
|
// withdrawalEvents
|
||||||
|
{
|
||||||
|
type: "object",
|
||||||
|
properties: {
|
||||||
|
...baseEventsSchemaProperty,
|
||||||
|
event: { type: "string" },
|
||||||
|
instanceAddress: { type: "string" },
|
||||||
|
nullifierHash: bytes32SchemaType,
|
||||||
|
to: addressSchemaType,
|
||||||
|
relayerAddress: addressSchemaType,
|
||||||
|
fee: bnSchemaType,
|
||||||
|
timestamp: { type: "number" }
|
||||||
|
},
|
||||||
|
required: [
|
||||||
|
...baseEventsSchemaRequired,
|
||||||
|
"event",
|
||||||
|
"instanceAddress",
|
||||||
|
"nullifierHash",
|
||||||
|
"to",
|
||||||
|
"relayerAddress",
|
||||||
|
"fee",
|
||||||
|
"timestamp"
|
||||||
|
],
|
||||||
|
additionalProperties: false
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
};
|
||||||
const echoEventsSchema = {
|
const echoEventsSchema = {
|
||||||
type: "array",
|
type: "array",
|
||||||
items: {
|
items: {
|
||||||
@ -1706,6 +1761,9 @@ const encryptedNotesSchema = {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
function getEventsSchemaValidator(type) {
|
function getEventsSchemaValidator(type) {
|
||||||
|
if (type === "tornado") {
|
||||||
|
return ajv.compile(tornadoEventsSchema);
|
||||||
|
}
|
||||||
if (type === "deposit") {
|
if (type === "deposit") {
|
||||||
return ajv.compile(depositsEventsSchema);
|
return ajv.compile(depositsEventsSchema);
|
||||||
}
|
}
|
||||||
@ -2402,9 +2460,6 @@ class BaseMultiTornadoService extends BaseEventsService {
|
|||||||
getTovarishType() {
|
getTovarishType() {
|
||||||
return "tornado";
|
return "tornado";
|
||||||
}
|
}
|
||||||
updateEventProgress({ percentage, type, fromBlock, toBlock, count }) {
|
|
||||||
console.log({ percentage, type, fromBlock, toBlock, count });
|
|
||||||
}
|
|
||||||
async formatEvents(events) {
|
async formatEvents(events) {
|
||||||
const txs = await this.batchTransactionService.getBatchTransactions([
|
const txs = await this.batchTransactionService.getBatchTransactions([
|
||||||
...new Set(
|
...new Set(
|
||||||
@ -10549,4 +10604,4 @@ async function calculateSnarkProof(input, circuit, provingKey) {
|
|||||||
return { proof, args };
|
return { proof, args };
|
||||||
}
|
}
|
||||||
|
|
||||||
export { BaseEchoService, BaseEncryptedNotesService, BaseEventsService, BaseGovernanceService, BaseMultiTornadoService, BaseRegistryService, BaseRevenueService, BaseTornadoService, BatchBlockService, BatchEventsService, BatchTransactionService, DBEchoService, DBEncryptedNotesService, DBGovernanceService, DBRegistryService, DBRevenueService, DBTornadoService, Deposit, ENSNameWrapper__factory, ENSRegistry__factory, ENSResolver__factory, ENSUtils, ENS__factory, ERC20__factory, EnsContracts, INDEX_DB_ERROR, IndexedDB, Invoice, MAX_FEE, MAX_TOVARISH_EVENTS, MIN_FEE, MIN_STAKE_BALANCE, MerkleTreeService, Mimc, Multicall__factory, NetId, NoteAccount, OffchainOracle__factory, OvmGasPriceOracle__factory, Pedersen, RelayerClient, ReverseRecords__factory, TokenPriceOracle, TornadoBrowserProvider, TornadoFeeOracle, TornadoRpcSigner, TornadoVoidSigner, TornadoWallet, TovarishClient, addNetwork, addressSchemaType, ajv, base64ToBytes, bigIntReplacer, bnSchemaType, bnToBytes, buffPedersenHash, bufferToBytes, bytes32BNSchemaType, bytes32SchemaType, bytesToBN, bytesToBase64, bytesToHex, calculateScore, calculateSnarkProof, chunk, concatBytes, convertETHToTokenAmount, createDeposit, crypto, customConfig, defaultConfig, defaultUserAgent, deployHasher, depositsEventsSchema, digest, downloadZip, echoEventsSchema, enabledChains, encodedLabelToLabelhash, encryptedNotesSchema, index as factories, fetchData, fetchGetUrlFunc, fetchIp, fromContentHash, gasZipID, gasZipInbounds, gasZipInput, gasZipMinMax, getActiveTokenInstances, getActiveTokens, getConfig, getEventsSchemaValidator, getHttpAgent, getIndexedDB, getInstanceByAddress, getMultiInstances, getNetworkConfig, getPermit2CommitmentsSignature, getPermit2Signature, getPermitCommitmentsSignature, getPermitSignature, getProvider, getProviderWithNetId, getRelayerEnsSubdomains, getStatusSchema, getSubInfo, getSupportedInstances, getTokenBalances, getTovarishNetworks, getWeightRandom, governanceEventsSchema, hasherBytecode, hexToBytes, initGroth16, isHex, isNode, jobRequestSchema, jobsSchema, labelhash, leBuff2Int, leInt2Buff, loadDBEvents, loadRemoteEvents, makeLabelNodeAndParent, mimc, multiQueryFilter, multicall, numberFormatter, packEncryptedMessage, parseInvoice, parseNote, pedersen, permit2Address, pickWeightedRandomRelayer, populateTransaction, proofSchemaType, proposalState, rBigInt, rHex, relayerRegistryEventsSchema, saveDBEvents, sleep, stakeBurnedEventsSchema, substring, toContentHash, toFixedHex, toFixedLength, unpackEncryptedMessage, unzipAsync, validateUrl, withdrawalsEventsSchema, zipAsync };
|
export { BaseEchoService, BaseEncryptedNotesService, BaseEventsService, BaseGovernanceService, BaseMultiTornadoService, BaseRegistryService, BaseRevenueService, BaseTornadoService, BatchBlockService, BatchEventsService, BatchTransactionService, DBEchoService, DBEncryptedNotesService, DBGovernanceService, DBRegistryService, DBRevenueService, DBTornadoService, Deposit, ENSNameWrapper__factory, ENSRegistry__factory, ENSResolver__factory, ENSUtils, ENS__factory, ERC20__factory, EnsContracts, INDEX_DB_ERROR, IndexedDB, Invoice, MAX_FEE, MAX_TOVARISH_EVENTS, MIN_FEE, MIN_STAKE_BALANCE, MerkleTreeService, Mimc, Multicall__factory, NetId, NoteAccount, OffchainOracle__factory, OvmGasPriceOracle__factory, Pedersen, RelayerClient, ReverseRecords__factory, TokenPriceOracle, TornadoBrowserProvider, TornadoFeeOracle, TornadoRpcSigner, TornadoVoidSigner, TornadoWallet, TovarishClient, addNetwork, addressSchemaType, ajv, base64ToBytes, bigIntReplacer, bnSchemaType, bnToBytes, buffPedersenHash, bufferToBytes, bytes32BNSchemaType, bytes32SchemaType, bytesToBN, bytesToBase64, bytesToHex, calculateScore, calculateSnarkProof, chunk, concatBytes, convertETHToTokenAmount, createDeposit, crypto, customConfig, defaultConfig, defaultUserAgent, deployHasher, depositsEventsSchema, digest, downloadZip, echoEventsSchema, enabledChains, encodedLabelToLabelhash, encryptedNotesSchema, index as factories, fetchData, fetchGetUrlFunc, fetchIp, fromContentHash, gasZipID, gasZipInbounds, gasZipInput, gasZipMinMax, getActiveTokenInstances, getActiveTokens, getConfig, getEventsSchemaValidator, getHttpAgent, getIndexedDB, getInstanceByAddress, getMultiInstances, getNetworkConfig, getPermit2CommitmentsSignature, getPermit2Signature, getPermitCommitmentsSignature, getPermitSignature, getProvider, getProviderWithNetId, getRelayerEnsSubdomains, getStatusSchema, getSubInfo, getSupportedInstances, getTokenBalances, getTovarishNetworks, getWeightRandom, governanceEventsSchema, hasherBytecode, hexToBytes, initGroth16, isHex, isNode, jobRequestSchema, jobsSchema, labelhash, leBuff2Int, leInt2Buff, loadDBEvents, loadRemoteEvents, makeLabelNodeAndParent, mimc, multiQueryFilter, multicall, numberFormatter, packEncryptedMessage, parseInvoice, parseNote, pedersen, permit2Address, pickWeightedRandomRelayer, populateTransaction, proofSchemaType, proposalState, rBigInt, rHex, relayerRegistryEventsSchema, saveDBEvents, sleep, stakeBurnedEventsSchema, substring, toContentHash, toFixedHex, toFixedLength, tornadoEventsSchema, unpackEncryptedMessage, unzipAsync, validateUrl, withdrawalsEventsSchema, zipAsync };
|
||||||
|
|||||||
86
dist/schemas/events.d.ts
vendored
86
dist/schemas/events.d.ts
vendored
@ -352,6 +352,92 @@ export declare const withdrawalsEventsSchema: {
|
|||||||
readonly additionalProperties: false;
|
readonly additionalProperties: false;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
export declare const tornadoEventsSchema: {
|
||||||
|
readonly type: "array";
|
||||||
|
readonly items: {
|
||||||
|
readonly anyOf: readonly [{
|
||||||
|
readonly type: "object";
|
||||||
|
readonly properties: {
|
||||||
|
readonly event: {
|
||||||
|
readonly type: "string";
|
||||||
|
};
|
||||||
|
readonly instanceAddress: {
|
||||||
|
readonly type: "string";
|
||||||
|
};
|
||||||
|
readonly commitment: {
|
||||||
|
readonly type: "string";
|
||||||
|
readonly pattern: "^0x[a-fA-F0-9]{64}$";
|
||||||
|
};
|
||||||
|
readonly leafIndex: {
|
||||||
|
readonly type: "number";
|
||||||
|
};
|
||||||
|
readonly timestamp: {
|
||||||
|
readonly type: "number";
|
||||||
|
};
|
||||||
|
readonly from: {
|
||||||
|
readonly type: "string";
|
||||||
|
readonly pattern: "^0x[a-fA-F0-9]{40}$";
|
||||||
|
readonly isAddress: true;
|
||||||
|
};
|
||||||
|
readonly blockNumber: {
|
||||||
|
readonly type: "number";
|
||||||
|
};
|
||||||
|
readonly logIndex: {
|
||||||
|
readonly type: "number";
|
||||||
|
};
|
||||||
|
readonly transactionHash: {
|
||||||
|
readonly type: "string";
|
||||||
|
readonly pattern: "^0x[a-fA-F0-9]{64}$";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
readonly required: readonly [...string[], "event", "instanceAddress", "commitment", "leafIndex", "timestamp", "from"];
|
||||||
|
readonly additionalProperties: false;
|
||||||
|
}, {
|
||||||
|
readonly type: "object";
|
||||||
|
readonly properties: {
|
||||||
|
readonly event: {
|
||||||
|
readonly type: "string";
|
||||||
|
};
|
||||||
|
readonly instanceAddress: {
|
||||||
|
readonly type: "string";
|
||||||
|
};
|
||||||
|
readonly nullifierHash: {
|
||||||
|
readonly type: "string";
|
||||||
|
readonly pattern: "^0x[a-fA-F0-9]{64}$";
|
||||||
|
};
|
||||||
|
readonly to: {
|
||||||
|
readonly type: "string";
|
||||||
|
readonly pattern: "^0x[a-fA-F0-9]{40}$";
|
||||||
|
readonly isAddress: true;
|
||||||
|
};
|
||||||
|
readonly relayerAddress: {
|
||||||
|
readonly type: "string";
|
||||||
|
readonly pattern: "^0x[a-fA-F0-9]{40}$";
|
||||||
|
readonly isAddress: true;
|
||||||
|
};
|
||||||
|
readonly fee: {
|
||||||
|
readonly type: "string";
|
||||||
|
readonly BN: true;
|
||||||
|
};
|
||||||
|
readonly timestamp: {
|
||||||
|
readonly type: "number";
|
||||||
|
};
|
||||||
|
readonly blockNumber: {
|
||||||
|
readonly type: "number";
|
||||||
|
};
|
||||||
|
readonly logIndex: {
|
||||||
|
readonly type: "number";
|
||||||
|
};
|
||||||
|
readonly transactionHash: {
|
||||||
|
readonly type: "string";
|
||||||
|
readonly pattern: "^0x[a-fA-F0-9]{64}$";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
readonly required: readonly [...string[], "event", "instanceAddress", "nullifierHash", "to", "relayerAddress", "fee", "timestamp"];
|
||||||
|
readonly additionalProperties: false;
|
||||||
|
}];
|
||||||
|
};
|
||||||
|
};
|
||||||
export declare const echoEventsSchema: {
|
export declare const echoEventsSchema: {
|
||||||
readonly type: "array";
|
readonly type: "array";
|
||||||
readonly items: {
|
readonly items: {
|
||||||
|
|||||||
63
dist/tornado.umd.js
vendored
63
dist/tornado.umd.js
vendored
@ -90694,9 +90694,6 @@ class BaseMultiTornadoService extends BaseEventsService {
|
|||||||
getTovarishType() {
|
getTovarishType() {
|
||||||
return "tornado";
|
return "tornado";
|
||||||
}
|
}
|
||||||
updateEventProgress({ percentage, type, fromBlock, toBlock, count }) {
|
|
||||||
console.log({ percentage, type, fromBlock, toBlock, count });
|
|
||||||
}
|
|
||||||
async formatEvents(events) {
|
async formatEvents(events) {
|
||||||
const txs = await this.batchTransactionService.getBatchTransactions([
|
const txs = await this.batchTransactionService.getBatchTransactions([
|
||||||
...new Set(
|
...new Set(
|
||||||
@ -101660,6 +101657,7 @@ __webpack_require__.d(__webpack_exports__, {
|
|||||||
Y6: () => (/* reexport */ proofSchemaType),
|
Y6: () => (/* reexport */ proofSchemaType),
|
||||||
cl: () => (/* reexport */ relayerRegistryEventsSchema),
|
cl: () => (/* reexport */ relayerRegistryEventsSchema),
|
||||||
Fz: () => (/* reexport */ stakeBurnedEventsSchema),
|
Fz: () => (/* reexport */ stakeBurnedEventsSchema),
|
||||||
|
U7: () => (/* reexport */ tornadoEventsSchema),
|
||||||
$j: () => (/* reexport */ withdrawalsEventsSchema)
|
$j: () => (/* reexport */ withdrawalsEventsSchema)
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -101914,6 +101912,61 @@ const withdrawalsEventsSchema = {
|
|||||||
additionalProperties: false
|
additionalProperties: false
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
const tornadoEventsSchema = {
|
||||||
|
type: "array",
|
||||||
|
items: {
|
||||||
|
anyOf: [
|
||||||
|
// depositsEvents
|
||||||
|
{
|
||||||
|
type: "object",
|
||||||
|
properties: {
|
||||||
|
...baseEventsSchemaProperty,
|
||||||
|
event: { type: "string" },
|
||||||
|
instanceAddress: { type: "string" },
|
||||||
|
commitment: bytes32SchemaType,
|
||||||
|
leafIndex: { type: "number" },
|
||||||
|
timestamp: { type: "number" },
|
||||||
|
from: addressSchemaType
|
||||||
|
},
|
||||||
|
required: [
|
||||||
|
...baseEventsSchemaRequired,
|
||||||
|
"event",
|
||||||
|
"instanceAddress",
|
||||||
|
"commitment",
|
||||||
|
"leafIndex",
|
||||||
|
"timestamp",
|
||||||
|
"from"
|
||||||
|
],
|
||||||
|
additionalProperties: false
|
||||||
|
},
|
||||||
|
// withdrawalEvents
|
||||||
|
{
|
||||||
|
type: "object",
|
||||||
|
properties: {
|
||||||
|
...baseEventsSchemaProperty,
|
||||||
|
event: { type: "string" },
|
||||||
|
instanceAddress: { type: "string" },
|
||||||
|
nullifierHash: bytes32SchemaType,
|
||||||
|
to: addressSchemaType,
|
||||||
|
relayerAddress: addressSchemaType,
|
||||||
|
fee: bnSchemaType,
|
||||||
|
timestamp: { type: "number" }
|
||||||
|
},
|
||||||
|
required: [
|
||||||
|
...baseEventsSchemaRequired,
|
||||||
|
"event",
|
||||||
|
"instanceAddress",
|
||||||
|
"nullifierHash",
|
||||||
|
"to",
|
||||||
|
"relayerAddress",
|
||||||
|
"fee",
|
||||||
|
"timestamp"
|
||||||
|
],
|
||||||
|
additionalProperties: false
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
};
|
||||||
const echoEventsSchema = {
|
const echoEventsSchema = {
|
||||||
type: "array",
|
type: "array",
|
||||||
items: {
|
items: {
|
||||||
@ -101940,6 +101993,9 @@ const encryptedNotesSchema = {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
function getEventsSchemaValidator(type) {
|
function getEventsSchemaValidator(type) {
|
||||||
|
if (type === "tornado") {
|
||||||
|
return ajv_ajv.compile(tornadoEventsSchema);
|
||||||
|
}
|
||||||
if (type === "deposit") {
|
if (type === "deposit") {
|
||||||
return ajv_ajv.compile(depositsEventsSchema);
|
return ajv_ajv.compile(depositsEventsSchema);
|
||||||
}
|
}
|
||||||
@ -217785,6 +217841,7 @@ __webpack_require__.r(__webpack_exports__);
|
|||||||
/* harmony export */ toContentHash: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_23__.vd),
|
/* harmony export */ toContentHash: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_23__.vd),
|
||||||
/* harmony export */ toFixedHex: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_23__.$W),
|
/* harmony export */ toFixedHex: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_23__.$W),
|
||||||
/* harmony export */ toFixedLength: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_23__.sY),
|
/* harmony export */ toFixedLength: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_23__.sY),
|
||||||
|
/* harmony export */ tornadoEventsSchema: () => (/* reexport safe */ _schemas__WEBPACK_IMPORTED_MODULE_1__.U7),
|
||||||
/* harmony export */ unpackEncryptedMessage: () => (/* reexport safe */ _encryptedNotes__WEBPACK_IMPORTED_MODULE_5__.ol),
|
/* harmony export */ unpackEncryptedMessage: () => (/* reexport safe */ _encryptedNotes__WEBPACK_IMPORTED_MODULE_5__.ol),
|
||||||
/* harmony export */ unzipAsync: () => (/* reexport safe */ _zip__WEBPACK_IMPORTED_MODULE_25__.fY),
|
/* harmony export */ unzipAsync: () => (/* reexport safe */ _zip__WEBPACK_IMPORTED_MODULE_25__.fY),
|
||||||
/* harmony export */ validateUrl: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_23__.wv),
|
/* harmony export */ validateUrl: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_23__.wv),
|
||||||
|
|||||||
2
dist/tornado.umd.min.js
vendored
2
dist/tornado.umd.min.js
vendored
File diff suppressed because one or more lines are too long
16
dist/tovarishClient.d.ts
vendored
16
dist/tovarishClient.d.ts
vendored
@ -5,27 +5,13 @@ export interface EventsStatus {
|
|||||||
events: number;
|
events: number;
|
||||||
lastBlock: number;
|
lastBlock: number;
|
||||||
}
|
}
|
||||||
export interface InstanceEventsStatus {
|
|
||||||
[index: string]: {
|
|
||||||
deposits: EventsStatus;
|
|
||||||
withdrawals: EventsStatus;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
export interface CurrencyEventsStatus {
|
|
||||||
[index: string]: InstanceEventsStatus;
|
|
||||||
}
|
|
||||||
export interface TovarishEventsStatus {
|
export interface TovarishEventsStatus {
|
||||||
governance?: EventsStatus;
|
governance?: EventsStatus;
|
||||||
registered?: {
|
|
||||||
lastBlock: number;
|
|
||||||
timestamp: number;
|
|
||||||
relayers: number;
|
|
||||||
};
|
|
||||||
registry?: EventsStatus;
|
registry?: EventsStatus;
|
||||||
revenue?: EventsStatus;
|
revenue?: EventsStatus;
|
||||||
echo: EventsStatus;
|
echo: EventsStatus;
|
||||||
encrypted_notes: EventsStatus;
|
encrypted_notes: EventsStatus;
|
||||||
instances: CurrencyEventsStatus;
|
tornado: EventsStatus;
|
||||||
}
|
}
|
||||||
export interface TovarishSyncStatus {
|
export interface TovarishSyncStatus {
|
||||||
events: boolean;
|
events: boolean;
|
||||||
|
|||||||
@ -494,10 +494,6 @@ export class BaseMultiTornadoService extends BaseEventsService<MultiDepositsEven
|
|||||||
return 'tornado';
|
return 'tornado';
|
||||||
}
|
}
|
||||||
|
|
||||||
updateEventProgress({ percentage, type, fromBlock, toBlock, count }: Parameters<BatchEventOnProgress>[0]) {
|
|
||||||
console.log({ percentage, type, fromBlock, toBlock, count });
|
|
||||||
}
|
|
||||||
|
|
||||||
async formatEvents(events: EventLog[]): Promise<(MultiDepositsEvents | MultiWithdrawalsEvents)[]> {
|
async formatEvents(events: EventLog[]): Promise<(MultiDepositsEvents | MultiWithdrawalsEvents)[]> {
|
||||||
const txs = await this.batchTransactionService.getBatchTransactions([
|
const txs = await this.batchTransactionService.getBatchTransactions([
|
||||||
...new Set(
|
...new Set(
|
||||||
|
|||||||
@ -201,6 +201,62 @@ export const withdrawalsEventsSchema = {
|
|||||||
},
|
},
|
||||||
} as const;
|
} as const;
|
||||||
|
|
||||||
|
export const tornadoEventsSchema = {
|
||||||
|
type: 'array',
|
||||||
|
items: {
|
||||||
|
anyOf: [
|
||||||
|
// depositsEvents
|
||||||
|
{
|
||||||
|
type: 'object',
|
||||||
|
properties: {
|
||||||
|
...baseEventsSchemaProperty,
|
||||||
|
event: { type: 'string' },
|
||||||
|
instanceAddress: { type: 'string' },
|
||||||
|
commitment: bytes32SchemaType,
|
||||||
|
leafIndex: { type: 'number' },
|
||||||
|
timestamp: { type: 'number' },
|
||||||
|
from: addressSchemaType,
|
||||||
|
},
|
||||||
|
required: [
|
||||||
|
...baseEventsSchemaRequired,
|
||||||
|
'event',
|
||||||
|
'instanceAddress',
|
||||||
|
'commitment',
|
||||||
|
'leafIndex',
|
||||||
|
'timestamp',
|
||||||
|
'from',
|
||||||
|
],
|
||||||
|
additionalProperties: false,
|
||||||
|
},
|
||||||
|
// withdrawalEvents
|
||||||
|
{
|
||||||
|
type: 'object',
|
||||||
|
properties: {
|
||||||
|
...baseEventsSchemaProperty,
|
||||||
|
event: { type: 'string' },
|
||||||
|
instanceAddress: { type: 'string' },
|
||||||
|
nullifierHash: bytes32SchemaType,
|
||||||
|
to: addressSchemaType,
|
||||||
|
relayerAddress: addressSchemaType,
|
||||||
|
fee: bnSchemaType,
|
||||||
|
timestamp: { type: 'number' },
|
||||||
|
},
|
||||||
|
required: [
|
||||||
|
...baseEventsSchemaRequired,
|
||||||
|
'event',
|
||||||
|
'instanceAddress',
|
||||||
|
'nullifierHash',
|
||||||
|
'to',
|
||||||
|
'relayerAddress',
|
||||||
|
'fee',
|
||||||
|
'timestamp',
|
||||||
|
],
|
||||||
|
additionalProperties: false,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
} as const;
|
||||||
|
|
||||||
export const echoEventsSchema = {
|
export const echoEventsSchema = {
|
||||||
type: 'array',
|
type: 'array',
|
||||||
items: {
|
items: {
|
||||||
@ -229,6 +285,10 @@ export const encryptedNotesSchema = {
|
|||||||
} as const;
|
} as const;
|
||||||
|
|
||||||
export function getEventsSchemaValidator(type: string) {
|
export function getEventsSchemaValidator(type: string) {
|
||||||
|
if (type === 'tornado') {
|
||||||
|
return ajv.compile(tornadoEventsSchema);
|
||||||
|
}
|
||||||
|
|
||||||
if (type === 'deposit') {
|
if (type === 'deposit') {
|
||||||
return ajv.compile(depositsEventsSchema);
|
return ajv.compile(depositsEventsSchema);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -21,29 +21,13 @@ export interface EventsStatus {
|
|||||||
lastBlock: number;
|
lastBlock: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface InstanceEventsStatus {
|
|
||||||
[index: string]: {
|
|
||||||
deposits: EventsStatus;
|
|
||||||
withdrawals: EventsStatus;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface CurrencyEventsStatus {
|
|
||||||
[index: string]: InstanceEventsStatus;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface TovarishEventsStatus {
|
export interface TovarishEventsStatus {
|
||||||
governance?: EventsStatus;
|
governance?: EventsStatus;
|
||||||
registered?: {
|
|
||||||
lastBlock: number;
|
|
||||||
timestamp: number;
|
|
||||||
relayers: number;
|
|
||||||
};
|
|
||||||
registry?: EventsStatus;
|
registry?: EventsStatus;
|
||||||
revenue?: EventsStatus;
|
revenue?: EventsStatus;
|
||||||
echo: EventsStatus;
|
echo: EventsStatus;
|
||||||
encrypted_notes: EventsStatus;
|
encrypted_notes: EventsStatus;
|
||||||
instances: CurrencyEventsStatus;
|
tornado: EventsStatus;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface TovarishSyncStatus {
|
export interface TovarishSyncStatus {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user