@ledgerhq/live-common 34.35.0-nightly.0 → 34.35.0-nightly.1
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/Device.d.ts +8 -0
- package/lib/e2e/enum/Device.d.ts.map +1 -0
- package/lib/e2e/enum/Device.js +14 -0
- package/lib/e2e/enum/Device.js.map +1 -0
- package/lib/e2e/enum/Swap.d.ts +2 -1
- package/lib/e2e/enum/Swap.d.ts.map +1 -1
- package/lib/e2e/enum/Swap.js +12 -10
- 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 +55 -26
- 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 +2 -1
- 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 +5 -2
- package/lib/e2e/families/solana.js.map +1 -1
- package/lib/e2e/speculos.d.ts +2 -0
- package/lib/e2e/speculos.d.ts.map +1 -1
- package/lib/e2e/speculos.js +48 -32
- package/lib/e2e/speculos.js.map +1 -1
- package/lib/exchange/swap/getCompleteSwapHistory.d.ts.map +1 -1
- package/lib/exchange/swap/getCompleteSwapHistory.js +2 -2
- package/lib/exchange/swap/getCompleteSwapHistory.js.map +1 -1
- package/lib-es/e2e/enum/Device.d.ts +8 -0
- package/lib-es/e2e/enum/Device.d.ts.map +1 -0
- package/lib-es/e2e/enum/Device.js +10 -0
- package/lib-es/e2e/enum/Device.js.map +1 -0
- package/lib-es/e2e/enum/Swap.d.ts +2 -1
- package/lib-es/e2e/enum/Swap.d.ts.map +1 -1
- package/lib-es/e2e/enum/Swap.js +12 -10
- 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 +56 -27
- 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 +2 -1
- 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 +5 -2
- package/lib-es/e2e/families/solana.js.map +1 -1
- package/lib-es/e2e/speculos.d.ts +2 -0
- package/lib-es/e2e/speculos.d.ts.map +1 -1
- package/lib-es/e2e/speculos.js +45 -31
- package/lib-es/e2e/speculos.js.map +1 -1
- package/lib-es/exchange/swap/getCompleteSwapHistory.d.ts.map +1 -1
- package/lib-es/exchange/swap/getCompleteSwapHistory.js +2 -2
- package/lib-es/exchange/swap/getCompleteSwapHistory.js.map +1 -1
- package/package.json +12 -12
- package/src/e2e/enum/Device.ts +7 -0
- package/src/e2e/enum/Swap.ts +10 -9
- package/src/e2e/families/cardano.ts +63 -28
- package/src/e2e/families/evm.ts +2 -1
- package/src/e2e/families/solana.ts +5 -2
- package/src/e2e/speculos.ts +46 -31
- package/src/exchange/swap/getCompleteSwapHistory.ts +4 -2
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"Device.d.ts","sourceRoot":"","sources":["../../../src/e2e/enum/Device.ts"],"names":[],"mappings":"AAAA,qBAAa,MAAM;aACW,IAAI,EAAE,MAAM;gBAAZ,IAAI,EAAE,MAAM;IAExC,MAAM,CAAC,QAAQ,CAAC,GAAG,WAAW;IAC9B,MAAM,CAAC,QAAQ,CAAC,GAAG,WAAW;IAC9B,MAAM,CAAC,QAAQ,CAAC,IAAI,YAAY;CACjC"}
|
@@ -0,0 +1,14 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.Device = void 0;
|
4
|
+
class Device {
|
5
|
+
name;
|
6
|
+
constructor(name) {
|
7
|
+
this.name = name;
|
8
|
+
}
|
9
|
+
static LNS = "nanoS";
|
10
|
+
static LNX = "nanoX";
|
11
|
+
static LNSP = "nanoSP";
|
12
|
+
}
|
13
|
+
exports.Device = Device;
|
14
|
+
//# sourceMappingURL=Device.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"Device.js","sourceRoot":"","sources":["../../../src/e2e/enum/Device.ts"],"names":[],"mappings":";;;AAAA,MAAa,MAAM;IACW;IAA5B,YAA4B,IAAY;QAAZ,SAAI,GAAJ,IAAI,CAAQ;IAAG,CAAC;IAE5C,MAAM,CAAU,GAAG,GAAG,OAAO,CAAC;IAC9B,MAAM,CAAU,GAAG,GAAG,OAAO,CAAC;IAC9B,MAAM,CAAU,IAAI,GAAG,QAAQ,CAAC;;AALlC,wBAMC"}
|
package/lib/e2e/enum/Swap.d.ts
CHANGED
@@ -3,7 +3,8 @@ export declare class Provider {
|
|
3
3
|
readonly uiName: string;
|
4
4
|
readonly kyc: boolean;
|
5
5
|
readonly isNative: boolean;
|
6
|
-
|
6
|
+
readonly availableOnLns: boolean;
|
7
|
+
constructor(name: string, uiName: string, kyc: boolean, isNative: boolean, availableOnLns: boolean);
|
7
8
|
static readonly CHANGELLY: Provider;
|
8
9
|
static readonly EXODUS: Provider;
|
9
10
|
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;aACjB,cAAc,EAAE,OAAO;gBAJvB,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,MAAM,EACd,GAAG,EAAE,OAAO,EACZ,QAAQ,EAAE,OAAO,EACjB,cAAc,EAAE,OAAO;IAEzC,MAAM,CAAC,QAAQ,CAAC,SAAS,WAA6D;IACtF,MAAM,CAAC,QAAQ,CAAC,MAAM,WAAuD;IAC7E,MAAM,CAAC,QAAQ,CAAC,QAAQ,WAAwD;IAChF,MAAM,CAAC,QAAQ,CAAC,QAAQ,WAA4D;IACpF,MAAM,CAAC,QAAQ,CAAC,OAAO,WAAyD;IAChF,MAAM,CAAC,QAAQ,CAAC,SAAS,WAA6D;IACtF,MAAM,CAAC,QAAQ,CAAC,OAAO,WAA2D;IAClF,MAAM,CAAC,QAAQ,CAAC,IAAI,WAAqD;IACzE,MAAM,CAAC,QAAQ,CAAC,GAAG,WAAiD;IAEpE,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,21 +6,23 @@ class Provider {
|
|
6
6
|
uiName;
|
7
7
|
kyc;
|
8
8
|
isNative;
|
9
|
-
|
9
|
+
availableOnLns;
|
10
|
+
constructor(name, uiName, kyc, isNative, availableOnLns) {
|
10
11
|
this.name = name;
|
11
12
|
this.uiName = uiName;
|
12
13
|
this.kyc = kyc;
|
13
14
|
this.isNative = isNative;
|
15
|
+
this.availableOnLns = availableOnLns;
|
14
16
|
}
|
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);
|
17
|
+
static CHANGELLY = new Provider("changelly", "Changelly", false, true, true);
|
18
|
+
static EXODUS = new Provider("exodus", "Exodus", false, true, true);
|
19
|
+
static ONE_INCH = new Provider("oneinch", "1inch", false, false, true);
|
20
|
+
static PARASWAP = new Provider("paraswap", "Paraswap", false, false, true);
|
21
|
+
static MOONPAY = new Provider("moonpay", "MoonPay", true, false, true);
|
22
|
+
static THORCHAIN = new Provider("thorswap", "THORChain", false, true, false);
|
23
|
+
static UNISWAP = new Provider("uniswap", "Uniswap", false, false, false);
|
24
|
+
static LIFI = new Provider("lifi", "LI.FI", false, true, false);
|
25
|
+
static CIC = new Provider("cic", "CIC", false, true, true);
|
24
26
|
static getNameByUiName(uiName) {
|
25
27
|
const provider = Object.values(Provider).find(p => p.uiName === uiName);
|
26
28
|
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;IACA;IALlB,YACkB,IAAY,EACZ,MAAc,EACd,GAAY,EACZ,QAAiB,EACjB,cAAuB;QAJvB,SAAI,GAAJ,IAAI,CAAQ;QACZ,WAAM,GAAN,MAAM,CAAQ;QACd,QAAG,GAAH,GAAG,CAAS;QACZ,aAAQ,GAAR,QAAQ,CAAS;QACjB,mBAAc,GAAd,cAAc,CAAS;IACtC,CAAC;IACJ,MAAM,CAAU,SAAS,GAAG,IAAI,QAAQ,CAAC,WAAW,EAAE,WAAW,EAAE,KAAK,EAAE,IAAI,EAAE,IAA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H,4BAsBC;AAED,IAAY,IAGX;AAHD,WAAY,IAAI;IACd,uBAAe,CAAA;IACf,uBAAe,CAAA;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;AAWpD,wBAAsB,WAAW,CAAC,EAAE,EAAE,WAAW,iBA2BhD;AAED,wBAAsB,eAAe,kBAoCpC"}
|
@@ -7,42 +7,71 @@ 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");
|
10
11
|
async function sendCardano(tx) {
|
12
|
+
const isNanoS = process.env.SPECULOS_DEVICE === Device_1.Device.LNS;
|
11
13
|
await (0, speculos_1.waitFor)(DeviceLabels_1.DeviceLabels.NEW_ORDINARY);
|
12
|
-
await (0, speculos_1.pressBoth)();
|
13
|
-
|
14
|
-
|
14
|
+
await (isNanoS ? (0, speculos_1.pressRightButton)() : (0, speculos_1.pressBoth)());
|
15
|
+
if (isNanoS) {
|
16
|
+
await (0, speculos_1.waitFor)(DeviceLabels_1.DeviceLabels.SEND_TO_ADDRESS);
|
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
|
+
}
|
15
23
|
const events = await (0, speculos_1.pressUntilTextFound)(DeviceLabels_1.DeviceLabels.SEND);
|
16
|
-
|
17
|
-
|
24
|
+
if (!isNanoS) {
|
25
|
+
const isAmountCorrect = (0, speculos_1.containsSubstringInEvent)(tx.amount, events);
|
26
|
+
(0, expect_1.default)(isAmountCorrect).toBeTruthy();
|
27
|
+
}
|
18
28
|
await (0, speculos_1.pressBoth)();
|
19
29
|
await (0, speculos_1.waitFor)(DeviceLabels_1.DeviceLabels.TRANSACTION_FEE);
|
20
30
|
await (0, speculos_1.pressBoth)();
|
21
31
|
await (0, speculos_1.waitFor)(DeviceLabels_1.DeviceLabels.CONFIRM_TRANSACTION);
|
22
|
-
|
23
|
-
|
24
|
-
|
32
|
+
if (isNanoS) {
|
33
|
+
await (0, speculos_1.pressRightButton)();
|
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
|
+
}
|
25
40
|
}
|
26
41
|
exports.sendCardano = sendCardano;
|
27
42
|
async function delegateCardano() {
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
43
|
+
const commonSteps = [
|
44
|
+
{ label: DeviceLabels_1.DeviceLabels.NEW_ORDINARY, action: "both" },
|
45
|
+
{ label: DeviceLabels_1.DeviceLabels.TRANSACTION_FEE, action: "both" },
|
46
|
+
{ label: DeviceLabels_1.DeviceLabels.REGISTER, action: "both" },
|
47
|
+
{ label: DeviceLabels_1.DeviceLabels.STAKE_KEY, action: "both" },
|
48
|
+
{ label: DeviceLabels_1.DeviceLabels.CONFIRM, action: "both" },
|
49
|
+
{ label: DeviceLabels_1.DeviceLabels.DELEGATE_STAKE, action: "both" },
|
50
|
+
{ label: DeviceLabels_1.DeviceLabels.STAKE_KEY, action: "both" },
|
51
|
+
{ label: DeviceLabels_1.DeviceLabels.CONFIRM, action: "both" },
|
52
|
+
{ label: DeviceLabels_1.DeviceLabels.CONFIRM, action: "both" },
|
53
|
+
];
|
54
|
+
const LNSSpecificSteps = [
|
55
|
+
{ label: DeviceLabels_1.DeviceLabels.NEW_ORDINARY, action: "right" },
|
56
|
+
{ label: DeviceLabels_1.DeviceLabels.TRANSACTION_FEE, action: "both" },
|
57
|
+
{ label: DeviceLabels_1.DeviceLabels.REGISTER, action: "both" },
|
58
|
+
{ label: DeviceLabels_1.DeviceLabels.STAKE_KEY, action: "both" },
|
59
|
+
{ label: DeviceLabels_1.DeviceLabels.CONFIRM, action: "right" },
|
60
|
+
{ label: DeviceLabels_1.DeviceLabels.DELEGATE_STAKE, action: "both" },
|
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
|
+
}
|
46
75
|
}
|
47
76
|
exports.delegateCardano = delegateCardano;
|
48
77
|
//# 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
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CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE;QACjD,EAAE,KAAK,EAAE,2BAAY,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE;QAChD,EAAE,KAAK,EAAE,2BAAY,CAAC,cAAc,EAAE,MAAM,EAAE,MAAM,EAAE;QACtD,EAAE,KAAK,EAAE,2BAAY,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE;QACjD,EAAE,KAAK,EAAE,2BAAY,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE;QAChD,EAAE,KAAK,EAAE,2BAAY,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE;KACjD,CAAC;IAEF,MAAM,cAAc,GAClB,OAAO,CAAC,GAAG,CAAC,eAAe,KAAK,eAAM,CAAC,GAAG,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC,WAAW,CAAC;IAE9E,KAAK,MAAM,IAAI,IAAI,cAAc,EAAE;QACjC,MAAM,IAAA,kBAAO,EAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAC1B,IAAI,IAAI,CAAC,MAAM,KAAK,MAAM,EAAE;YAC1B,MAAM,IAAA,oBAAS,GAAE,CAAC;SACnB;aAAM,IAAI,IAAI,CAAC,MAAM,KAAK,OAAO,EAAE;YAClC,MAAM,IAAA,2BAAgB,GAAE,CAAC;SAC1B;KACF;AACH,CAAC;AApCD,0CAoCC"}
|
@@ -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;AAKpE,wBAAsB,OAAO,CAAC,EAAE,EAAE,WAAW,iBAa5C;AAED,wBAAsB,UAAU,CAAC,EAAE,EAAE,cAAc,iBAMlD"}
|
package/lib/e2e/families/evm.js
CHANGED
@@ -7,11 +7,12 @@ 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");
|
10
11
|
async function sendEVM(tx) {
|
11
12
|
const events = await (0, speculos_1.pressUntilTextFound)(DeviceLabels_1.DeviceLabels.ACCEPT);
|
12
13
|
const isAmountCorrect = (0, speculos_1.containsSubstringInEvent)(tx.amount, events);
|
13
14
|
(0, expect_1.default)(isAmountCorrect).toBeTruthy();
|
14
|
-
if (tx.accountToCredit.ensName) {
|
15
|
+
if (tx.accountToCredit.ensName && process.env.SPECULOS_DEVICE !== Device_1.Device.LNS) {
|
15
16
|
const isENSNameCorrect = (0, speculos_1.containsSubstringInEvent)(tx.accountToCredit.ensName, events);
|
16
17
|
(0, expect_1.default)(isENSNameCorrect).toBeTruthy();
|
17
18
|
}
|
@@ -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;AACpD,2CAAwC;AAEjC,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,IAAI,OAAO,CAAC,GAAG,CAAC,eAAe,KAAK,eAAM,CAAC,GAAG,EAAE;QAC5E,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":"AAIA,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAEpD,wBAAsB,cAAc,kBAInC;AAED,wBAAsB,UAAU,CAAC,EAAE,EAAE,WAAW,iBAU/C"}
|
@@ -7,6 +7,7 @@ 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");
|
10
11
|
async function delegateSolana() {
|
11
12
|
await (0, speculos_1.waitFor)(DeviceLabels_1.DeviceLabels.DELEGATE_FROM);
|
12
13
|
await (0, speculos_1.pressUntilTextFound)(DeviceLabels_1.DeviceLabels.APPROVE);
|
@@ -17,8 +18,10 @@ async function sendSolana(tx) {
|
|
17
18
|
const events = await (0, speculos_1.pressUntilTextFound)(DeviceLabels_1.DeviceLabels.APPROVE);
|
18
19
|
const isAmountCorrect = (0, speculos_1.containsSubstringInEvent)(tx.amount, events);
|
19
20
|
(0, expect_1.default)(isAmountCorrect).toBeTruthy();
|
20
|
-
|
21
|
-
|
21
|
+
if (process.env.SPECULOS_DEVICE !== Device_1.Device.LNS) {
|
22
|
+
const isAddressCorrect = (0, speculos_1.containsSubstringInEvent)(tx.accountToCredit.address, events);
|
23
|
+
(0, expect_1.default)(isAddressCorrect).toBeTruthy();
|
24
|
+
}
|
22
25
|
await (0, speculos_1.pressBoth)();
|
23
26
|
}
|
24
27
|
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;AACpD,2CAAwC;AAGjC,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,IAAI,OAAO,CAAC,GAAG,CAAC,eAAe,KAAK,eAAM,CAAC,GAAG,EAAE;QAC9C,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;AAVD,gCAUC"}
|
package/lib/e2e/speculos.d.ts
CHANGED
@@ -24,6 +24,7 @@ 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;
|
27
28
|
type Specs = {
|
28
29
|
[key: string]: Spec;
|
29
30
|
};
|
@@ -38,6 +39,7 @@ export declare function stopSpeculos(deviceId: string | undefined): Promise<void
|
|
38
39
|
export declare function waitFor(text: string, maxAttempts?: number): Promise<string[]>;
|
39
40
|
export declare function pressBoth(): Promise<void>;
|
40
41
|
export declare function pressUntilTextFound(targetText: string, maxAttempts?: number): Promise<string[]>;
|
42
|
+
export declare function pressRightButton(): Promise<void>;
|
41
43
|
export declare function containsSubstringInEvent(targetString: string, events: string[]): boolean;
|
42
44
|
export declare function takeScreenshot(port?: number): Promise<Buffer | undefined>;
|
43
45
|
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,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAK9D,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;
|
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,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAK9D,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAmBzC,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACnE,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAErC,MAAM,MAAM,IAAI,GAAG;IACjB,QAAQ,CAAC,EAAE,cAAc,CAAC;IAC1B,QAAQ,EAAE;QACR,KAAK,EAAE,aAAa,CAAC;QACrB,OAAO,EAAE,MAAM,CAAC;KACjB,CAAC;IACF,kBAAkB;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,YAAY,CAAC,EAAE,UAAU,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EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAU/E;AAED,wBAAsB,cAAc,CAAC,EAAE,EAAE,MAAM,oBAE9C;AAED,wBAAsB,sBAAsB,kBAa3C;AAED,wBAAsB,kBAAkB,kBASvC;AAED,wBAAsB,kBAAkB,kBAGvC;AAED,wBAAsB,oBAAoB,kBAKzC;AAED,wBAAsB,wBAAwB,CAAC,OAAO,EAAE,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAqBxF;AAED,wBAAsB,mBAAmB,CAAC,EAAE,EAAE,WAAW,iBA2CxD;AAED,wBAAsB,sBAAsB,CAAC,EAAE,EAAE,cAAc,iBAS9D;AAED,wBAAsB,yBAAyB,CAAC,iBAAiB,EAAE,QAAQ,iBA6B1E;AAED,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.pressUntilTextFound = exports.pressBoth = exports.waitFor = exports.stopSpeculos = exports.startSpeculos = exports.specs = exports.setExchangeDependencies = void 0;
|
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.pressRightButton = exports.pressUntilTextFound = exports.pressBoth = exports.waitFor = exports.stopSpeculos = exports.startSpeculos = exports.specs = exports.getSpeculosModel = 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,6 +13,7 @@ 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");
|
16
17
|
const Currency_1 = require("./enum/Currency");
|
17
18
|
const expect_1 = __importDefault(require("expect"));
|
18
19
|
const bitcoin_1 = require("./families/bitcoin");
|
@@ -40,11 +41,24 @@ function setExchangeDependencies(dependencies) {
|
|
40
41
|
exports.specs["Exchange"].dependencies = Array.from(map.values());
|
41
42
|
}
|
42
43
|
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;
|
43
57
|
exports.specs = {
|
44
58
|
Bitcoin: {
|
45
59
|
currency: (0, currencies_1.getCryptoCurrencyById)("bitcoin"),
|
46
60
|
appQuery: {
|
47
|
-
model:
|
61
|
+
model: getSpeculosModel(),
|
48
62
|
appName: "Bitcoin",
|
49
63
|
},
|
50
64
|
dependency: "",
|
@@ -52,21 +66,21 @@ exports.specs = {
|
|
52
66
|
Aptos: {
|
53
67
|
currency: (0, currencies_1.getCryptoCurrencyById)("aptos"),
|
54
68
|
appQuery: {
|
55
|
-
model:
|
69
|
+
model: getSpeculosModel(),
|
56
70
|
appName: "Aptos",
|
57
71
|
},
|
58
72
|
dependency: "",
|
59
73
|
},
|
60
74
|
Exchange: {
|
61
75
|
appQuery: {
|
62
|
-
model:
|
76
|
+
model: getSpeculosModel(),
|
63
77
|
appName: "Exchange",
|
64
78
|
},
|
65
79
|
dependencies: [],
|
66
80
|
},
|
67
81
|
LedgerSync: {
|
68
82
|
appQuery: {
|
69
|
-
model:
|
83
|
+
model: getSpeculosModel(),
|
70
84
|
appName: "Ledger Sync",
|
71
85
|
},
|
72
86
|
dependency: "",
|
@@ -74,7 +88,7 @@ exports.specs = {
|
|
74
88
|
Dogecoin: {
|
75
89
|
currency: (0, currencies_1.getCryptoCurrencyById)("dogecoin"),
|
76
90
|
appQuery: {
|
77
|
-
model:
|
91
|
+
model: getSpeculosModel(),
|
78
92
|
appName: "Dogecoin",
|
79
93
|
},
|
80
94
|
dependency: "",
|
@@ -82,7 +96,7 @@ exports.specs = {
|
|
82
96
|
Ethereum: {
|
83
97
|
currency: (0, currencies_1.getCryptoCurrencyById)("ethereum"),
|
84
98
|
appQuery: {
|
85
|
-
model:
|
99
|
+
model: getSpeculosModel(),
|
86
100
|
appName: "Ethereum",
|
87
101
|
},
|
88
102
|
dependency: "",
|
@@ -90,7 +104,7 @@ exports.specs = {
|
|
90
104
|
Ethereum_Holesky: {
|
91
105
|
currency: (0, currencies_1.getCryptoCurrencyById)("ethereum_holesky"),
|
92
106
|
appQuery: {
|
93
|
-
model:
|
107
|
+
model: getSpeculosModel(),
|
94
108
|
appName: "Ethereum",
|
95
109
|
},
|
96
110
|
dependency: "",
|
@@ -98,7 +112,7 @@ exports.specs = {
|
|
98
112
|
Ethereum_Sepolia: {
|
99
113
|
currency: (0, currencies_1.getCryptoCurrencyById)("ethereum_sepolia"),
|
100
114
|
appQuery: {
|
101
|
-
model:
|
115
|
+
model: getSpeculosModel(),
|
102
116
|
appName: "Ethereum",
|
103
117
|
},
|
104
118
|
dependency: "",
|
@@ -106,7 +120,7 @@ exports.specs = {
|
|
106
120
|
Ethereum_Classic: {
|
107
121
|
currency: (0, currencies_1.getCryptoCurrencyById)("ethereum_classic"),
|
108
122
|
appQuery: {
|
109
|
-
model:
|
123
|
+
model: getSpeculosModel(),
|
110
124
|
appName: "Ethereum Classic",
|
111
125
|
},
|
112
126
|
dependency: "Ethereum",
|
@@ -114,7 +128,7 @@ exports.specs = {
|
|
114
128
|
Bitcoin_Testnet: {
|
115
129
|
currency: (0, currencies_1.getCryptoCurrencyById)("bitcoin_testnet"),
|
116
130
|
appQuery: {
|
117
|
-
model:
|
131
|
+
model: getSpeculosModel(),
|
118
132
|
appName: "Bitcoin Test",
|
119
133
|
},
|
120
134
|
dependency: "",
|
@@ -122,7 +136,7 @@ exports.specs = {
|
|
122
136
|
Solana: {
|
123
137
|
currency: (0, currencies_1.getCryptoCurrencyById)("solana"),
|
124
138
|
appQuery: {
|
125
|
-
model:
|
139
|
+
model: getSpeculosModel(),
|
126
140
|
appName: "Solana",
|
127
141
|
},
|
128
142
|
dependency: "",
|
@@ -130,7 +144,7 @@ exports.specs = {
|
|
130
144
|
Cardano: {
|
131
145
|
currency: (0, currencies_1.getCryptoCurrencyById)("cardano"),
|
132
146
|
appQuery: {
|
133
|
-
model:
|
147
|
+
model: getSpeculosModel(),
|
134
148
|
appName: "CardanoADA",
|
135
149
|
},
|
136
150
|
dependency: "",
|
@@ -138,7 +152,7 @@ exports.specs = {
|
|
138
152
|
Polkadot: {
|
139
153
|
currency: (0, currencies_1.getCryptoCurrencyById)("polkadot"),
|
140
154
|
appQuery: {
|
141
|
-
model:
|
155
|
+
model: getSpeculosModel(),
|
142
156
|
appName: "Polkadot",
|
143
157
|
},
|
144
158
|
dependency: "",
|
@@ -146,7 +160,7 @@ exports.specs = {
|
|
146
160
|
Tron: {
|
147
161
|
currency: (0, currencies_1.getCryptoCurrencyById)("tron"),
|
148
162
|
appQuery: {
|
149
|
-
model:
|
163
|
+
model: getSpeculosModel(),
|
150
164
|
appName: "Tron",
|
151
165
|
},
|
152
166
|
dependency: "",
|
@@ -154,7 +168,7 @@ exports.specs = {
|
|
154
168
|
XRP: {
|
155
169
|
currency: (0, currencies_1.getCryptoCurrencyById)("ripple"),
|
156
170
|
appQuery: {
|
157
|
-
model:
|
171
|
+
model: getSpeculosModel(),
|
158
172
|
appName: "XRP",
|
159
173
|
},
|
160
174
|
dependency: "",
|
@@ -162,7 +176,7 @@ exports.specs = {
|
|
162
176
|
Stellar: {
|
163
177
|
currency: (0, currencies_1.getCryptoCurrencyById)("stellar"),
|
164
178
|
appQuery: {
|
165
|
-
model:
|
179
|
+
model: getSpeculosModel(),
|
166
180
|
appName: "Stellar",
|
167
181
|
},
|
168
182
|
dependency: "",
|
@@ -170,7 +184,7 @@ exports.specs = {
|
|
170
184
|
Bitcoin_Cash: {
|
171
185
|
currency: (0, currencies_1.getCryptoCurrencyById)("bitcoin_cash"),
|
172
186
|
appQuery: {
|
173
|
-
model:
|
187
|
+
model: getSpeculosModel(),
|
174
188
|
appName: "Bitcoin Cash",
|
175
189
|
},
|
176
190
|
dependency: "",
|
@@ -178,7 +192,7 @@ exports.specs = {
|
|
178
192
|
Algorand: {
|
179
193
|
currency: (0, currencies_1.getCryptoCurrencyById)("algorand"),
|
180
194
|
appQuery: {
|
181
|
-
model:
|
195
|
+
model: getSpeculosModel(),
|
182
196
|
appName: "Algorand",
|
183
197
|
},
|
184
198
|
dependency: "",
|
@@ -186,7 +200,7 @@ exports.specs = {
|
|
186
200
|
Cosmos: {
|
187
201
|
currency: (0, currencies_1.getCryptoCurrencyById)("cosmos"),
|
188
202
|
appQuery: {
|
189
|
-
model:
|
203
|
+
model: getSpeculosModel(),
|
190
204
|
appName: "Cosmos",
|
191
205
|
},
|
192
206
|
dependency: "",
|
@@ -194,7 +208,7 @@ exports.specs = {
|
|
194
208
|
Tezos: {
|
195
209
|
currency: (0, currencies_1.getCryptoCurrencyById)("tezos"),
|
196
210
|
appQuery: {
|
197
|
-
model:
|
211
|
+
model: getSpeculosModel(),
|
198
212
|
appName: "TezosWallet",
|
199
213
|
},
|
200
214
|
dependency: "",
|
@@ -202,7 +216,7 @@ exports.specs = {
|
|
202
216
|
Polygon: {
|
203
217
|
currency: (0, currencies_1.getCryptoCurrencyById)("polygon"),
|
204
218
|
appQuery: {
|
205
|
-
model:
|
219
|
+
model: getSpeculosModel(),
|
206
220
|
appName: "Ethereum",
|
207
221
|
},
|
208
222
|
dependency: "",
|
@@ -210,7 +224,7 @@ exports.specs = {
|
|
210
224
|
Binance_Smart_Chain: {
|
211
225
|
currency: (0, currencies_1.getCryptoCurrencyById)("bsc"),
|
212
226
|
appQuery: {
|
213
|
-
model:
|
227
|
+
model: getSpeculosModel(),
|
214
228
|
appName: "Ethereum",
|
215
229
|
},
|
216
230
|
dependency: "",
|
@@ -218,7 +232,7 @@ exports.specs = {
|
|
218
232
|
Ton: {
|
219
233
|
currency: (0, currencies_1.getCryptoCurrencyById)("ton"),
|
220
234
|
appQuery: {
|
221
|
-
model:
|
235
|
+
model: getSpeculosModel(),
|
222
236
|
appName: "TON",
|
223
237
|
},
|
224
238
|
dependency: "",
|
@@ -226,7 +240,7 @@ exports.specs = {
|
|
226
240
|
Near: {
|
227
241
|
currency: (0, currencies_1.getCryptoCurrencyById)("near"),
|
228
242
|
appQuery: {
|
229
|
-
model:
|
243
|
+
model: getSpeculosModel(),
|
230
244
|
appName: "NEAR",
|
231
245
|
},
|
232
246
|
dependency: "",
|
@@ -234,7 +248,7 @@ exports.specs = {
|
|
234
248
|
Multivers_X: {
|
235
249
|
currency: (0, currencies_1.getCryptoCurrencyById)("elrond"),
|
236
250
|
appQuery: {
|
237
|
-
model:
|
251
|
+
model: getSpeculosModel(),
|
238
252
|
appName: "MultiversX",
|
239
253
|
},
|
240
254
|
dependency: "",
|
@@ -242,7 +256,7 @@ exports.specs = {
|
|
242
256
|
Osmosis: {
|
243
257
|
currency: (0, currencies_1.getCryptoCurrencyById)("osmo"),
|
244
258
|
appQuery: {
|
245
|
-
model:
|
259
|
+
model: getSpeculosModel(),
|
246
260
|
appName: "Cosmos",
|
247
261
|
},
|
248
262
|
dependency: "",
|
@@ -250,7 +264,7 @@ exports.specs = {
|
|
250
264
|
Injective: {
|
251
265
|
currency: (0, currencies_1.getCryptoCurrencyById)("injective"),
|
252
266
|
appQuery: {
|
253
|
-
model:
|
267
|
+
model: getSpeculosModel(),
|
254
268
|
appName: "Cosmos",
|
255
269
|
},
|
256
270
|
dependency: "",
|
@@ -258,7 +272,7 @@ exports.specs = {
|
|
258
272
|
Celo: {
|
259
273
|
currency: (0, currencies_1.getCryptoCurrencyById)("celo"),
|
260
274
|
appQuery: {
|
261
|
-
model:
|
275
|
+
model: getSpeculosModel(),
|
262
276
|
appName: "Celo",
|
263
277
|
},
|
264
278
|
dependency: "",
|
@@ -266,7 +280,7 @@ exports.specs = {
|
|
266
280
|
Litecoin: {
|
267
281
|
currency: (0, currencies_1.getCryptoCurrencyById)("litecoin"),
|
268
282
|
appQuery: {
|
269
|
-
model:
|
283
|
+
model: getSpeculosModel(),
|
270
284
|
appName: "Litecoin",
|
271
285
|
},
|
272
286
|
dependency: "",
|
@@ -362,7 +376,7 @@ async function pressUntilTextFound(targetText, maxAttempts = 15) {
|
|
362
376
|
if (texts.includes(targetText)) {
|
363
377
|
return await fetchAllEvents(speculosApiPort);
|
364
378
|
}
|
365
|
-
await pressRightButton(
|
379
|
+
await pressRightButton();
|
366
380
|
await waitForTimeOut(200);
|
367
381
|
}
|
368
382
|
throw new Error(`ElementNotFoundException: Element with text "${targetText}" not found on speculos screen`);
|
@@ -376,11 +390,13 @@ async function fetchAllEvents(speculosApiPort) {
|
|
376
390
|
const response = await axios_1.default.get(`http://127.0.0.1:${speculosApiPort}/events?stream=false¤tscreenonly=false`);
|
377
391
|
return response.data.events.map(event => event.text);
|
378
392
|
}
|
379
|
-
async function pressRightButton(
|
393
|
+
async function pressRightButton() {
|
394
|
+
const speculosApiPort = (0, live_env_1.getEnv)("SPECULOS_API_PORT");
|
380
395
|
await axios_1.default.post(`http://127.0.0.1:${speculosApiPort}/button/right`, {
|
381
396
|
action: "press-and-release",
|
382
397
|
});
|
383
398
|
}
|
399
|
+
exports.pressRightButton = pressRightButton;
|
384
400
|
function containsSubstringInEvent(targetString, events) {
|
385
401
|
const concatenatedEvents = events.join("");
|
386
402
|
let result = concatenatedEvents.includes(targetString);
|