@hinkal/common 0.1.48 → 0.1.49
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("../../constants/chains.constants.cjs"),n=require("../../functions/web3/events/balanceChangedHandler.cjs");require("../../types/circom-data.types.cjs");const r=require("../../types/ethereum-network.types.cjs");require("../../types/transactions.types.cjs");require("../../types/curve.types.cjs");const o=require("../snapshot/ClientAccessTokenSnapshotService.cjs"),i=require("../snapshot/ClientCommitmentsSnapshotService.cjs"),a=require("../snapshot/ClientNullifierSnapshotService.cjs"),S=async e=>{const{maxPageSize:t}=c.networkRegistry[e.getCurrentChainId()],s=await e.getEthereumAddress();e.commitmentsSnapshotService?.intervalClear(),e.commitmentsSnapshotService=new i.ClientCommitmentsSnapshotService(e.getContractWithFetcher(r.ContractType.HinkalContract),t,s),e.nullifierSnapshotService?.intervalClear(),e.nullifierSnapshotService=new a.ClientNullifierSnapshotService(e.getContractWithFetcher(r.ContractType.HinkalContract),t),e.accessTokenSnapshotService?.intervalClear(),e.accessTokenSnapshotService=new o.ClientAccessTokenSnapshotService(e.getContractWithFetcher(r.ContractType.CrossChainAccessTokenContract),t),await Promise.all([e.commitmentsSnapshotService.init(),e.nullifierSnapshotService.init(),e.accessTokenSnapshotService.init()]),e.merkleTreeHinkal=e.commitmentsSnapshotService.merkleTree,e.merkleTreeAccessToken=e.accessTokenSnapshotService.merkleTree,e.nullifiers=e.nullifierSnapshotService.nullifiers,e.encryptedOutputs=e.commitmentsSnapshotService.encryptedOutputs,e.commitmentsSnapshotService.onNewEvent=n.balanceChangedHandler,e.nullifierSnapshotService.onNewEvent=n.balanceChangedHandler};exports.resetMerkleTrees=S;
|
|
@@ -5,14 +5,15 @@ import { ContractType as r } from "../../types/ethereum-network.types.mjs";
|
|
|
5
5
|
import "../../types/transactions.types.mjs";
|
|
6
6
|
import "../../types/curve.types.mjs";
|
|
7
7
|
import { ClientAccessTokenSnapshotService as n } from "../snapshot/ClientAccessTokenSnapshotService.mjs";
|
|
8
|
-
import { ClientCommitmentsSnapshotService as
|
|
9
|
-
import { ClientNullifierSnapshotService as
|
|
10
|
-
const
|
|
11
|
-
const { maxPageSize: t } = c[e.getCurrentChainId()];
|
|
12
|
-
|
|
8
|
+
import { ClientCommitmentsSnapshotService as i } from "../snapshot/ClientCommitmentsSnapshotService.mjs";
|
|
9
|
+
import { ClientNullifierSnapshotService as m } from "../snapshot/ClientNullifierSnapshotService.mjs";
|
|
10
|
+
const d = async (e) => {
|
|
11
|
+
const { maxPageSize: t } = c[e.getCurrentChainId()], s = await e.getEthereumAddress();
|
|
12
|
+
e.commitmentsSnapshotService?.intervalClear(), e.commitmentsSnapshotService = new i(
|
|
13
13
|
e.getContractWithFetcher(r.HinkalContract),
|
|
14
|
-
t
|
|
15
|
-
|
|
14
|
+
t,
|
|
15
|
+
s
|
|
16
|
+
), e.nullifierSnapshotService?.intervalClear(), e.nullifierSnapshotService = new m(
|
|
16
17
|
e.getContractWithFetcher(r.HinkalContract),
|
|
17
18
|
t
|
|
18
19
|
), e.accessTokenSnapshotService?.intervalClear(), e.accessTokenSnapshotService = new n(
|
|
@@ -25,5 +26,5 @@ const T = async (e) => {
|
|
|
25
26
|
]), e.merkleTreeHinkal = e.commitmentsSnapshotService.merkleTree, e.merkleTreeAccessToken = e.accessTokenSnapshotService.merkleTree, e.nullifiers = e.nullifierSnapshotService.nullifiers, e.encryptedOutputs = e.commitmentsSnapshotService.encryptedOutputs, e.commitmentsSnapshotService.onNewEvent = o, e.nullifierSnapshotService.onNewEvent = o;
|
|
26
27
|
};
|
|
27
28
|
export {
|
|
28
|
-
|
|
29
|
+
d as resetMerkleTrees
|
|
29
30
|
};
|