"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.delegateNear = void 0;
const expect_1 = __importDefault(require("expect"));
const speculos_1 = require("../speculos");
const DeviceLabels_1 = require("../enum/DeviceLabels");
async function delegateNear(delegatingAccount) {
    await (0, speculos_1.waitFor)(DeviceLabels_1.DeviceLabels.VIEW_HEADER);
    const events = await (0, speculos_1.pressUntilTextFound)(DeviceLabels_1.DeviceLabels.CONTINUE_TO_ACTION);
    const isProviderCorrect = (0, speculos_1.containsSubstringInEvent)(delegatingAccount.provider, events);
    (0, expect_1.default)(isProviderCorrect).toBeTruthy();
    await (0, speculos_1.pressBoth)();
    await (0, speculos_1.waitFor)(DeviceLabels_1.DeviceLabels.VIEW_ACTION);
    await (0, speculos_1.pressUntilTextFound)(DeviceLabels_1.DeviceLabels.SIGN);
    await (0, speculos_1.pressBoth)();
}
exports.delegateNear = delegateNear;
//# sourceMappingURL=near.js.map