//#region libs/shared/common/src/data-structures/event-service/solana/AbstractSolanaEventService.ts
var e = class {
	solanaBlockchainEventEmitter;
	eventName;
	constructor(e, t) {
		this.solanaBlockchainEventEmitter = e, this.eventName = t, e.addEventProcessorFunction(this.processEventsPage.bind(this));
	}
	get latestBlockNumber() {
		return this.solanaBlockchainEventEmitter.latestBlockNumber;
	}
	get isReady() {
		return this.solanaBlockchainEventEmitter.isReady;
	}
	get chainId() {
		return this.solanaBlockchainEventEmitter.chainId;
	}
	intervalClear() {
		this.solanaBlockchainEventEmitter.intervalClear();
	}
	async processEventsPage(e) {
		let t = [], n = /* @__PURE__ */ new Set();
		e.forEach(({ eventName: e, transactionHash: t }) => {
			e === "BlockedUtxosCreated" && n.add(t);
		});
		let r = e.filter((e) => e.eventName === this.eventName).map(async (e) => {
			try {
				let t = await this.mapEvent(e), r = n.has(e.transactionHash);
				return await this.acceptEvent(t, e.blockNumber, e.transactionHash, r) ? t : null;
			} catch {
				return null;
			}
		}), i = (await Promise.all(r)).filter((e) => e !== null);
		t.push(...i);
		let a = t.length;
		return await this.afterEventsAccepted(a), t.length;
	}
};
//#endregion
export { e as AbstractSolanaEventService };
