const e=require(`../../../functions/utils/getContractAddress.cjs`),t=require(`../../../functions/utils/getSignerFromContract.cjs`),n=require(`../../event-service/evm/AbstractAccessTokenSnapshotService.cjs`);require(`../../event-service/index.cjs`);const r=require(`../SnapshotFetcherService.cjs`);var i=class extends n.AbstractAccessTokenSnapshotService{snapshotsService;constructor(e,t){super(e),this.snapshotsService=t}async fetchSnapshot(){let{contract:n}=this.blockchainEventEmitter,{chainId:i}=await t.getProviderFromContract(n).getNetwork(),a=Number(i);this.snapshotsService||=new r.SnapshotFetcherService(a,e.getContractAddress(n));let o=await this.snapshotsService.getAccessTokens();if(o.accessTokenContractAddress!==e.getContractAddress(n)||o.chainId!==a)throw Error(`Commitment Snapshot: incorrect contract or chain id`);return{latestBlockNumber:o.latestBlockNumber,merkleTree:o.merkleTree,senderAddresses:o.senderAddresses,senderAddressIndexMap:o.senderAddressIndexMap}}persistSnapshot(e){return Promise.resolve()}};exports.ClientAccessTokenSnapshotService=i;