"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.sendEvmNFT = exports.sendEVM = void 0;
const expect_1 = __importDefault(require("expect"));
const speculos_1 = require("../speculos");
const DeviceLabels_1 = require("../enum/DeviceLabels");
const Device_1 = require("../enum/Device");
async function sendEVM(tx) {
    const events = await (0, speculos_1.pressUntilTextFound)(DeviceLabels_1.DeviceLabels.ACCEPT);
    const isAmountCorrect = (0, speculos_1.containsSubstringInEvent)(tx.amount, events);
    (0, expect_1.default)(isAmountCorrect).toBeTruthy();
    if (tx.accountToCredit.ensName && process.env.SPECULOS_DEVICE !== Device_1.Device.LNS) {
        const isENSNameCorrect = (0, speculos_1.containsSubstringInEvent)(tx.accountToCredit.ensName, events);
        (0, expect_1.default)(isENSNameCorrect).toBeTruthy();
    }
    else {
        const isAddressCorrect = (0, speculos_1.containsSubstringInEvent)(tx.accountToCredit.address, events);
        (0, expect_1.default)(isAddressCorrect).toBeTruthy();
    }
    await (0, speculos_1.pressBoth)();
}
exports.sendEVM = sendEVM;
async function sendEvmNFT(tx) {
    await (0, speculos_1.waitFor)(DeviceLabels_1.DeviceLabels.REVIEW_TRANSACTION);
    const events = await (0, speculos_1.pressUntilTextFound)(DeviceLabels_1.DeviceLabels.ACCEPT);
    const isAddressCorrect = (0, speculos_1.containsSubstringInEvent)(tx.accountToCredit.address, events);
    (0, expect_1.default)(isAddressCorrect).toBeTruthy();
    await (0, speculos_1.pressBoth)();
}
exports.sendEvmNFT = sendEvmNFT;
//# sourceMappingURL=evm.js.map