import { presaleABI as e, presaleContractInfoByChain as t } from "../../constants/presale.constants.mjs";
import { ethers as n } from "ethers";
//#region libs/shared/common/src/data-structures/presale/PresaleContractWrapper.ts
var r = class {
	contract;
	eventsFrom;
	constructor(r, i) {
		let { address: a, eventsFrom: o } = t[i];
		this.contract = new n.Contract(a, e, r), this.eventsFrom = o;
	}
	deposit(e, t, n) {
		return this.contract.deposit(e.erc20TokenAddress, t, n);
	}
	withdraw(e, t) {
		return this.contract.withdraw(e, t);
	}
	moveToNextStage(e) {
		return this.contract.moveToNextStage(e || {});
	}
	async estimateMoveToNextStageGas() {
		return this.contract.moveToNextStage.estimateGas();
	}
	async getTotalDeposit() {
		return await this.contract.totalDeposit();
	}
	async getDeposits(e, t) {
		return await this.contract.deposits(e, t.erc20TokenAddress);
	}
	async getTotalHINK(e) {
		return await this.contract.totalHINK(e);
	}
	async getCurrentPresaleStageIndex() {
		let e = await this.contract.currentPresaleStageIndex();
		return Number(e);
	}
	async getCurrentMaxDepositAmount() {
		return await this.contract.currentMaxDepositAmount();
	}
	async currentPresaleStage() {
		let [e, t] = await this.contract.currentPresaleStage(), [n, r] = [e, t].map(BigInt);
		return {
			amountToRaise: n,
			priceMultiplier: r
		};
	}
	async calculateHINK(e) {
		return await this.contract.calculateHINK(e);
	}
	async queryDeposits() {
		return this.contract.queryFilter(this.contract.filters.Deposit(), this.eventsFrom);
	}
	onEvent(e, t) {
		this.contract.on(e, t);
	}
};
//#endregion
export { r as PresaleContractWrapper };
