import expect from "expect";
import { pressBoth, pressUntilTextFound, containsSubstringInEvent, waitFor } from "../speculos";
import { DeviceLabels } from "../enum/DeviceLabels";
import { Device } from "../enum/Device";
export async function sendEVM(tx) {
    const events = await pressUntilTextFound(DeviceLabels.ACCEPT);
    const isAmountCorrect = containsSubstringInEvent(tx.amount, events);
    expect(isAmountCorrect).toBeTruthy();
    if (tx.accountToCredit.ensName && process.env.SPECULOS_DEVICE !== Device.LNS) {
        const isENSNameCorrect = containsSubstringInEvent(tx.accountToCredit.ensName, events);
        expect(isENSNameCorrect).toBeTruthy();
    }
    else {
        const isAddressCorrect = containsSubstringInEvent(tx.accountToCredit.address, events);
        expect(isAddressCorrect).toBeTruthy();
    }
    await pressBoth();
}
export async function sendEvmNFT(tx) {
    await waitFor(DeviceLabels.REVIEW_TRANSACTION);
    const events = await pressUntilTextFound(DeviceLabels.ACCEPT);
    const isAddressCorrect = containsSubstringInEvent(tx.accountToCredit.address, events);
    expect(isAddressCorrect).toBeTruthy();
    await pressBoth();
}
//# sourceMappingURL=evm.js.map