@ledgerhq/live-common 34.35.0-nightly.3 → 34.35.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/e2e/enum/Swap.d.ts +1 -2
- package/lib/e2e/enum/Swap.d.ts.map +1 -1
- package/lib/e2e/enum/Swap.js +10 -12
- package/lib/e2e/enum/Swap.js.map +1 -1
- package/lib/e2e/families/cardano.d.ts.map +1 -1
- package/lib/e2e/families/cardano.js +26 -55
- package/lib/e2e/families/cardano.js.map +1 -1
- package/lib/e2e/families/evm.d.ts.map +1 -1
- package/lib/e2e/families/evm.js +1 -2
- package/lib/e2e/families/evm.js.map +1 -1
- package/lib/e2e/families/solana.d.ts.map +1 -1
- package/lib/e2e/families/solana.js +2 -5
- package/lib/e2e/families/solana.js.map +1 -1
- package/lib/e2e/speculos.d.ts +0 -2
- package/lib/e2e/speculos.d.ts.map +1 -1
- package/lib/e2e/speculos.js +32 -48
- package/lib/e2e/speculos.js.map +1 -1
- package/lib/market/hooks/useLargeMoverDataProvider.d.ts +17 -0
- package/lib/market/hooks/useLargeMoverDataProvider.d.ts.map +1 -0
- package/lib/market/hooks/useLargeMoverDataProvider.js +48 -0
- package/lib/market/hooks/useLargeMoverDataProvider.js.map +1 -0
- package/lib-es/e2e/enum/Swap.d.ts +1 -2
- package/lib-es/e2e/enum/Swap.d.ts.map +1 -1
- package/lib-es/e2e/enum/Swap.js +10 -12
- package/lib-es/e2e/enum/Swap.js.map +1 -1
- package/lib-es/e2e/families/cardano.d.ts.map +1 -1
- package/lib-es/e2e/families/cardano.js +27 -56
- package/lib-es/e2e/families/cardano.js.map +1 -1
- package/lib-es/e2e/families/evm.d.ts.map +1 -1
- package/lib-es/e2e/families/evm.js +1 -2
- package/lib-es/e2e/families/evm.js.map +1 -1
- package/lib-es/e2e/families/solana.d.ts.map +1 -1
- package/lib-es/e2e/families/solana.js +2 -5
- package/lib-es/e2e/families/solana.js.map +1 -1
- package/lib-es/e2e/speculos.d.ts +0 -2
- package/lib-es/e2e/speculos.d.ts.map +1 -1
- package/lib-es/e2e/speculos.js +31 -45
- package/lib-es/e2e/speculos.js.map +1 -1
- package/lib-es/market/hooks/useLargeMoverDataProvider.d.ts +17 -0
- package/lib-es/market/hooks/useLargeMoverDataProvider.d.ts.map +1 -0
- package/lib-es/market/hooks/useLargeMoverDataProvider.js +44 -0
- package/lib-es/market/hooks/useLargeMoverDataProvider.js.map +1 -0
- package/package.json +63 -63
- package/src/e2e/enum/Swap.ts +9 -10
- package/src/e2e/families/cardano.ts +28 -63
- package/src/e2e/families/evm.ts +1 -2
- package/src/e2e/families/solana.ts +2 -5
- package/src/e2e/speculos.ts +31 -46
- package/src/market/hooks/useLargeMoverDataProvider.ts +70 -0
- package/lib/e2e/enum/Device.d.ts +0 -8
- package/lib/e2e/enum/Device.d.ts.map +0 -1
- package/lib/e2e/enum/Device.js +0 -14
- package/lib/e2e/enum/Device.js.map +0 -1
- package/lib/families/hedera/logic.d.ts +0 -2
- package/lib/families/hedera/logic.d.ts.map +0 -1
- package/lib/families/hedera/logic.js +0 -19
- package/lib/families/hedera/logic.js.map +0 -1
- package/lib/market/hooks/useLargeMoverChartData.d.ts +0 -18
- package/lib/market/hooks/useLargeMoverChartData.d.ts.map +0 -1
- package/lib/market/hooks/useLargeMoverChartData.js +0 -28
- package/lib/market/hooks/useLargeMoverChartData.js.map +0 -1
- package/lib/market/hooks/useLargeMoverCurrencies.d.ts +0 -13
- package/lib/market/hooks/useLargeMoverCurrencies.d.ts.map +0 -1
- package/lib/market/hooks/useLargeMoverCurrencies.js +0 -29
- package/lib/market/hooks/useLargeMoverCurrencies.js.map +0 -1
- package/lib-es/e2e/enum/Device.d.ts +0 -8
- package/lib-es/e2e/enum/Device.d.ts.map +0 -1
- package/lib-es/e2e/enum/Device.js +0 -10
- package/lib-es/e2e/enum/Device.js.map +0 -1
- package/lib-es/families/hedera/logic.d.ts +0 -2
- package/lib-es/families/hedera/logic.d.ts.map +0 -1
- package/lib-es/families/hedera/logic.js +0 -3
- package/lib-es/families/hedera/logic.js.map +0 -1
- package/lib-es/market/hooks/useLargeMoverChartData.d.ts +0 -18
- package/lib-es/market/hooks/useLargeMoverChartData.d.ts.map +0 -1
- package/lib-es/market/hooks/useLargeMoverChartData.js +0 -24
- package/lib-es/market/hooks/useLargeMoverChartData.js.map +0 -1
- package/lib-es/market/hooks/useLargeMoverCurrencies.d.ts +0 -13
- package/lib-es/market/hooks/useLargeMoverCurrencies.d.ts.map +0 -1
- package/lib-es/market/hooks/useLargeMoverCurrencies.js +0 -25
- package/lib-es/market/hooks/useLargeMoverCurrencies.js.map +0 -1
- package/src/e2e/enum/Device.ts +0 -7
- package/src/families/hedera/logic.ts +0 -2
- package/src/market/hooks/useLargeMoverChartData.ts +0 -38
- package/src/market/hooks/useLargeMoverCurrencies.ts +0 -36
package/lib/e2e/enum/Swap.d.ts
CHANGED
@@ -3,8 +3,7 @@ export declare class Provider {
|
|
3
3
|
readonly uiName: string;
|
4
4
|
readonly kyc: boolean;
|
5
5
|
readonly isNative: boolean;
|
6
|
-
|
7
|
-
constructor(name: string, uiName: string, kyc: boolean, isNative: boolean, availableOnLns: boolean);
|
6
|
+
constructor(name: string, uiName: string, kyc: boolean, isNative: boolean);
|
8
7
|
static readonly CHANGELLY: Provider;
|
9
8
|
static readonly EXODUS: Provider;
|
10
9
|
static readonly ONE_INCH: Provider;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Swap.d.ts","sourceRoot":"","sources":["../../../src/e2e/enum/Swap.ts"],"names":[],"mappings":"AAAA,qBAAa,QAAQ;aAED,IAAI,EAAE,MAAM;aACZ,MAAM,EAAE,MAAM;aACd,GAAG,EAAE,OAAO;aACZ,QAAQ,EAAE,OAAO;
|
1
|
+
{"version":3,"file":"Swap.d.ts","sourceRoot":"","sources":["../../../src/e2e/enum/Swap.ts"],"names":[],"mappings":"AAAA,qBAAa,QAAQ;aAED,IAAI,EAAE,MAAM;aACZ,MAAM,EAAE,MAAM;aACd,GAAG,EAAE,OAAO;aACZ,QAAQ,EAAE,OAAO;gBAHjB,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,MAAM,EACd,GAAG,EAAE,OAAO,EACZ,QAAQ,EAAE,OAAO;IAEnC,MAAM,CAAC,QAAQ,CAAC,SAAS,WAAuD;IAChF,MAAM,CAAC,QAAQ,CAAC,MAAM,WAAiD;IACvE,MAAM,CAAC,QAAQ,CAAC,QAAQ,WAAkD;IAC1E,MAAM,CAAC,QAAQ,CAAC,QAAQ,WAAsD;IAC9E,MAAM,CAAC,QAAQ,CAAC,OAAO,WAAmD;IAC1E,MAAM,CAAC,QAAQ,CAAC,SAAS,WAAsD;IAC/E,MAAM,CAAC,QAAQ,CAAC,OAAO,WAAoD;IAC3E,MAAM,CAAC,QAAQ,CAAC,IAAI,WAA8C;IAClE,MAAM,CAAC,QAAQ,CAAC,GAAG,WAA2C;IAE9D,MAAM,CAAC,eAAe,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM;CAI/C;AAED,oBAAY,IAAI;IACd,KAAK,UAAU;IACf,KAAK,UAAU;CAChB"}
|
package/lib/e2e/enum/Swap.js
CHANGED
@@ -6,23 +6,21 @@ class Provider {
|
|
6
6
|
uiName;
|
7
7
|
kyc;
|
8
8
|
isNative;
|
9
|
-
|
10
|
-
constructor(name, uiName, kyc, isNative, availableOnLns) {
|
9
|
+
constructor(name, uiName, kyc, isNative) {
|
11
10
|
this.name = name;
|
12
11
|
this.uiName = uiName;
|
13
12
|
this.kyc = kyc;
|
14
13
|
this.isNative = isNative;
|
15
|
-
this.availableOnLns = availableOnLns;
|
16
14
|
}
|
17
|
-
static CHANGELLY = new Provider("changelly", "Changelly", false, true
|
18
|
-
static EXODUS = new Provider("exodus", "Exodus", false, true
|
19
|
-
static ONE_INCH = new Provider("oneinch", "1inch", false, false
|
20
|
-
static PARASWAP = new Provider("paraswap", "Paraswap", false, false
|
21
|
-
static MOONPAY = new Provider("moonpay", "MoonPay", true, false
|
22
|
-
static THORCHAIN = new Provider("thorswap", "THORChain", false, true
|
23
|
-
static UNISWAP = new Provider("uniswap", "Uniswap", false, false
|
24
|
-
static LIFI = new Provider("lifi", "LI.FI", false, true
|
25
|
-
static CIC = new Provider("cic", "CIC", false, true
|
15
|
+
static CHANGELLY = new Provider("changelly", "Changelly", false, true);
|
16
|
+
static EXODUS = new Provider("exodus", "Exodus", false, true);
|
17
|
+
static ONE_INCH = new Provider("oneinch", "1inch", false, false);
|
18
|
+
static PARASWAP = new Provider("paraswap", "Paraswap", false, false);
|
19
|
+
static MOONPAY = new Provider("moonpay", "MoonPay", true, false);
|
20
|
+
static THORCHAIN = new Provider("thorswap", "THORChain", false, true);
|
21
|
+
static UNISWAP = new Provider("uniswap", "Uniswap", false, false);
|
22
|
+
static LIFI = new Provider("lifi", "LI.FI", false, true);
|
23
|
+
static CIC = new Provider("cic", "CIC", false, true);
|
26
24
|
static getNameByUiName(uiName) {
|
27
25
|
const provider = Object.values(Provider).find(p => p.uiName === uiName);
|
28
26
|
return provider ? provider.name : "";
|
package/lib/e2e/enum/Swap.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Swap.js","sourceRoot":"","sources":["../../../src/e2e/enum/Swap.ts"],"names":[],"mappings":";;;AAAA,MAAa,QAAQ;IAED;IACA;IACA;IACA;
|
1
|
+
{"version":3,"file":"Swap.js","sourceRoot":"","sources":["../../../src/e2e/enum/Swap.ts"],"names":[],"mappings":";;;AAAA,MAAa,QAAQ;IAED;IACA;IACA;IACA;IAJlB,YACkB,IAAY,EACZ,MAAc,EACd,GAAY,EACZ,QAAiB;QAHjB,SAAI,GAAJ,IAAI,CAAQ;QACZ,WAAM,GAAN,MAAM,CAAQ;QACd,QAAG,GAAH,GAAG,CAAS;QACZ,aAAQ,GAAR,QAAQ,CAAS;IAChC,CAAC;IACJ,MAAM,CAAU,SAAS,GAAG,IAAI,QAAQ,CAAC,WAAW,EAAE,WAAW,EAAE,KA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AA;AACjB,CAAC,EAHW,IAAI,oBAAJ,IAAI,QAGf"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"cardano.d.ts","sourceRoot":"","sources":["../../../src/e2e/families/cardano.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;
|
1
|
+
{"version":3,"file":"cardano.d.ts","sourceRoot":"","sources":["../../../src/e2e/families/cardano.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAIpD,wBAAsB,WAAW,CAAC,EAAE,EAAE,WAAW,iBAgBhD;AAED,wBAAsB,eAAe,kBAmBpC"}
|
@@ -7,71 +7,42 @@ exports.delegateCardano = exports.sendCardano = void 0;
|
|
7
7
|
const expect_1 = __importDefault(require("expect"));
|
8
8
|
const speculos_1 = require("../speculos");
|
9
9
|
const DeviceLabels_1 = require("../enum/DeviceLabels");
|
10
|
-
const Device_1 = require("../enum/Device");
|
11
10
|
async function sendCardano(tx) {
|
12
|
-
const isNanoS = process.env.SPECULOS_DEVICE === Device_1.Device.LNS;
|
13
11
|
await (0, speculos_1.waitFor)(DeviceLabels_1.DeviceLabels.NEW_ORDINARY);
|
14
|
-
await (
|
15
|
-
|
16
|
-
|
17
|
-
await (0, speculos_1.pressBoth)();
|
18
|
-
}
|
19
|
-
else {
|
20
|
-
await (0, speculos_1.pressUntilTextFound)(DeviceLabels_1.DeviceLabels.SEND_TO_ADDRESS_2);
|
21
|
-
await (0, speculos_1.pressBoth)();
|
22
|
-
}
|
12
|
+
await (0, speculos_1.pressBoth)();
|
13
|
+
await (0, speculos_1.pressUntilTextFound)(DeviceLabels_1.DeviceLabels.SEND_TO_ADDRESS_2);
|
14
|
+
await (0, speculos_1.pressBoth)();
|
23
15
|
const events = await (0, speculos_1.pressUntilTextFound)(DeviceLabels_1.DeviceLabels.SEND);
|
24
|
-
|
25
|
-
|
26
|
-
(0, expect_1.default)(isAmountCorrect).toBeTruthy();
|
27
|
-
}
|
16
|
+
const isAmountCorrect = (0, speculos_1.containsSubstringInEvent)(tx.amount, events);
|
17
|
+
(0, expect_1.default)(isAmountCorrect).toBeTruthy();
|
28
18
|
await (0, speculos_1.pressBoth)();
|
29
19
|
await (0, speculos_1.waitFor)(DeviceLabels_1.DeviceLabels.TRANSACTION_FEE);
|
30
20
|
await (0, speculos_1.pressBoth)();
|
31
21
|
await (0, speculos_1.waitFor)(DeviceLabels_1.DeviceLabels.CONFIRM_TRANSACTION);
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
else {
|
36
|
-
await (0, speculos_1.pressBoth)();
|
37
|
-
const isAddressCorrect = (0, speculos_1.containsSubstringInEvent)(tx.accountToCredit.address, events);
|
38
|
-
(0, expect_1.default)(isAddressCorrect).toBeTruthy();
|
39
|
-
}
|
22
|
+
await (0, speculos_1.pressBoth)();
|
23
|
+
const isAddressCorrect = (0, speculos_1.containsSubstringInEvent)(tx.accountToCredit.address, events);
|
24
|
+
(0, expect_1.default)(isAddressCorrect).toBeTruthy();
|
40
25
|
}
|
41
26
|
exports.sendCardano = sendCardano;
|
42
27
|
async function delegateCardano() {
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
{ label: DeviceLabels_1.DeviceLabels.STAKE_KEY, action: "both" },
|
62
|
-
{ label: DeviceLabels_1.DeviceLabels.CONFIRM, action: "right" },
|
63
|
-
{ label: DeviceLabels_1.DeviceLabels.CONFIRM, action: "right" },
|
64
|
-
];
|
65
|
-
const stepsToExecute = process.env.SPECULOS_DEVICE === Device_1.Device.LNS ? LNSSpecificSteps : commonSteps;
|
66
|
-
for (const step of stepsToExecute) {
|
67
|
-
await (0, speculos_1.waitFor)(step.label);
|
68
|
-
if (step.action === "both") {
|
69
|
-
await (0, speculos_1.pressBoth)();
|
70
|
-
}
|
71
|
-
else if (step.action === "right") {
|
72
|
-
await (0, speculos_1.pressRightButton)();
|
73
|
-
}
|
74
|
-
}
|
28
|
+
await (0, speculos_1.waitFor)(DeviceLabels_1.DeviceLabels.NEW_ORDINARY);
|
29
|
+
await (0, speculos_1.pressBoth)();
|
30
|
+
await (0, speculos_1.waitFor)(DeviceLabels_1.DeviceLabels.TRANSACTION_FEE);
|
31
|
+
await (0, speculos_1.pressBoth)();
|
32
|
+
await (0, speculos_1.waitFor)(DeviceLabels_1.DeviceLabels.REGISTER);
|
33
|
+
await (0, speculos_1.pressBoth)();
|
34
|
+
await (0, speculos_1.waitFor)(DeviceLabels_1.DeviceLabels.STAKE_KEY);
|
35
|
+
await (0, speculos_1.pressBoth)();
|
36
|
+
await (0, speculos_1.waitFor)(DeviceLabels_1.DeviceLabels.CONFIRM);
|
37
|
+
await (0, speculos_1.pressBoth)();
|
38
|
+
await (0, speculos_1.waitFor)(DeviceLabels_1.DeviceLabels.DELEGATE_STAKE);
|
39
|
+
await (0, speculos_1.pressBoth)();
|
40
|
+
await (0, speculos_1.waitFor)(DeviceLabels_1.DeviceLabels.STAKE_KEY);
|
41
|
+
await (0, speculos_1.pressBoth)();
|
42
|
+
await (0, speculos_1.waitFor)(DeviceLabels_1.DeviceLabels.CONFIRM);
|
43
|
+
await (0, speculos_1.pressBoth)();
|
44
|
+
await (0, speculos_1.waitFor)(DeviceLabels_1.DeviceLabels.CONFIRM);
|
45
|
+
await (0, speculos_1.pressBoth)();
|
75
46
|
}
|
76
47
|
exports.delegateCardano = delegateCardano;
|
77
48
|
//# sourceMappingURL=cardano.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"cardano.js","sourceRoot":"","sources":["../../../src/e2e/families/cardano.ts"],"names":[],"mappings":";;;;;;AAAA,oDAA4B;AAE5B,
|
1
|
+
{"version":3,"file":"cardano.js","sourceRoot":"","sources":["../../../src/e2e/families/cardano.ts"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AY,CAAC,QAAQ,CAAC,CAAC;IACrC,MAAM,IAAA,oBAAS,GAAE,CAAC;IAClB,MAAM,IAAA,kBAAO,EAAC,2BAAY,CAAC,SAAS,CAAC,CAAC;IACtC,MAAM,IAAA,oBAAS,GAAE,CAAC;IAClB,MAAM,IAAA,kBAAO,EAAC,2BAAY,CAAC,OAAO,CAAC,CAAC;IACpC,MAAM,IAAA,oBAAS,GAAE,CAAC;IAClB,MAAM,IAAA,kBAAO,EAAC,2BAAY,CAAC,cAAc,CAAC,CAAC;IAC3C,MAAM,IAAA,oBAAS,GAAE,CAAC;IAClB,MAAM,IAAA,kBAAO,EAAC,2BAAY,CAAC,SAAS,CAAC,CAAC;IACtC,MAAM,IAAA,oBAAS,GAAE,CAAC;IAClB,MAAM,IAAA,kBAAO,EAAC,2BAAY,CAAC,OAAO,CAAC,CAAC;IACpC,MAAM,IAAA,oBAAS,GAAE,CAAC;IAClB,MAAM,IAAA,kBAAO,EAAC,2BAAY,CAAC,OAAO,CAAC,CAAC;IACpC,MAAM,IAAA,oBAAS,GAAE,CAAC;AACpB,CAAC;AAnBD,0CAmBC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"evm.d.ts","sourceRoot":"","sources":["../../../src/e2e/families/evm.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;
|
1
|
+
{"version":3,"file":"evm.d.ts","sourceRoot":"","sources":["../../../src/e2e/families/evm.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAIpE,wBAAsB,OAAO,CAAC,EAAE,EAAE,WAAW,iBAa5C;AAED,wBAAsB,UAAU,CAAC,EAAE,EAAE,cAAc,iBAMlD"}
|
package/lib/e2e/families/evm.js
CHANGED
@@ -7,12 +7,11 @@ exports.sendEvmNFT = exports.sendEVM = void 0;
|
|
7
7
|
const expect_1 = __importDefault(require("expect"));
|
8
8
|
const speculos_1 = require("../speculos");
|
9
9
|
const DeviceLabels_1 = require("../enum/DeviceLabels");
|
10
|
-
const Device_1 = require("../enum/Device");
|
11
10
|
async function sendEVM(tx) {
|
12
11
|
const events = await (0, speculos_1.pressUntilTextFound)(DeviceLabels_1.DeviceLabels.ACCEPT);
|
13
12
|
const isAmountCorrect = (0, speculos_1.containsSubstringInEvent)(tx.amount, events);
|
14
13
|
(0, expect_1.default)(isAmountCorrect).toBeTruthy();
|
15
|
-
if (tx.accountToCredit.ensName
|
14
|
+
if (tx.accountToCredit.ensName) {
|
16
15
|
const isENSNameCorrect = (0, speculos_1.containsSubstringInEvent)(tx.accountToCredit.ensName, events);
|
17
16
|
(0, expect_1.default)(isENSNameCorrect).toBeTruthy();
|
18
17
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"evm.js","sourceRoot":"","sources":["../../../src/e2e/families/evm.ts"],"names":[],"mappings":";;;;;;AAAA,oDAA4B;AAE5B,0CAAgG;AAChG,uDAAoD;
|
1
|
+
{"version":3,"file":"evm.js","sourceRoot":"","sources":["../../../src/e2e/families/evm.ts"],"names":[],"mappings":";;;;;;AAAA,oDAA4B;AAE5B,0CAAgG;AAChG,uDAAoD;AAE7C,KAAK,UAAU,OAAO,CAAC,EAAe;IAC3C,MAAM,MAAM,GAAG,MAAM,IAAA,8BAAmB,EAAC,2BAAY,CAAC,MAAM,CAAC,CAAC;IAC9D,MAAM,eAAe,GAAG,IAAA,mCAAwB,EAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACpE,IAAA,gBAAM,EAAC,eAAe,CAAC,CAAC,UAAU,EAAE,CAAC;IACrC,IAAI,EAAE,CAAC,eAAe,CAAC,OAAO,EAAE;QAC9B,MAAM,gBAAgB,GAAG,IAAA,mCAAwB,EAAC,EAAE,CAAC,eAAe,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;QACtF,IAAA,gBAAM,EAAC,gBAAgB,CAAC,CAAC,UAAU,EAAE,CAAC;KACvC;SAAM;QACL,MAAM,gBAAgB,GAAG,IAAA,mCAAwB,EAAC,EAAE,CAAC,eAAe,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;QACtF,IAAA,gBAAM,EAAC,gBAAgB,CAAC,CAAC,UAAU,EAAE,CAAC;KACvC;IAED,MAAM,IAAA,oBAAS,GAAE,CAAC;AACpB,CAAC;AAbD,0BAaC;AAEM,KAAK,UAAU,UAAU,CAAC,EAAkB;IACjD,MAAM,IAAA,kBAAO,EAAC,2BAAY,CAAC,kBAAkB,CAAC,CAAC;IAC/C,MAAM,MAAM,GAAG,MAAM,IAAA,8BAAmB,EAAC,2BAAY,CAAC,MAAM,CAAC,CAAC;IAC9D,MAAM,gBAAgB,GAAG,IAAA,mCAAwB,EAAC,EAAE,CAAC,eAAe,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;IACtF,IAAA,gBAAM,EAAC,gBAAgB,CAAC,CAAC,UAAU,EAAE,CAAC;IACtC,MAAM,IAAA,oBAAS,GAAE,CAAC;AACpB,CAAC;AAND,gCAMC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"solana.d.ts","sourceRoot":"","sources":["../../../src/e2e/families/solana.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"solana.d.ts","sourceRoot":"","sources":["../../../src/e2e/families/solana.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAEpD,wBAAsB,cAAc,kBAInC;AAED,wBAAsB,UAAU,CAAC,EAAE,EAAE,WAAW,iBAQ/C"}
|
@@ -7,7 +7,6 @@ exports.sendSolana = exports.delegateSolana = void 0;
|
|
7
7
|
const expect_1 = __importDefault(require("expect"));
|
8
8
|
const speculos_1 = require("../speculos");
|
9
9
|
const DeviceLabels_1 = require("../enum/DeviceLabels");
|
10
|
-
const Device_1 = require("../enum/Device");
|
11
10
|
async function delegateSolana() {
|
12
11
|
await (0, speculos_1.waitFor)(DeviceLabels_1.DeviceLabels.DELEGATE_FROM);
|
13
12
|
await (0, speculos_1.pressUntilTextFound)(DeviceLabels_1.DeviceLabels.APPROVE);
|
@@ -18,10 +17,8 @@ async function sendSolana(tx) {
|
|
18
17
|
const events = await (0, speculos_1.pressUntilTextFound)(DeviceLabels_1.DeviceLabels.APPROVE);
|
19
18
|
const isAmountCorrect = (0, speculos_1.containsSubstringInEvent)(tx.amount, events);
|
20
19
|
(0, expect_1.default)(isAmountCorrect).toBeTruthy();
|
21
|
-
|
22
|
-
|
23
|
-
(0, expect_1.default)(isAddressCorrect).toBeTruthy();
|
24
|
-
}
|
20
|
+
const isAddressCorrect = (0, speculos_1.containsSubstringInEvent)(tx.accountToCredit.address, events);
|
21
|
+
(0, expect_1.default)(isAddressCorrect).toBeTruthy();
|
25
22
|
await (0, speculos_1.pressBoth)();
|
26
23
|
}
|
27
24
|
exports.sendSolana = sendSolana;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"solana.js","sourceRoot":"","sources":["../../../src/e2e/families/solana.ts"],"names":[],"mappings":";;;;;;AAAA,oDAA4B;AAC5B,0CAAgG;AAChG,uDAAoD;
|
1
|
+
{"version":3,"file":"solana.js","sourceRoot":"","sources":["../../../src/e2e/families/solana.ts"],"names":[],"mappings":";;;;;;AAAA,oDAA4B;AAC5B,0CAAgG;AAChG,uDAAoD;AAG7C,KAAK,UAAU,cAAc;IAClC,MAAM,IAAA,kBAAO,EAAC,2BAAY,CAAC,aAAa,CAAC,CAAC;IAC1C,MAAM,IAAA,8BAAmB,EAAC,2BAAY,CAAC,OAAO,CAAC,CAAC;IAChD,MAAM,IAAA,oBAAS,GAAE,CAAC;AACpB,CAAC;AAJD,wCAIC;AAEM,KAAK,UAAU,UAAU,CAAC,EAAe;IAC9C,MAAM,MAAM,GAAG,MAAM,IAAA,8BAAmB,EAAC,2BAAY,CAAC,OAAO,CAAC,CAAC;IAC/D,MAAM,eAAe,GAAG,IAAA,mCAAwB,EAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACpE,IAAA,gBAAM,EAAC,eAAe,CAAC,CAAC,UAAU,EAAE,CAAC;IACrC,MAAM,gBAAgB,GAAG,IAAA,mCAAwB,EAAC,EAAE,CAAC,eAAe,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;IACtF,IAAA,gBAAM,EAAC,gBAAgB,CAAC,CAAC,UAAU,EAAE,CAAC;IAEtC,MAAM,IAAA,oBAAS,GAAE,CAAC;AACpB,CAAC;AARD,gCAQC"}
|
package/lib/e2e/speculos.d.ts
CHANGED
@@ -24,7 +24,6 @@ export type Dependency = {
|
|
24
24
|
appVersion?: string;
|
25
25
|
};
|
26
26
|
export declare function setExchangeDependencies(dependencies: Dependency[]): void;
|
27
|
-
export declare function getSpeculosModel(): DeviceModelId.nanoS | DeviceModelId.nanoSP | DeviceModelId.nanoX;
|
28
27
|
type Specs = {
|
29
28
|
[key: string]: Spec;
|
30
29
|
};
|
@@ -39,7 +38,6 @@ export declare function stopSpeculos(deviceId: string | undefined): Promise<void
|
|
39
38
|
export declare function waitFor(text: string, maxAttempts?: number): Promise<string[]>;
|
40
39
|
export declare function pressBoth(): Promise<void>;
|
41
40
|
export declare function pressUntilTextFound(targetText: string, maxAttempts?: number): Promise<string[]>;
|
42
|
-
export declare function pressRightButton(): Promise<void>;
|
43
41
|
export declare function containsSubstringInEvent(targetString: string, events: string[]): boolean;
|
44
42
|
export declare function takeScreenshot(port?: number): Promise<Buffer | undefined>;
|
45
43
|
export declare function waitForTimeOut(ms: number): Promise<unknown>;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"speculos.d.ts","sourceRoot":"","sources":["../../src/e2e/speculos.ts"],"names":[],"mappings":";;AAEA,OAAO,EAKL,iBAAiB,EAClB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAE9D,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO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AED,wBAAsB,0BAA0B,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,iBAI1E;AAED,wBAAsB,0BAA0B,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,iBAI1E"}
|
package/lib/e2e/speculos.js
CHANGED
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
4
4
|
};
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
6
|
-
exports.verifyAmountsAndRejectSwap = exports.verifyAmountsAndAcceptSwap = exports.signDelegationTransaction = exports.signSendNFTTransaction = exports.signSendTransaction = exports.expectValidAddressDevice = exports.activateContractData = exports.activateExpertMode = exports.activateLedgerSync = exports.removeMemberLedgerSync = exports.waitForTimeOut = exports.takeScreenshot = exports.containsSubstringInEvent = exports.
|
6
|
+
exports.verifyAmountsAndRejectSwap = exports.verifyAmountsAndAcceptSwap = exports.signDelegationTransaction = exports.signSendNFTTransaction = exports.signSendTransaction = exports.expectValidAddressDevice = exports.activateContractData = exports.activateExpertMode = exports.activateLedgerSync = exports.removeMemberLedgerSync = exports.waitForTimeOut = exports.takeScreenshot = exports.containsSubstringInEvent = exports.pressUntilTextFound = exports.pressBoth = exports.waitFor = exports.stopSpeculos = exports.startSpeculos = exports.specs = exports.setExchangeDependencies = void 0;
|
7
7
|
const invariant_1 = __importDefault(require("invariant"));
|
8
8
|
const logs_1 = require("@ledgerhq/logs");
|
9
9
|
const speculos_1 = require("../load/speculos");
|
@@ -13,7 +13,6 @@ const live_env_1 = require("@ledgerhq/live-env");
|
|
13
13
|
const currencies_1 = require("../currencies");
|
14
14
|
const DeviceLabels_1 = require("../e2e/enum/DeviceLabels");
|
15
15
|
const Account_1 = require("./enum/Account");
|
16
|
-
const Device_1 = require("./enum/Device");
|
17
16
|
const Currency_1 = require("./enum/Currency");
|
18
17
|
const expect_1 = __importDefault(require("expect"));
|
19
18
|
const bitcoin_1 = require("./families/bitcoin");
|
@@ -41,24 +40,11 @@ function setExchangeDependencies(dependencies) {
|
|
41
40
|
exports.specs["Exchange"].dependencies = Array.from(map.values());
|
42
41
|
}
|
43
42
|
exports.setExchangeDependencies = setExchangeDependencies;
|
44
|
-
function getSpeculosModel() {
|
45
|
-
const speculosDevice = process.env.SPECULOS_DEVICE;
|
46
|
-
switch (speculosDevice) {
|
47
|
-
case Device_1.Device.LNS:
|
48
|
-
return devices_1.DeviceModelId.nanoS;
|
49
|
-
case Device_1.Device.LNX:
|
50
|
-
return devices_1.DeviceModelId.nanoX;
|
51
|
-
case Device_1.Device.LNSP:
|
52
|
-
default:
|
53
|
-
return devices_1.DeviceModelId.nanoSP;
|
54
|
-
}
|
55
|
-
}
|
56
|
-
exports.getSpeculosModel = getSpeculosModel;
|
57
43
|
exports.specs = {
|
58
44
|
Bitcoin: {
|
59
45
|
currency: (0, currencies_1.getCryptoCurrencyById)("bitcoin"),
|
60
46
|
appQuery: {
|
61
|
-
model:
|
47
|
+
model: devices_1.DeviceModelId.nanoSP,
|
62
48
|
appName: "Bitcoin",
|
63
49
|
},
|
64
50
|
dependency: "",
|
@@ -66,21 +52,21 @@ exports.specs = {
|
|
66
52
|
Aptos: {
|
67
53
|
currency: (0, currencies_1.getCryptoCurrencyById)("aptos"),
|
68
54
|
appQuery: {
|
69
|
-
model:
|
55
|
+
model: devices_1.DeviceModelId.nanoSP,
|
70
56
|
appName: "Aptos",
|
71
57
|
},
|
72
58
|
dependency: "",
|
73
59
|
},
|
74
60
|
Exchange: {
|
75
61
|
appQuery: {
|
76
|
-
model:
|
62
|
+
model: devices_1.DeviceModelId.nanoSP,
|
77
63
|
appName: "Exchange",
|
78
64
|
},
|
79
65
|
dependencies: [],
|
80
66
|
},
|
81
67
|
LedgerSync: {
|
82
68
|
appQuery: {
|
83
|
-
model:
|
69
|
+
model: devices_1.DeviceModelId.nanoX,
|
84
70
|
appName: "Ledger Sync",
|
85
71
|
},
|
86
72
|
dependency: "",
|
@@ -88,7 +74,7 @@ exports.specs = {
|
|
88
74
|
Dogecoin: {
|
89
75
|
currency: (0, currencies_1.getCryptoCurrencyById)("dogecoin"),
|
90
76
|
appQuery: {
|
91
|
-
model:
|
77
|
+
model: devices_1.DeviceModelId.nanoSP,
|
92
78
|
appName: "Dogecoin",
|
93
79
|
},
|
94
80
|
dependency: "",
|
@@ -96,7 +82,7 @@ exports.specs = {
|
|
96
82
|
Ethereum: {
|
97
83
|
currency: (0, currencies_1.getCryptoCurrencyById)("ethereum"),
|
98
84
|
appQuery: {
|
99
|
-
model:
|
85
|
+
model: devices_1.DeviceModelId.nanoSP,
|
100
86
|
appName: "Ethereum",
|
101
87
|
},
|
102
88
|
dependency: "",
|
@@ -104,7 +90,7 @@ exports.specs = {
|
|
104
90
|
Ethereum_Holesky: {
|
105
91
|
currency: (0, currencies_1.getCryptoCurrencyById)("ethereum_holesky"),
|
106
92
|
appQuery: {
|
107
|
-
model:
|
93
|
+
model: devices_1.DeviceModelId.nanoSP,
|
108
94
|
appName: "Ethereum",
|
109
95
|
},
|
110
96
|
dependency: "",
|
@@ -112,7 +98,7 @@ exports.specs = {
|
|
112
98
|
Ethereum_Sepolia: {
|
113
99
|
currency: (0, currencies_1.getCryptoCurrencyById)("ethereum_sepolia"),
|
114
100
|
appQuery: {
|
115
|
-
model:
|
101
|
+
model: devices_1.DeviceModelId.nanoSP,
|
116
102
|
appName: "Ethereum",
|
117
103
|
},
|
118
104
|
dependency: "",
|
@@ -120,7 +106,7 @@ exports.specs = {
|
|
120
106
|
Ethereum_Classic: {
|
121
107
|
currency: (0, currencies_1.getCryptoCurrencyById)("ethereum_classic"),
|
122
108
|
appQuery: {
|
123
|
-
model:
|
109
|
+
model: devices_1.DeviceModelId.nanoSP,
|
124
110
|
appName: "Ethereum Classic",
|
125
111
|
},
|
126
112
|
dependency: "Ethereum",
|
@@ -128,7 +114,7 @@ exports.specs = {
|
|
128
114
|
Bitcoin_Testnet: {
|
129
115
|
currency: (0, currencies_1.getCryptoCurrencyById)("bitcoin_testnet"),
|
130
116
|
appQuery: {
|
131
|
-
model:
|
117
|
+
model: devices_1.DeviceModelId.nanoSP,
|
132
118
|
appName: "Bitcoin Test",
|
133
119
|
},
|
134
120
|
dependency: "",
|
@@ -136,7 +122,7 @@ exports.specs = {
|
|
136
122
|
Solana: {
|
137
123
|
currency: (0, currencies_1.getCryptoCurrencyById)("solana"),
|
138
124
|
appQuery: {
|
139
|
-
model:
|
125
|
+
model: devices_1.DeviceModelId.nanoSP,
|
140
126
|
appName: "Solana",
|
141
127
|
},
|
142
128
|
dependency: "",
|
@@ -144,7 +130,7 @@ exports.specs = {
|
|
144
130
|
Cardano: {
|
145
131
|
currency: (0, currencies_1.getCryptoCurrencyById)("cardano"),
|
146
132
|
appQuery: {
|
147
|
-
model:
|
133
|
+
model: devices_1.DeviceModelId.nanoSP,
|
148
134
|
appName: "CardanoADA",
|
149
135
|
},
|
150
136
|
dependency: "",
|
@@ -152,7 +138,7 @@ exports.specs = {
|
|
152
138
|
Polkadot: {
|
153
139
|
currency: (0, currencies_1.getCryptoCurrencyById)("polkadot"),
|
154
140
|
appQuery: {
|
155
|
-
model:
|
141
|
+
model: devices_1.DeviceModelId.nanoSP,
|
156
142
|
appName: "Polkadot",
|
157
143
|
},
|
158
144
|
dependency: "",
|
@@ -160,7 +146,7 @@ exports.specs = {
|
|
160
146
|
Tron: {
|
161
147
|
currency: (0, currencies_1.getCryptoCurrencyById)("tron"),
|
162
148
|
appQuery: {
|
163
|
-
model:
|
149
|
+
model: devices_1.DeviceModelId.nanoSP,
|
164
150
|
appName: "Tron",
|
165
151
|
},
|
166
152
|
dependency: "",
|
@@ -168,7 +154,7 @@ exports.specs = {
|
|
168
154
|
XRP: {
|
169
155
|
currency: (0, currencies_1.getCryptoCurrencyById)("ripple"),
|
170
156
|
appQuery: {
|
171
|
-
model:
|
157
|
+
model: devices_1.DeviceModelId.nanoSP,
|
172
158
|
appName: "XRP",
|
173
159
|
},
|
174
160
|
dependency: "",
|
@@ -176,7 +162,7 @@ exports.specs = {
|
|
176
162
|
Stellar: {
|
177
163
|
currency: (0, currencies_1.getCryptoCurrencyById)("stellar"),
|
178
164
|
appQuery: {
|
179
|
-
model:
|
165
|
+
model: devices_1.DeviceModelId.nanoSP,
|
180
166
|
appName: "Stellar",
|
181
167
|
},
|
182
168
|
dependency: "",
|
@@ -184,7 +170,7 @@ exports.specs = {
|
|
184
170
|
Bitcoin_Cash: {
|
185
171
|
currency: (0, currencies_1.getCryptoCurrencyById)("bitcoin_cash"),
|
186
172
|
appQuery: {
|
187
|
-
model:
|
173
|
+
model: devices_1.DeviceModelId.nanoSP,
|
188
174
|
appName: "Bitcoin Cash",
|
189
175
|
},
|
190
176
|
dependency: "",
|
@@ -192,7 +178,7 @@ exports.specs = {
|
|
192
178
|
Algorand: {
|
193
179
|
currency: (0, currencies_1.getCryptoCurrencyById)("algorand"),
|
194
180
|
appQuery: {
|
195
|
-
model:
|
181
|
+
model: devices_1.DeviceModelId.nanoSP,
|
196
182
|
appName: "Algorand",
|
197
183
|
},
|
198
184
|
dependency: "",
|
@@ -200,7 +186,7 @@ exports.specs = {
|
|
200
186
|
Cosmos: {
|
201
187
|
currency: (0, currencies_1.getCryptoCurrencyById)("cosmos"),
|
202
188
|
appQuery: {
|
203
|
-
model:
|
189
|
+
model: devices_1.DeviceModelId.nanoSP,
|
204
190
|
appName: "Cosmos",
|
205
191
|
},
|
206
192
|
dependency: "",
|
@@ -208,7 +194,7 @@ exports.specs = {
|
|
208
194
|
Tezos: {
|
209
195
|
currency: (0, currencies_1.getCryptoCurrencyById)("tezos"),
|
210
196
|
appQuery: {
|
211
|
-
model:
|
197
|
+
model: devices_1.DeviceModelId.nanoSP,
|
212
198
|
appName: "TezosWallet",
|
213
199
|
},
|
214
200
|
dependency: "",
|
@@ -216,7 +202,7 @@ exports.specs = {
|
|
216
202
|
Polygon: {
|
217
203
|
currency: (0, currencies_1.getCryptoCurrencyById)("polygon"),
|
218
204
|
appQuery: {
|
219
|
-
model:
|
205
|
+
model: devices_1.DeviceModelId.nanoSP,
|
220
206
|
appName: "Ethereum",
|
221
207
|
},
|
222
208
|
dependency: "",
|
@@ -224,7 +210,7 @@ exports.specs = {
|
|
224
210
|
Binance_Smart_Chain: {
|
225
211
|
currency: (0, currencies_1.getCryptoCurrencyById)("bsc"),
|
226
212
|
appQuery: {
|
227
|
-
model:
|
213
|
+
model: devices_1.DeviceModelId.nanoSP,
|
228
214
|
appName: "Ethereum",
|
229
215
|
},
|
230
216
|
dependency: "",
|
@@ -232,7 +218,7 @@ exports.specs = {
|
|
232
218
|
Ton: {
|
233
219
|
currency: (0, currencies_1.getCryptoCurrencyById)("ton"),
|
234
220
|
appQuery: {
|
235
|
-
model:
|
221
|
+
model: devices_1.DeviceModelId.nanoSP,
|
236
222
|
appName: "TON",
|
237
223
|
},
|
238
224
|
dependency: "",
|
@@ -240,7 +226,7 @@ exports.specs = {
|
|
240
226
|
Near: {
|
241
227
|
currency: (0, currencies_1.getCryptoCurrencyById)("near"),
|
242
228
|
appQuery: {
|
243
|
-
model:
|
229
|
+
model: devices_1.DeviceModelId.nanoSP,
|
244
230
|
appName: "NEAR",
|
245
231
|
},
|
246
232
|
dependency: "",
|
@@ -248,7 +234,7 @@ exports.specs = {
|
|
248
234
|
Multivers_X: {
|
249
235
|
currency: (0, currencies_1.getCryptoCurrencyById)("elrond"),
|
250
236
|
appQuery: {
|
251
|
-
model:
|
237
|
+
model: devices_1.DeviceModelId.nanoSP,
|
252
238
|
appName: "MultiversX",
|
253
239
|
},
|
254
240
|
dependency: "",
|
@@ -256,7 +242,7 @@ exports.specs = {
|
|
256
242
|
Osmosis: {
|
257
243
|
currency: (0, currencies_1.getCryptoCurrencyById)("osmo"),
|
258
244
|
appQuery: {
|
259
|
-
model:
|
245
|
+
model: devices_1.DeviceModelId.nanoSP,
|
260
246
|
appName: "Cosmos",
|
261
247
|
},
|
262
248
|
dependency: "",
|
@@ -264,7 +250,7 @@ exports.specs = {
|
|
264
250
|
Injective: {
|
265
251
|
currency: (0, currencies_1.getCryptoCurrencyById)("injective"),
|
266
252
|
appQuery: {
|
267
|
-
model:
|
253
|
+
model: devices_1.DeviceModelId.nanoSP,
|
268
254
|
appName: "Cosmos",
|
269
255
|
},
|
270
256
|
dependency: "",
|
@@ -272,7 +258,7 @@ exports.specs = {
|
|
272
258
|
Celo: {
|
273
259
|
currency: (0, currencies_1.getCryptoCurrencyById)("celo"),
|
274
260
|
appQuery: {
|
275
|
-
model:
|
261
|
+
model: devices_1.DeviceModelId.nanoSP,
|
276
262
|
appName: "Celo",
|
277
263
|
},
|
278
264
|
dependency: "",
|
@@ -280,7 +266,7 @@ exports.specs = {
|
|
280
266
|
Litecoin: {
|
281
267
|
currency: (0, currencies_1.getCryptoCurrencyById)("litecoin"),
|
282
268
|
appQuery: {
|
283
|
-
model:
|
269
|
+
model: devices_1.DeviceModelId.nanoSP,
|
284
270
|
appName: "Litecoin",
|
285
271
|
},
|
286
272
|
dependency: "",
|
@@ -376,7 +362,7 @@ async function pressUntilTextFound(targetText, maxAttempts = 15) {
|
|
376
362
|
if (texts.includes(targetText)) {
|
377
363
|
return await fetchAllEvents(speculosApiPort);
|
378
364
|
}
|
379
|
-
await pressRightButton();
|
365
|
+
await pressRightButton(speculosApiPort);
|
380
366
|
await waitForTimeOut(200);
|
381
367
|
}
|
382
368
|
throw new Error(`ElementNotFoundException: Element with text "${targetText}" not found on speculos screen`);
|
@@ -390,13 +376,11 @@ async function fetchAllEvents(speculosApiPort) {
|
|
390
376
|
const response = await axios_1.default.get(`http://127.0.0.1:${speculosApiPort}/events?stream=false¤tscreenonly=false`);
|
391
377
|
return response.data.events.map(event => event.text);
|
392
378
|
}
|
393
|
-
async function pressRightButton() {
|
394
|
-
const speculosApiPort = (0, live_env_1.getEnv)("SPECULOS_API_PORT");
|
379
|
+
async function pressRightButton(speculosApiPort) {
|
395
380
|
await axios_1.default.post(`http://127.0.0.1:${speculosApiPort}/button/right`, {
|
396
381
|
action: "press-and-release",
|
397
382
|
});
|
398
383
|
}
|
399
|
-
exports.pressRightButton = pressRightButton;
|
400
384
|
function containsSubstringInEvent(targetString, events) {
|
401
385
|
const concatenatedEvents = events.join("");
|
402
386
|
let result = concatenatedEvents.includes(targetString);
|