@ledgerhq/live-common 34.38.2-nightly.0 → 34.39.0-nightly.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.
Files changed (118) hide show
  1. package/lib/bridge/cache.d.ts.map +1 -1
  2. package/lib/bridge/cache.js +2 -2
  3. package/lib/bridge/cache.js.map +1 -1
  4. package/lib/e2e/index.d.ts +0 -3
  5. package/lib/e2e/index.d.ts.map +1 -1
  6. package/lib/env.react.d.ts +1 -1
  7. package/lib/env.react.d.ts.map +1 -1
  8. package/lib/featureFlags/defaultFeatures.d.ts.map +1 -1
  9. package/lib/featureFlags/defaultFeatures.js +0 -11
  10. package/lib/featureFlags/defaultFeatures.js.map +1 -1
  11. package/lib/featureFlags/useFeature.d.ts +1 -1
  12. package/lib/featureFlags/useFeature.d.ts.map +1 -1
  13. package/lib/hw/connectAppEventMapper.d.ts.map +1 -1
  14. package/lib/hw/connectAppEventMapper.js +1 -3
  15. package/lib/hw/connectAppEventMapper.js.map +1 -1
  16. package/lib/wallet-api/types.d.ts +1 -1
  17. package/lib/wallet-api/types.d.ts.map +1 -1
  18. package/lib/wallet-api/useDappLogic.d.ts.map +1 -1
  19. package/lib/wallet-api/useDappLogic.js +24 -3
  20. package/lib/wallet-api/useDappLogic.js.map +1 -1
  21. package/lib-es/bridge/cache.d.ts.map +1 -1
  22. package/lib-es/bridge/cache.js +2 -2
  23. package/lib-es/bridge/cache.js.map +1 -1
  24. package/lib-es/e2e/index.d.ts +0 -3
  25. package/lib-es/e2e/index.d.ts.map +1 -1
  26. package/lib-es/env.react.d.ts +1 -1
  27. package/lib-es/env.react.d.ts.map +1 -1
  28. package/lib-es/featureFlags/defaultFeatures.d.ts.map +1 -1
  29. package/lib-es/featureFlags/defaultFeatures.js +0 -11
  30. package/lib-es/featureFlags/defaultFeatures.js.map +1 -1
  31. package/lib-es/featureFlags/useFeature.d.ts +1 -1
  32. package/lib-es/featureFlags/useFeature.d.ts.map +1 -1
  33. package/lib-es/hw/connectAppEventMapper.d.ts.map +1 -1
  34. package/lib-es/hw/connectAppEventMapper.js +1 -3
  35. package/lib-es/hw/connectAppEventMapper.js.map +1 -1
  36. package/lib-es/wallet-api/types.d.ts +1 -1
  37. package/lib-es/wallet-api/types.d.ts.map +1 -1
  38. package/lib-es/wallet-api/useDappLogic.d.ts.map +1 -1
  39. package/lib-es/wallet-api/useDappLogic.js +24 -3
  40. package/lib-es/wallet-api/useDappLogic.js.map +1 -1
  41. package/package.json +48 -48
  42. package/src/bridge/cache.ts +2 -5
  43. package/src/featureFlags/defaultFeatures.ts +0 -11
  44. package/src/hw/connectAppEventMapper.ts +1 -3
  45. package/src/wallet-api/types.ts +1 -1
  46. package/src/wallet-api/useDappLogic.ts +27 -4
  47. package/lib/bridge/cache.test.d.ts +0 -2
  48. package/lib/bridge/cache.test.d.ts.map +0 -1
  49. package/lib/bridge/cache.test.js +0 -63
  50. package/lib/bridge/cache.test.js.map +0 -1
  51. package/lib/hooks/useAppVersionBlockCheck.d.ts +0 -11
  52. package/lib/hooks/useAppVersionBlockCheck.d.ts.map +0 -1
  53. package/lib/hooks/useAppVersionBlockCheck.js +0 -32
  54. package/lib/hooks/useAppVersionBlockCheck.js.map +0 -1
  55. package/lib/hooks/useAppVersionBlockCheck.test.d.ts +0 -2
  56. package/lib/hooks/useAppVersionBlockCheck.test.d.ts.map +0 -1
  57. package/lib/hooks/useAppVersionBlockCheck.test.js +0 -133
  58. package/lib/hooks/useAppVersionBlockCheck.test.js.map +0 -1
  59. package/lib/modularDrawer/__test__/useModularDrawerVisibility.test.d.ts +0 -2
  60. package/lib/modularDrawer/__test__/useModularDrawerVisibility.test.d.ts.map +0 -1
  61. package/lib/modularDrawer/__test__/useModularDrawerVisibility.test.js +0 -107
  62. package/lib/modularDrawer/__test__/useModularDrawerVisibility.test.js.map +0 -1
  63. package/lib/modularDrawer/enums.d.ts +0 -8
  64. package/lib/modularDrawer/enums.d.ts.map +0 -1
  65. package/lib/modularDrawer/enums.js +0 -12
  66. package/lib/modularDrawer/enums.js.map +0 -1
  67. package/lib/modularDrawer/useModularDrawerVisibility.d.ts +0 -9
  68. package/lib/modularDrawer/useModularDrawerVisibility.d.ts.map +0 -1
  69. package/lib/modularDrawer/useModularDrawerVisibility.js +0 -18
  70. package/lib/modularDrawer/useModularDrawerVisibility.js.map +0 -1
  71. package/lib/wallet-api/utils/txTrackingHelper.d.ts +0 -3
  72. package/lib/wallet-api/utils/txTrackingHelper.d.ts.map +0 -1
  73. package/lib/wallet-api/utils/txTrackingHelper.js +0 -16
  74. package/lib/wallet-api/utils/txTrackingHelper.js.map +0 -1
  75. package/lib/wallet-api/utils/txTrackingHelper.test.d.ts +0 -2
  76. package/lib/wallet-api/utils/txTrackingHelper.test.d.ts.map +0 -1
  77. package/lib/wallet-api/utils/txTrackingHelper.test.js +0 -70
  78. package/lib/wallet-api/utils/txTrackingHelper.test.js.map +0 -1
  79. package/lib-es/bridge/cache.test.d.ts +0 -2
  80. package/lib-es/bridge/cache.test.d.ts.map +0 -1
  81. package/lib-es/bridge/cache.test.js +0 -38
  82. package/lib-es/bridge/cache.test.js.map +0 -1
  83. package/lib-es/hooks/useAppVersionBlockCheck.d.ts +0 -11
  84. package/lib-es/hooks/useAppVersionBlockCheck.d.ts.map +0 -1
  85. package/lib-es/hooks/useAppVersionBlockCheck.js +0 -25
  86. package/lib-es/hooks/useAppVersionBlockCheck.js.map +0 -1
  87. package/lib-es/hooks/useAppVersionBlockCheck.test.d.ts +0 -2
  88. package/lib-es/hooks/useAppVersionBlockCheck.test.d.ts.map +0 -1
  89. package/lib-es/hooks/useAppVersionBlockCheck.test.js +0 -131
  90. package/lib-es/hooks/useAppVersionBlockCheck.test.js.map +0 -1
  91. package/lib-es/modularDrawer/__test__/useModularDrawerVisibility.test.d.ts +0 -2
  92. package/lib-es/modularDrawer/__test__/useModularDrawerVisibility.test.d.ts.map +0 -1
  93. package/lib-es/modularDrawer/__test__/useModularDrawerVisibility.test.js +0 -105
  94. package/lib-es/modularDrawer/__test__/useModularDrawerVisibility.test.js.map +0 -1
  95. package/lib-es/modularDrawer/enums.d.ts +0 -8
  96. package/lib-es/modularDrawer/enums.d.ts.map +0 -1
  97. package/lib-es/modularDrawer/enums.js +0 -9
  98. package/lib-es/modularDrawer/enums.js.map +0 -1
  99. package/lib-es/modularDrawer/useModularDrawerVisibility.d.ts +0 -9
  100. package/lib-es/modularDrawer/useModularDrawerVisibility.d.ts.map +0 -1
  101. package/lib-es/modularDrawer/useModularDrawerVisibility.js +0 -14
  102. package/lib-es/modularDrawer/useModularDrawerVisibility.js.map +0 -1
  103. package/lib-es/wallet-api/utils/txTrackingHelper.d.ts +0 -3
  104. package/lib-es/wallet-api/utils/txTrackingHelper.d.ts.map +0 -1
  105. package/lib-es/wallet-api/utils/txTrackingHelper.js +0 -12
  106. package/lib-es/wallet-api/utils/txTrackingHelper.js.map +0 -1
  107. package/lib-es/wallet-api/utils/txTrackingHelper.test.d.ts +0 -2
  108. package/lib-es/wallet-api/utils/txTrackingHelper.test.d.ts.map +0 -1
  109. package/lib-es/wallet-api/utils/txTrackingHelper.test.js +0 -68
  110. package/lib-es/wallet-api/utils/txTrackingHelper.test.js.map +0 -1
  111. package/src/bridge/cache.test.ts +0 -46
  112. package/src/hooks/useAppVersionBlockCheck.test.ts +0 -134
  113. package/src/hooks/useAppVersionBlockCheck.ts +0 -65
  114. package/src/modularDrawer/__test__/useModularDrawerVisibility.test.ts +0 -149
  115. package/src/modularDrawer/enums.ts +0 -7
  116. package/src/modularDrawer/useModularDrawerVisibility.ts +0 -25
  117. package/src/wallet-api/utils/txTrackingHelper.test.ts +0 -80
  118. package/src/wallet-api/utils/txTrackingHelper.ts +0 -14
