const e=require(`../../../constants/save-depths.cjs`),t=require(`./AbstractSolanaEventService.cjs`);var n=class extends t.AbstractSolanaEventService{savedLatestSlot=0;constructor(e,t){super(e,t)}async init(){await this.loadSnapshot()}async retrieveEventsFromLatestBlock(){await this.solanaBlockchainEventEmitter.retrieveEvents(this.latestBlockNumber)}async loadSnapshot(){let e=await this.fetchSnapshot(),t=this.deserializeSnapshot(e);this.populateSnapshot(t),this.solanaBlockchainEventEmitter.syncFromAtMost(t.latestBlockNumber),this.savedLatestSlot=t.latestBlockNumber}saveSnapshot(){return this.savedLatestSlot=this.latestBlockNumber,this.persistSnapshot(this.serializeSnapshot({latestBlockNumber:this.latestBlockNumber,payload:this.getSnapshotPayload()}))}async afterEventsAccepted(t){(t>0||this.savedLatestSlot+e.saveDepths[this.chainId]<this.latestBlockNumber)&&await this.saveSnapshot()}};exports.AbstractSolanaSnapshotService=n;