"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Impersonator = exports.setBalance = exports.mineBlock = exports.setMiningMode = void 0;
const setMiningMode = async (active, provider) => {
    await provider.send('evm_setAutomine', [active]);
};
exports.setMiningMode = setMiningMode;
const mineBlock = async (provider) => {
    await provider.send('evm_mine', []);
};
exports.mineBlock = mineBlock;
async function setBalance(address, amount, provider) {
    await provider.send('hardhat_setBalance', [address, amount]);
}
exports.setBalance = setBalance;
class Impersonator {
    constructor(address) {
        this.address = address;
    }
    async impersonate(provider) {
        await provider.send('hardhat_impersonateAccount', [this.address]);
        return provider.getSigner(this.address);
    }
    async stopImpersonate(provider) {
        await provider.send('hardhat_stopImpersonatingAccount', [this.address]);
    }
}
exports.Impersonator = Impersonator;