@@ -1 +0,0 @@
1
- {"version":3,"file":"cache.test.js","sourceRoot":"","sources":["../../src/bridge/cache.test.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,WAAW,MAAM,8BAA8B,CAAC;AAC5D,OAAO,EAAE,qBAAqB,EAAE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AAe,EAAE,GAAG,qBAAqB,CAAC;YAChD,QAAQ,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,OAAO,EAAE;YACjC,OAAO,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC;SACrC,CAAC,CAAC;QAEH,MAAM,eAAe,CAAC,qBAAqB,CAAC,QAAQ,CAAC,CAAC,CAAC;QACvD,MAAM,CAAC,YAAY,CAAC,CAAC,qBAAqB,CAAC,CAAC,CAAC,CAAC;QAE9C,MAAM,eAAe,CAAC,qBAAqB,CAAC,QAAQ,CAAC,EAAE,EAAE,WAAW,EAAE,IAAI,EAAE,CAAC,CAAC;QAC9E,MAAM,CAAC,YAAY,CAAC,CAAC,qBAAqB,CAAC,CAAC,CAAC,CAAC;IAChD,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -1,11 +0,0 @@
1
- import { LiveConfig } from "@ledgerhq/live-config/LiveConfig";
2
- export declare const useAppVersionBlockCheck: ({ appVersion: uncoercedAppVersion, appKey, platform, osVersion, getConfigValue, }: {
3
- appVersion: string;
4
- osVersion?: string | undefined;
5
- appKey: "llm" | "lld";
6
- platform: "ios" | "android" | "macOS" | "windows" | "linux";
7
- getConfigValue?: typeof LiveConfig.getValueByKey | undefined;
8
- }) => {
9
- shouldUpdate: boolean;
10
- };
11
- //# sourceMappingURL=useAppVersionBlockCheck.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useAppVersionBlockCheck.d.ts","sourceRoot":"","sources":["../../src/hooks/useAppVersionBlockCheck.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,kCAAkC,CAAC;AAsC9D,eAAO,MAAM,uBAAuB;gBAOtB,MAAM;;YAEV,KAAK,GAAG,KAAK;cACX,KAAK,GAAG,SAAS,GAAG,OAAO,GAAG,SAAS,GAAG,OAAO;;;;CAe5D,CAAC"}
@@ -1,25 +0,0 @@
1
- import semver from "semver";
2
- import { LiveConfig } from "@ledgerhq/live-config/LiveConfig";
3
- const checkLLmVersion = (appVersion, osVersion, platform, llmMinVersionConfig) => {
4
- if (!llmMinVersionConfig[platform]) {
5
- return false;
6
- }
7
- return llmMinVersionConfig[platform]
8
- .filter(minVersionConfig => semver.satisfies(semver.coerce(osVersion), `>=${minVersionConfig.minOsVersion}`))
9
- .reduce((acc, curr) => {
10
- return acc || semver.satisfies(appVersion, `<${curr.version}`);
11
- }, false);
12
- };
13
- export const useAppVersionBlockCheck = ({ appVersion: uncoercedAppVersion, appKey, platform, osVersion, getConfigValue = LiveConfig.getValueByKey, }) => {
14
- const llMinVersionConfig = getConfigValue("config_ll_min_version");
15
- const appVersion = semver.coerce(uncoercedAppVersion)?.version || "";
16
- let shouldUpdate = false;
17
- if (!llMinVersionConfig) {
18
- return { shouldUpdate };
19
- }
20
- if (appKey === "llm" && (platform === "android" || platform === "ios") && osVersion) {
21
- shouldUpdate = checkLLmVersion(appVersion, osVersion, platform, llMinVersionConfig[appKey]);
22
- }
23
- return { shouldUpdate };
24
- };
25
- //# sourceMappingURL=useAppVersionBlockCheck.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useAppVersionBlockCheck.js","sourceRoot":"","sources":["../../src/hooks/useAppVersionBlockCheck.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAE,UAAU,EAAE,MAAM,kCAAkC,CAAC;AAmB9D,MAAM,eAAe,GAAG,CACtB,UAAkB,EAClB,SAAiB,EACjB,QAA2B,EAC3B,mBAA8C,EAC9C,EAAE;IACF,IAAI,CAAC,mBAAmB,CAAC,QAAQ,CAAC,EAAE;QAClC,OAAO,KAAK,CAAC;KACd;IAED,OAAO,mBAAmB,CAAC,QAAQ,CAAC;SACjC,MAAM,CAAC,gBAAgB,CAAC,EAAE,CACzB,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,EAAE,KAAK,gBAAgB,CAAC,YAAY,EAAE,CAAC,CACjF;SACA,MAAM,CAAC,CAAC,GAAG,EAAE,IAAI,EAAE,EAAE;QACpB,OAAO,GAAG,IAAI,MAAM,CAAC,SAAS,CAAC,UAAU,EAAE,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC;IACjE,CAAC,EAAE,KAAK,CAAC,CAAC;AACd,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,EACtC,UAAU,EAAE,mBAAmB,EAC/B,MAAM,EACN,QAAQ,EACR,SAAS,EACT,cAAc,GAAG,UAAU,CAAC,aAAa,GAO1C,EAAE,EAAE;IACH,MAAM,kBAAkB,GAAG,cAAc,CAAC,uBAAuB,CAAC,CAAC;IACnE,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,CAAC,mBAAmB,CAAC,EAAE,OAAO,IAAI,EAAE,CAAC;IACrE,IAAI,YAAY,GAAG,KAAK,CAAC;IAEzB,IAAI,CAAC,kBAAkB,EAAE;QACvB,OAAO,EAAE,YAAY,EAAE,CAAC;KACzB;IAED,IAAI,MAAM,KAAK,KAAK,IAAI,CAAC,QAAQ,KAAK,SAAS,IAAI,QAAQ,KAAK,KAAK,CAAC,IAAI,SAAS,EAAE;QACnF,YAAY,GAAG,eAAe,CAAC,UAAU,EAAE,SAAS,EAAE,QAAQ,EAAE,kBAAkB,CAAC,MAAM,CAAC,CAAC,CAAC;KAC7F;IACD,OAAO,EAAE,YAAY,EAAE,CAAC;AAC1B,CAAC,CAAC"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=useAppVersionBlockCheck.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useAppVersionBlockCheck.test.d.ts","sourceRoot":"","sources":["../../src/hooks/useAppVersionBlockCheck.test.ts"],"names":[],"mappings":""}
@@ -1,131 +0,0 @@
1
- import { useAppVersionBlockCheck } from "./useAppVersionBlockCheck";
2
- describe("useAppVersionBlockCheck", () => {
3
- describe("LLM", () => {
4
- it("should update if current version is not compatible on android", () => {
5
- // given
6
- const getConfigValue = () => ({
7
- llm: {
8
- android: [
9
- {
10
- minOsVersion: "32",
11
- version: "2.0.3",
12
- },
13
- ],
14
- },
15
- });
16
- // when
17
- const { shouldUpdate } = useAppVersionBlockCheck({
18
- appVersion: "2.0.1",
19
- osVersion: "32",
20
- platform: "android",
21
- appKey: "llm",
22
- getConfigValue,
23
- });
24
- //then
25
- expect(shouldUpdate).toBe(true);
26
- });
27
- it("should update if current version is not compatible on ios", () => {
28
- const getConfigValue = () => ({
29
- llm: {
30
- ios: [
31
- {
32
- minOsVersion: "32",
33
- version: "2.0.3",
34
- },
35
- ],
36
- },
37
- });
38
- // when
39
- const { shouldUpdate } = useAppVersionBlockCheck({
40
- appVersion: "2.0.1",
41
- osVersion: "32",
42
- platform: "ios",
43
- appKey: "llm",
44
- getConfigValue,
45
- });
46
- //then
47
- expect(shouldUpdate).toBe(true);
48
- });
49
- it("should not update the app if current version is not compatible on android with another os version", () => {
50
- // given
51
- const getConfigValue = () => ({
52
- llm: {
53
- android: [
54
- {
55
- minOsVersion: "33",
56
- version: "2.0.3",
57
- },
58
- ],
59
- },
60
- });
61
- // when
62
- const { shouldUpdate } = useAppVersionBlockCheck({
63
- appVersion: "2.0.1",
64
- osVersion: "32",
65
- platform: "android",
66
- appKey: "llm",
67
- getConfigValue,
68
- });
69
- //then
70
- expect(shouldUpdate).toBe(false);
71
- });
72
- it("should not update the app if current version is not compatible on ios with another os version", () => {
73
- // given
74
- const getConfigValue = () => ({
75
- llm: {
76
- ios: [
77
- {
78
- minOsVersion: "33",
79
- version: "2.0.3",
80
- },
81
- ],
82
- },
83
- });
84
- // when
85
- const { shouldUpdate } = useAppVersionBlockCheck({
86
- appVersion: "2.0.1",
87
- osVersion: "32",
88
- platform: "ios",
89
- appKey: "llm",
90
- getConfigValue,
91
- });
92
- //then
93
- expect(shouldUpdate).toBe(false);
94
- });
95
- it.each([
96
- ["android", "2.1.3"],
97
- ["ios", "2.1.3"],
98
- ["android", "2.1.3-rc.2"],
99
- ["ios", "2.1.3-rc.2"],
100
- ["android", "2.2.3-next.0"],
101
- ["ios", "2.2.3-next.0"],
102
- ["android", "2.0.3-rc2"],
103
- ["ios", "2.0.3-rc2"],
104
- ["android", "2.0.3-next.3"],
105
- ["ios", "2.0.3-next.3"],
106
- ])("should not update the app on %s for version %s compatible with 2.0.3", (platform, appVersion) => {
107
- // given
108
- const getConfigValue = () => ({
109
- llm: {
110
- [platform]: [
111
- {
112
- minOsVersion: "32",
113
- version: "2.0.3",
114
- },
115
- ],
116
- },
117
- });
118
- // when
119
- const { shouldUpdate } = useAppVersionBlockCheck({
120
- appVersion,
121
- osVersion: "32",
122
- platform: platform,
123
- appKey: "llm",
124
- getConfigValue,
125
- });
126
- // then
127
- expect(shouldUpdate).toBe(false);
128
- });
129
- });
130
- });
131
- //# sourceMappingURL=useAppVersionBlockCheck.test.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useAppVersionBlockCheck.test.js","sourceRoot":"","sources":["../../src/hooks/useAppVersionBlockCheck.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AAEpE,QAAQ,CAAC,yBAAyB,EAAE,GAAG,EAAE;IACvC,QAAQ,CAAC,KAAK,EAAE,GAAG,EAAE;QACnB,EAAE,CAAC,+DAA+D,EAAE,GAAG,EAAE;YACvE,QAAQ;YACR,MAAM,cAAc,GAAG,GAAG,EAAE,CAAC,CAAC;gBAC5B,GAAG,EAAE;oBACH,OAAO,EAAE;wBACP;4BACE,YAAY,EAAE,IAAI;4BAClB,OAAO,EAAE,OAAO;yBACjB;qBACF;iBACF;aACF,CAAC,CAAC;YACH,OAAO;YACP,MAAM,EAAE,YAAY,EAAE,GAAG,uBAAuB,CAAC;gBAC/C,UAAU,EAAE,OAAO;gBACnB,SAAS,EAAE,IAAI;gBACf,QAAQ,EAAE,SAAS;gBACnB,MAAM,EAAE,KAAK;gBACb,cAAc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B;gBACvC,MAAM,EAAE,KAAK;gBACb,cAAc;aACf,CAAC,CAAC;YACH,OAAO;YACP,MAAM,CAAC,YAAY,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACnC,CAAC,CACF,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=useModularDrawerVisibility.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useModularDrawerVisibility.test.d.ts","sourceRoot":"","sources":["../../../src/modularDrawer/__test__/useModularDrawerVisibility.test.ts"],"names":[],"mappings":""}
@@ -1,105 +0,0 @@
1
- /**
2
- * @jest-environment jsdom
3
- */
4
- import { renderHook } from "@testing-library/react";
5
- import { useModularDrawerVisibility } from "../useModularDrawerVisibility";
6
- import { ModularDrawerLocation } from "../enums";
7
- import { makeMockedFeatureFlagsProviderWrapper, makeMockedContextValue, } from "../../featureFlags/mock";
8
- describe("useModularDrawerVisibility", () => {
9
- describe("lldModularDrawer", () => {
10
- it("should return false if the feature flag is not enabled", () => {
11
- const mockedFeatures = {
12
- lldModularDrawer: {
13
- enabled: false,
14
- params: { [ModularDrawerLocation.ADD_ACCOUNT]: true },
15
- },
16
- };
17
- const { result } = renderHook(() => useModularDrawerVisibility({
18
- modularDrawerFeatureFlagKey: "lldModularDrawer",
19
- }), {
20
- wrapper: makeMockedFeatureFlagsProviderWrapper(makeMockedContextValue(mockedFeatures)),
21
- });
22
- expect(result.current.isModularDrawerVisible(ModularDrawerLocation.ADD_ACCOUNT)).toBe(false);
23
- });
24
- it("should return false if the location param is not set", () => {
25
- const mockedFeatures = {
26
- lldModularDrawer: { enabled: true, params: {} },
27
- };
28
- const { result } = renderHook(() => useModularDrawerVisibility({
29
- modularDrawerFeatureFlagKey: "lldModularDrawer",
30
- }), {
31
- wrapper: makeMockedFeatureFlagsProviderWrapper(makeMockedContextValue(mockedFeatures)),
32
- });
33
- expect(result.current.isModularDrawerVisible(ModularDrawerLocation.ADD_ACCOUNT)).toBe(false);
34
- });
35
- it("should return the correct visibility for each location", () => {
36
- const mockedFeatures = {
37
- lldModularDrawer: {
38
- enabled: true,
39
- params: {
40
- [ModularDrawerLocation.ADD_ACCOUNT]: true,
41
- [ModularDrawerLocation.EARN_FLOW]: false,
42
- },
43
- },
44
- };
45
- const { result } = renderHook(() => useModularDrawerVisibility({
46
- modularDrawerFeatureFlagKey: "lldModularDrawer",
47
- }), {
48
- wrapper: makeMockedFeatureFlagsProviderWrapper(makeMockedContextValue(mockedFeatures)),
49
- });
50
- expect(result.current.isModularDrawerVisible(ModularDrawerLocation.ADD_ACCOUNT)).toBe(true);
51
- expect(result.current.isModularDrawerVisible(ModularDrawerLocation.EARN_FLOW)).toBe(false);
52
- expect(result.current.isModularDrawerVisible(ModularDrawerLocation.LIVE_APP)).toBe(false);
53
- });
54
- });
55
- describe("llmModularDrawer", () => {
56
- it("should return false if the feature flag is not enabled", () => {
57
- const mockedFeatures = {
58
- llmModularDrawer: {
59
- enabled: false,
60
- params: { [ModularDrawerLocation.ADD_ACCOUNT]: true },
61
- },
62
- };
63
- const { result } = renderHook(() => useModularDrawerVisibility({
64
- modularDrawerFeatureFlagKey: "llmModularDrawer",
65
- }), {
66
- wrapper: makeMockedFeatureFlagsProviderWrapper(makeMockedContextValue(mockedFeatures)),
67
- });
68
- expect(result.current.isModularDrawerVisible(ModularDrawerLocation.ADD_ACCOUNT)).toBe(false);
69
- });
70
- it("should return false if the location param is not set", () => {
71
- const mockedFeatures = {
72
- llmModularDrawer: { enabled: true, params: {} },
73
- };
74
- const { result } = renderHook(() => useModularDrawerVisibility({
75
- modularDrawerFeatureFlagKey: "llmModularDrawer",
76
- }), {
77
- wrapper: makeMockedFeatureFlagsProviderWrapper(makeMockedContextValue(mockedFeatures)),
78
- });
79
- expect(result.current.isModularDrawerVisible(ModularDrawerLocation.ADD_ACCOUNT)).toBe(false);
80
- });
81
- it("should return the correct visibility for each location", () => {
82
- const mockedFeatures = {
83
- llmModularDrawer: {
84
- enabled: true,
85
- params: {
86
- [ModularDrawerLocation.ADD_ACCOUNT]: false,
87
- [ModularDrawerLocation.EARN_FLOW]: true,
88
- [ModularDrawerLocation.RECEIVE_FLOW]: true,
89
- },
90
- },
91
- };
92
- const { result } = renderHook(() => useModularDrawerVisibility({
93
- modularDrawerFeatureFlagKey: "llmModularDrawer",
94
- }), {
95
- wrapper: makeMockedFeatureFlagsProviderWrapper(makeMockedContextValue(mockedFeatures)),
96
- });
97
- expect(result.current.isModularDrawerVisible(ModularDrawerLocation.ADD_ACCOUNT)).toBe(false);
98
- expect(result.current.isModularDrawerVisible(ModularDrawerLocation.EARN_FLOW)).toBe(true);
99
- expect(result.current.isModularDrawerVisible(ModularDrawerLocation.RECEIVE_FLOW)).toBe(true);
100
- expect(result.current.isModularDrawerVisible(ModularDrawerLocation.LIVE_APP)).toBe(false);
101
- expect(result.current.isModularDrawerVisible(ModularDrawerLocation.SEND_FLOW)).toBe(false);
102
- });
103
- });
104
- });
105
- //# sourceMappingURL=useModularDrawerVisibility.test.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useModularDrawerVisibility.test.js","sourceRoot":"","sources":["../../../src/modularDrawer/__test__/useModularDrawerVisibility.test.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,EAAE,0BAA0B,EAAE,MAAM,+BAA+B,CAAC;AAC3E,OAAO,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAC;AACjD,OAAO,EACL,qCAAqC,EACrC,sBAAsB,GACvB,MAAM,yBAAyB,CAAC;AAEjC,QAAQ,CAAC,4BAA4B,EAAE,GAAG,EAAE;IAC1C,QAAQ,CAAC,kBAAkB,EAAE,GAAG,EAAE;QAChC,EAAE,CAAC,wDAAwD,EAAE,GAAG,EAAE;YAChE,MAAM,cAAc,GAAG;gBACrB,gBAAgB,EAAE;oBAChB,OAAO,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OAAO,CAAC,sBAAsB,CAAC,qBAAqB,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YAC1F,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,sBAAsB,CAAC,qBAAqB,CAAC,YAAY,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YAC7F,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,sBAAsB,CAAC,qBAAqB,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;YAC1F,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,sBAAsB,CAAC,qBAAqB,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAC7F,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -1,8 +0,0 @@
1
- export declare enum ModularDrawerLocation {
2
- ADD_ACCOUNT = "add_account",
3
- EARN_FLOW = "earn_flow",
4
- LIVE_APP = "live_app",
5
- RECEIVE_FLOW = "receive_flow",
6
- SEND_FLOW = "send_flow"
7
- }
8
- //# sourceMappingURL=enums.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"enums.d.ts","sourceRoot":"","sources":["../../src/modularDrawer/enums.ts"],"names":[],"mappings":"AAAA,oBAAY,qBAAqB;IAC/B,WAAW,gBAAgB;IAC3B,SAAS,cAAc;IACvB,QAAQ,aAAa;IACrB,YAAY,iBAAiB;IAC7B,SAAS,cAAc;CACxB"}
@@ -1,9 +0,0 @@
1
- export var ModularDrawerLocation;
2
- (function (ModularDrawerLocation) {
3
- ModularDrawerLocation["ADD_ACCOUNT"] = "add_account";
4
- ModularDrawerLocation["EARN_FLOW"] = "earn_flow";
5
- ModularDrawerLocation["LIVE_APP"] = "live_app";
6
- ModularDrawerLocation["RECEIVE_FLOW"] = "receive_flow";
7
- ModularDrawerLocation["SEND_FLOW"] = "send_flow";
8
- })(ModularDrawerLocation || (ModularDrawerLocation = {}));
9
- //# sourceMappingURL=enums.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"enums.js","sourceRoot":"","sources":["../../src/modularDrawer/enums.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,qBAMX;AAND,WAAY,qBAAqB;IAC/B,oDAA2B,CAAA;IAC3B,gDAAuB,CAAA;IACvB,8CAAqB,CAAA;IACrB,sDAA6B,CAAA;IAC7B,gDAAuB,CAAA;AACzB,CAAC,EANW,qBAAqB,KAArB,qBAAqB,QAMhC"}
@@ -1,9 +0,0 @@
1
- import { ModularDrawerLocation } from "./enums";
2
- type ModularDrawerFeatureFlagKey = "lldModularDrawer" | "llmModularDrawer";
3
- export declare function useModularDrawerVisibility({ modularDrawerFeatureFlagKey, }: {
4
- modularDrawerFeatureFlagKey: ModularDrawerFeatureFlagKey;
5
- }): {
6
- isModularDrawerVisible: (location: ModularDrawerLocation) => boolean;
7
- };
8
- export {};
9
- //# sourceMappingURL=useModularDrawerVisibility.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useModularDrawerVisibility.d.ts","sourceRoot":"","sources":["../../src/modularDrawer/useModularDrawerVisibility.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AAEhD,KAAK,2BAA2B,GAAG,kBAAkB,GAAG,kBAAkB,CAAC;AAE3E,wBAAgB,0BAA0B,CAAC,EACzC,2BAA2B,GAC5B,EAAE;IACD,2BAA2B,EAAE,2BAA2B,CAAC;CAC1D;uCAIc,qBAAqB;EAUnC"}
@@ -1,14 +0,0 @@
1
- import { useCallback } from "react";
2
- import { useFeature } from "../featureFlags";
3
- export function useModularDrawerVisibility({ modularDrawerFeatureFlagKey, }) {
4
- const featureModularDrawer = useFeature(modularDrawerFeatureFlagKey);
5
- const isModularDrawerVisible = useCallback((location) => {
6
- if (!featureModularDrawer?.enabled)
7
- return false;
8
- return featureModularDrawer.params?.[location] ?? false;
9
- }, [featureModularDrawer]);
10
- return {
11
- isModularDrawerVisible,
12
- };
13
- }
14
- //# sourceMappingURL=useModularDrawerVisibility.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useModularDrawerVisibility.js","sourceRoot":"","sources":["../../src/modularDrawer/useModularDrawerVisibility.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AACpC,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAK7C,MAAM,UAAU,0BAA0B,CAAC,EACzC,2BAA2B,GAG5B;IACC,MAAM,oBAAoB,GAAG,UAAU,CAAC,2BAA2B,CAAC,CAAC;IAErE,MAAM,sBAAsB,GAAG,WAAW,CACxC,CAAC,QAA+B,EAAE,EAAE;QAClC,IAAI,CAAC,oBAAoB,EAAE,OAAO;YAAE,OAAO,KAAK,CAAC;QACjD,OAAO,oBAAoB,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,IAAI,KAAK,CAAC;IAC1D,CAAC,EACD,CAAC,oBAAoB,CAAC,CACvB,CAAC;IAEF,OAAO;QACL,sBAAsB;KACvB,CAAC;AACJ,CAAC"}
@@ -1,3 +0,0 @@
1
- import { Transaction as EvmTransaction } from "@ledgerhq/coin-evm/types/transaction";
2
- export declare const getTxType: (tx: EvmTransaction) => string;
3
- //# sourceMappingURL=txTrackingHelper.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"txTrackingHelper.d.ts","sourceRoot":"","sources":["../../../src/wallet-api/utils/txTrackingHelper.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,IAAI,cAAc,EAAE,MAAM,sCAAsC,CAAC;AAKrF,eAAO,MAAM,SAAS,OAAQ,cAAc,KAAG,MAQ9C,CAAC"}
@@ -1,12 +0,0 @@
1
- import { DAPP_SELECTORS } from "@ledgerhq/hw-app-eth";
2
- const fallback = "transfer";
3
- export const getTxType = (tx) => {
4
- if (!tx || !tx.data)
5
- return fallback;
6
- const txSelector = `0x${tx.data.toString("hex").substring(0, 8)}`;
7
- const type = DAPP_SELECTORS[txSelector];
8
- if (!type)
9
- return fallback;
10
- return type;
11
- };
12
- //# sourceMappingURL=txTrackingHelper.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"txTrackingHelper.js","sourceRoot":"","sources":["../../../src/wallet-api/utils/txTrackingHelper.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAEtD,MAAM,QAAQ,GAAG,UAAU,CAAC;AAE5B,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,EAAkB,EAAU,EAAE;IACtD,IAAI,CAAC,EAAE,IAAI,CAAC,EAAE,CAAC,IAAI;QAAE,OAAO,QAAQ,CAAC;IAErC,MAAM,UAAU,GAAG,KAAK,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC;IAClE,MAAM,IAAI,GAAG,cAAc,CAAC,UAAU,CAAC,CAAC;IAExC,IAAI,CAAC,IAAI;QAAE,OAAO,QAAQ,CAAC;IAC3B,OAAO,IAAI,CAAC;AACd,CAAC,CAAC"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=txTrackingHelper.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"txTrackingHelper.test.d.ts","sourceRoot":"","sources":["../../../src/wallet-api/utils/txTrackingHelper.test.ts"],"names":[],"mappings":""}
@@ -1,68 +0,0 @@
1
- import { getTxType } from "./txTrackingHelper";
2
- import { ERC20_CLEAR_SIGNED_SELECTORS, DAPP_SELECTORS } from "@ledgerhq/hw-app-eth";
3
- const createMockTransaction = (selector) => ({
4
- data: Buffer.from(selector.slice(2) + "0".repeat(128), "hex"),
5
- recipient: "0x1234567890123456789012345678901234567890",
6
- amount: "0",
7
- gasPrice: "0",
8
- gasLimit: "21000",
9
- nonce: 0,
10
- });
11
- describe("getTxType", () => {
12
- describe("ERC20 transactions", () => {
13
- it("should return 'transfer' for ERC20 transfer selector", () => {
14
- const tx = createMockTransaction(ERC20_CLEAR_SIGNED_SELECTORS.TRANSFER);
15
- const result = getTxType(tx);
16
- expect(result).toBe("transfer");
17
- });
18
- it("should return 'approve' for ERC20 approve selector", () => {
19
- const tx = createMockTransaction(ERC20_CLEAR_SIGNED_SELECTORS.APPROVE);
20
- const result = getTxType(tx);
21
- expect(result).toBe("approve");
22
- });
23
- });
24
- describe("DAPP transactions", () => {
25
- it("should return the DAPP selector value for known DAPP transactions", () => {
26
- const dappSelectors = Object.keys(DAPP_SELECTORS);
27
- if (dappSelectors.length > 0) {
28
- const firstSelector = dappSelectors[0];
29
- const expectedValue = DAPP_SELECTORS[firstSelector];
30
- const tx = createMockTransaction(firstSelector);
31
- const result = getTxType(tx);
32
- expect(result).toBe(expectedValue);
33
- }
34
- });
35
- });
36
- describe("Unknown transactions", () => {
37
- it("should return 'transfer' for unknown selectors", () => {
38
- const tx = createMockTransaction("0x12345678");
39
- const result = getTxType(tx);
40
- expect(result).toBe("transfer");
41
- });
42
- it("should return 'transfer' for transactions without data", () => {
43
- const tx = {
44
- data: undefined,
45
- };
46
- const result = getTxType(tx);
47
- expect(result).toBe("transfer");
48
- });
49
- it("should return 'transfer' for transactions with empty data", () => {
50
- const tx = {
51
- data: Buffer.alloc(0),
52
- };
53
- const result = getTxType(tx);
54
- expect(result).toBe("transfer");
55
- });
56
- });
57
- describe("Selector extract", () => {
58
- it("should correctly extract 4-byte selector from transaction data", () => {
59
- const transferSelector = ERC20_CLEAR_SIGNED_SELECTORS.TRANSFER;
60
- const tx = createMockTransaction(transferSelector);
61
- const expectedSelector = transferSelector;
62
- const txSelector = `0x${tx.data?.toString("hex").substring(0, 8)}`;
63
- expect(txSelector).toBe(expectedSelector);
64
- expect(getTxType(tx)).toBe("transfer");
65
- });
66
- });
67
- });
68
- //# sourceMappingURL=txTrackingHelper.test.js.map
@@ -1 +0,0 @@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AAE,CAAC,CAAC;YAC7B,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QAClC,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,QAAQ,CAAC,kBAAkB,EAAE,GAAG,EAAE;QAChC,EAAE,CAAC,gEAAgE,EAAE,GAAG,EAAE;YACxE,MAAM,gBAAgB,GAAG,4BAA4B,CAAC,QAAQ,CAAC;YAC/D,MAAM,EAAE,GAAG,qBAAqB,CAAC,gBAAgB,CAAC,CAAC;YAEnD,MAAM,gBAAgB,GAAG,gBAAgB,CAAC;YAC1C,MAAM,UAAU,GAAG,KAAK,EAAE,CAAC,IAAI,EAAE,QAAQ,CAAC,KAAK,CAAC,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC;YAEnE,MAAM,CAAC,UAAU,CAAC,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;YAC1C,MAAM,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QACzC,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -1,46 +0,0 @@
1
- import * as cacheModule from "@ledgerhq/live-network/cache";
2
- import { makeBridgeCacheSystem } from "./cache";
3
- import { getCryptoCurrencyById } from "../currencies";
4
- import { setEnv } from "@ledgerhq/live-env";
5
-
6
- describe("Bridge Cache", () => {
7
- beforeEach(() => {
8
- jest.clearAllMocks();
9
- });
10
-
11
- beforeAll(() => {
12
- setEnv("MOCK", "1");
13
- });
14
-
15
- afterAll(() => {
16
- setEnv("MOCK", "");
17
- });
18
-
19
- it("does not re-generate the LRU cache by default", async () => {
20
- const makeLRUCache = jest.spyOn(cacheModule, "makeLRUCache");
21
- const { prepareCurrency } = makeBridgeCacheSystem({
22
- saveData: () => Promise.resolve(),
23
- getData: () => Promise.resolve(null),
24
- });
25
-
26
- await prepareCurrency(getCryptoCurrencyById("solana"));
27
- expect(makeLRUCache).toHaveBeenCalledTimes(1);
28
-
29
- await prepareCurrency(getCryptoCurrencyById("solana"));
30
- expect(makeLRUCache).toHaveBeenCalledTimes(1);
31
- });
32
-
33
- it("forces the LRU cache to be re-generated", async () => {
34
- const makeLRUCache = jest.spyOn(cacheModule, "makeLRUCache");
35
- const { prepareCurrency } = makeBridgeCacheSystem({
36
- saveData: () => Promise.resolve(),
37
- getData: () => Promise.resolve(null),
38
- });
39
-
40
- await prepareCurrency(getCryptoCurrencyById("solana"));
41
- expect(makeLRUCache).toHaveBeenCalledTimes(1);
42
-
43
- await prepareCurrency(getCryptoCurrencyById("solana"), { forceUpdate: true });
44
- expect(makeLRUCache).toHaveBeenCalledTimes(2);
45
- });
46
- });