@ledgerhq/live-common
Version:
Common ground for the Ledger Live apps
20 lines • 1 kB
JavaScript
;
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) {
const events = await (0, speculos_1.getDelegateEvents)(delegatingAccount);
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