"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const core_1 = require("@oclif/core");
const emulator_1 = require("../emulator/emulator");
class Emulate extends core_1.Command {
    async catch(error) {
        core_1.CliUx.ux.action.stop("error");
        this.error(error.message);
        this.exit(error.code);
    }
    async run() {
        const { flags } = await this.parse(Emulate);
        const emulator = new emulator_1.Emulator(flags.emulatorHost);
        this.log("Starting emulator...");
        await emulator.startEmulator();
    }
}
exports.default = Emulate;
Emulate.description = 'Emulate the TokenScript in a browser';
Emulate.flags = {
    emulatorHost: core_1.Flags.string({ char: "e", required: false, default: "" }),
};
Emulate.args = [];
