@ledgerhq/live-common 34.42.0-nightly.4 → 34.42.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.
Files changed (157) hide show
  1. package/lib/__tests__/migration/account-migration.js +0 -3
  2. package/lib/__tests__/migration/account-migration.js.map +1 -1
  3. package/lib/__tests__/test-helpers/environment.js +0 -3
  4. package/lib/__tests__/test-helpers/environment.js.map +1 -1
  5. package/lib/bridge/generic-alpaca/alpaca/network/network-alpaca.d.ts +1 -3
  6. package/lib/bridge/generic-alpaca/alpaca/network/network-alpaca.d.ts.map +1 -1
  7. package/lib/bridge/generic-alpaca/alpaca/network/network-alpaca.js +0 -6
  8. package/lib/bridge/generic-alpaca/alpaca/network/network-alpaca.js.map +1 -1
  9. package/lib/bridge/impl.d.ts +0 -2
  10. package/lib/bridge/impl.d.ts.map +1 -1
  11. package/lib/bridge/impl.js +1 -8
  12. package/lib/bridge/impl.js.map +1 -1
  13. package/lib/bridge/useBridgeTransaction.test.js +1 -1
  14. package/lib/bridge/useBridgeTransaction.test.js.map +1 -1
  15. package/lib/e2e/index.d.ts +0 -6
  16. package/lib/e2e/index.d.ts.map +1 -1
  17. package/lib/e2e/speculos.d.ts.map +1 -1
  18. package/lib/e2e/speculos.js +2 -5
  19. package/lib/e2e/speculos.js.map +1 -1
  20. package/lib/exchange/error.d.ts +1 -2
  21. package/lib/exchange/error.d.ts.map +1 -1
  22. package/lib/exchange/error.js +3 -5
  23. package/lib/exchange/error.js.map +1 -1
  24. package/lib/exchange/swap/completeExchange.js +2 -2
  25. package/lib/exchange/swap/completeExchange.js.map +1 -1
  26. package/lib/families/evm/config.d.ts.map +1 -1
  27. package/lib/families/evm/config.js +0 -51
  28. package/lib/families/evm/config.js.map +1 -1
  29. package/lib/families/evm/walletApiAdapter.js +1 -1
  30. package/lib/featureFlags/defaultFeatures.d.ts +0 -3
  31. package/lib/featureFlags/defaultFeatures.d.ts.map +1 -1
  32. package/lib/featureFlags/defaultFeatures.js +0 -3
  33. package/lib/featureFlags/defaultFeatures.js.map +1 -1
  34. package/lib/modularDrawer/utils/index.d.ts +1 -2
  35. package/lib/modularDrawer/utils/index.d.ts.map +1 -1
  36. package/lib/modularDrawer/utils/index.js +1 -3
  37. package/lib/modularDrawer/utils/index.js.map +1 -1
  38. package/lib/wallet-api/Exchange/server.d.ts.map +1 -1
  39. package/lib/wallet-api/Exchange/server.js +6 -6
  40. package/lib/wallet-api/Exchange/server.js.map +1 -1
  41. package/lib-es/__tests__/migration/account-migration.js +0 -3
  42. package/lib-es/__tests__/migration/account-migration.js.map +1 -1
  43. package/lib-es/__tests__/test-helpers/environment.js +0 -3
  44. package/lib-es/__tests__/test-helpers/environment.js.map +1 -1
  45. package/lib-es/bridge/generic-alpaca/alpaca/network/network-alpaca.d.ts +1 -3
  46. package/lib-es/bridge/generic-alpaca/alpaca/network/network-alpaca.d.ts.map +1 -1
  47. package/lib-es/bridge/generic-alpaca/alpaca/network/network-alpaca.js +0 -6
  48. package/lib-es/bridge/generic-alpaca/alpaca/network/network-alpaca.js.map +1 -1
  49. package/lib-es/bridge/impl.d.ts +0 -2
  50. package/lib-es/bridge/impl.d.ts.map +1 -1
  51. package/lib-es/bridge/impl.js +0 -6
  52. package/lib-es/bridge/impl.js.map +1 -1
  53. package/lib-es/bridge/useBridgeTransaction.test.js +1 -1
  54. package/lib-es/bridge/useBridgeTransaction.test.js.map +1 -1
  55. package/lib-es/e2e/index.d.ts +0 -6
  56. package/lib-es/e2e/index.d.ts.map +1 -1
  57. package/lib-es/e2e/speculos.d.ts.map +1 -1
  58. package/lib-es/e2e/speculos.js +2 -5
  59. package/lib-es/e2e/speculos.js.map +1 -1
  60. package/lib-es/exchange/error.d.ts +1 -2
  61. package/lib-es/exchange/error.d.ts.map +1 -1
  62. package/lib-es/exchange/error.js +3 -5
  63. package/lib-es/exchange/error.js.map +1 -1
  64. package/lib-es/exchange/swap/completeExchange.js +2 -2
  65. package/lib-es/exchange/swap/completeExchange.js.map +1 -1
  66. package/lib-es/families/evm/config.d.ts.map +1 -1
  67. package/lib-es/families/evm/config.js +0 -51
  68. package/lib-es/families/evm/config.js.map +1 -1
  69. package/lib-es/families/evm/walletApiAdapter.js +1 -1
  70. package/lib-es/featureFlags/defaultFeatures.d.ts +0 -3
  71. package/lib-es/featureFlags/defaultFeatures.d.ts.map +1 -1
  72. package/lib-es/featureFlags/defaultFeatures.js +0 -3
  73. package/lib-es/featureFlags/defaultFeatures.js.map +1 -1
  74. package/lib-es/modularDrawer/utils/index.d.ts +1 -2
  75. package/lib-es/modularDrawer/utils/index.d.ts.map +1 -1
  76. package/lib-es/modularDrawer/utils/index.js +1 -2
  77. package/lib-es/modularDrawer/utils/index.js.map +1 -1
  78. package/lib-es/wallet-api/Exchange/server.d.ts.map +1 -1
  79. package/lib-es/wallet-api/Exchange/server.js +6 -6
  80. package/lib-es/wallet-api/Exchange/server.js.map +1 -1
  81. package/package.json +67 -67
  82. package/src/__tests__/migration/account-migration.ts +0 -3
  83. package/src/__tests__/test-helpers/environment.ts +0 -3
  84. package/src/bridge/generic-alpaca/alpaca/network/network-alpaca.ts +1 -8
  85. package/src/bridge/impl.ts +0 -8
  86. package/src/bridge/useBridgeTransaction.test.ts +1 -1
  87. package/src/e2e/speculos.ts +2 -5
  88. package/src/exchange/error.ts +3 -5
  89. package/src/exchange/swap/completeExchange.ts +2 -2
  90. package/src/families/evm/config.ts +0 -51
  91. package/src/families/evm/walletApiAdapter.ts +1 -1
  92. package/src/featureFlags/defaultFeatures.ts +0 -3
  93. package/src/modularDrawer/utils/index.ts +1 -2
  94. package/src/wallet-api/Exchange/server.ts +6 -7
  95. package/lib/bridge/crypto-assets/index.d.ts +0 -4
  96. package/lib/bridge/crypto-assets/index.d.ts.map +0 -1
  97. package/lib/bridge/crypto-assets/index.js +0 -52
  98. package/lib/bridge/crypto-assets/index.js.map +0 -1
  99. package/lib/bridge/crypto-assets/index.test.d.ts +0 -2
  100. package/lib/bridge/crypto-assets/index.test.d.ts.map +0 -1
  101. package/lib/bridge/crypto-assets/index.test.js +0 -85
  102. package/lib/bridge/crypto-assets/index.test.js.map +0 -1
  103. package/lib/e2e/families/osmosis.d.ts +0 -3
  104. package/lib/e2e/families/osmosis.d.ts.map +0 -1
  105. package/lib/e2e/families/osmosis.js +0 -19
  106. package/lib/e2e/families/osmosis.js.map +0 -1
  107. package/lib/modularDrawer/__mocks__/currencies.mock.d.ts +0 -17
  108. package/lib/modularDrawer/__mocks__/currencies.mock.d.ts.map +0 -1
  109. package/lib/modularDrawer/__mocks__/currencies.mock.js +0 -60
  110. package/lib/modularDrawer/__mocks__/currencies.mock.js.map +0 -1
  111. package/lib/modularDrawer/__mocks__/useGroupedCurrenciesByProvider.mock.d.ts +0 -22
  112. package/lib/modularDrawer/__mocks__/useGroupedCurrenciesByProvider.mock.d.ts.map +0 -1
  113. package/lib/modularDrawer/__mocks__/useGroupedCurrenciesByProvider.mock.js +0 -41
  114. package/lib/modularDrawer/__mocks__/useGroupedCurrenciesByProvider.mock.js.map +0 -1
  115. package/lib/modularDrawer/utils/__tests__/haveOneCommonProvider.test.d.ts +0 -2
  116. package/lib/modularDrawer/utils/__tests__/haveOneCommonProvider.test.d.ts.map +0 -1
  117. package/lib/modularDrawer/utils/__tests__/haveOneCommonProvider.test.js +0 -28
  118. package/lib/modularDrawer/utils/__tests__/haveOneCommonProvider.test.js.map +0 -1
  119. package/lib/modularDrawer/utils/haveOneCommonProvider.d.ts +0 -11
  120. package/lib/modularDrawer/utils/haveOneCommonProvider.d.ts.map +0 -1
  121. package/lib/modularDrawer/utils/haveOneCommonProvider.js +0 -29
  122. package/lib/modularDrawer/utils/haveOneCommonProvider.js.map +0 -1
  123. package/lib-es/bridge/crypto-assets/index.d.ts +0 -4
  124. package/lib-es/bridge/crypto-assets/index.d.ts.map +0 -1
  125. package/lib-es/bridge/crypto-assets/index.js +0 -24
  126. package/lib-es/bridge/crypto-assets/index.js.map +0 -1
  127. package/lib-es/bridge/crypto-assets/index.test.d.ts +0 -2
  128. package/lib-es/bridge/crypto-assets/index.test.d.ts.map +0 -1
  129. package/lib-es/bridge/crypto-assets/index.test.js +0 -60
  130. package/lib-es/bridge/crypto-assets/index.test.js.map +0 -1
  131. package/lib-es/e2e/families/osmosis.d.ts +0 -3
  132. package/lib-es/e2e/families/osmosis.d.ts.map +0 -1
  133. package/lib-es/e2e/families/osmosis.js +0 -12
  134. package/lib-es/e2e/families/osmosis.js.map +0 -1
  135. package/lib-es/modularDrawer/__mocks__/currencies.mock.d.ts +0 -17
  136. package/lib-es/modularDrawer/__mocks__/currencies.mock.d.ts.map +0 -1
  137. package/lib-es/modularDrawer/__mocks__/currencies.mock.js +0 -55
  138. package/lib-es/modularDrawer/__mocks__/currencies.mock.js.map +0 -1
  139. package/lib-es/modularDrawer/__mocks__/useGroupedCurrenciesByProvider.mock.d.ts +0 -22
  140. package/lib-es/modularDrawer/__mocks__/useGroupedCurrenciesByProvider.mock.d.ts.map +0 -1
  141. package/lib-es/modularDrawer/__mocks__/useGroupedCurrenciesByProvider.mock.js +0 -38
  142. package/lib-es/modularDrawer/__mocks__/useGroupedCurrenciesByProvider.mock.js.map +0 -1
  143. package/lib-es/modularDrawer/utils/__tests__/haveOneCommonProvider.test.d.ts +0 -2
  144. package/lib-es/modularDrawer/utils/__tests__/haveOneCommonProvider.test.d.ts.map +0 -1
  145. package/lib-es/modularDrawer/utils/__tests__/haveOneCommonProvider.test.js +0 -26
  146. package/lib-es/modularDrawer/utils/__tests__/haveOneCommonProvider.test.js.map +0 -1
  147. package/lib-es/modularDrawer/utils/haveOneCommonProvider.d.ts +0 -11
  148. package/lib-es/modularDrawer/utils/haveOneCommonProvider.d.ts.map +0 -1
  149. package/lib-es/modularDrawer/utils/haveOneCommonProvider.js +0 -25
  150. package/lib-es/modularDrawer/utils/haveOneCommonProvider.js.map +0 -1
  151. package/src/bridge/crypto-assets/index.test.ts +0 -71
  152. package/src/bridge/crypto-assets/index.ts +0 -30
  153. package/src/e2e/families/osmosis.ts +0 -13
  154. package/src/modularDrawer/__mocks__/currencies.mock.ts +0 -62
  155. package/src/modularDrawer/__mocks__/useGroupedCurrenciesByProvider.mock.ts +0 -49
  156. package/src/modularDrawer/utils/__tests__/haveOneCommonProvider.test.ts +0 -34
  157. package/src/modularDrawer/utils/haveOneCommonProvider.ts +0 -31
@@ -1,85 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
- Object.defineProperty(exports, "__esModule", { value: true });
26
- const LiveConfig_1 = require("@ledgerhq/live-config/LiveConfig");
27
- const _1 = require(".");
28
- const legacy = __importStar(require("@ledgerhq/cryptoassets/tokens"));
29
- describe("Testing CryptoAssetStore", () => {
30
- it("should return the default methods from cryptoassets libs when feature flag does not exists", () => {
31
- LiveConfig_1.LiveConfig.setConfig({
32
- some_other_feature: {
33
- type: "boolean",
34
- default: true,
35
- },
36
- });
37
- const store = (0, _1.getCryptoAssetsStore)();
38
- expect(store).toEqual({
39
- findTokenByAddress: legacy.findTokenByAddress,
40
- getTokenById: legacy.getTokenById,
41
- findTokenById: legacy.findTokenById,
42
- findTokenByAddressInCurrency: legacy.findTokenByAddressInCurrency,
43
- findTokenByTicker: legacy.findTokenByTicker,
44
- });
45
- });
46
- it("should return the default methods from cryptoassets libs when feature flag is disabled", () => {
47
- LiveConfig_1.LiveConfig.setConfig({
48
- feature_cal_lazy_loading: {
49
- type: "boolean",
50
- default: false,
51
- },
52
- });
53
- const store = (0, _1.getCryptoAssetsStore)();
54
- expect(store).toEqual({
55
- findTokenByAddress: legacy.findTokenByAddress,
56
- getTokenById: legacy.getTokenById,
57
- findTokenById: legacy.findTokenById,
58
- findTokenByAddressInCurrency: legacy.findTokenByAddressInCurrency,
59
- findTokenByTicker: legacy.findTokenByTicker,
60
- });
61
- });
62
- it("should throw an error when no store is set and feature flag is enabled", () => {
63
- LiveConfig_1.LiveConfig.setConfig({
64
- feature_cal_lazy_loading: {
65
- type: "boolean",
66
- default: true,
67
- },
68
- });
69
- expect(() => (0, _1.getCryptoAssetsStore)()).toThrow("CryptoAssetsStore is not set. Please call setCryptoAssetsStore first.");
70
- });
71
- it("should throw return the new store when feature flag is enabled", () => {
72
- LiveConfig_1.LiveConfig.setConfig({
73
- feature_cal_lazy_loading: {
74
- type: "boolean",
75
- default: true,
76
- },
77
- });
78
- // eslint-disable-next-line @typescript-eslint/consistent-type-assertions
79
- const newStore = {};
80
- (0, _1.setCryptoAssetsStore)(newStore);
81
- const store = (0, _1.getCryptoAssetsStore)();
82
- expect(store).toBe(newStore);
83
- });
84
- });
85
- //# sourceMappingURL=index.test.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.test.js","sourceRoot":"","sources":["../../../src/bridge/crypto-assets/index.test.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,iEAA8D;AAC9D,wBAA+D;AAC/D,sEAAwD;AAGxD,QAAQ,CAAC,0BAA0B,EAAE,GAAG,EAAE;IACxC,EAAE,CAAC,4FAA4F,EAAE,GAAG,EAAE;QACpG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,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,gEAAgE,EAAE,GAAG,EAAE;QACxE,uBAAU,CAAC,SAAS,CAAC;YACnB,wBAAwB,EAAE;gBACxB,IAAI,EAAE,SAAS;gBACf,OAAO,EAAE,IAAI;aACd;SACF,CAAC,CAAC;QAEH,yEAAyE;QACzE,MAAM,QAAQ,GAAG,EAAkC,CAAC;QACpD,IAAA,uBAAoB,EAAC,QAAQ,CAAC,CAAC;QAE/B,MAAM,KAAK,GAAG,IAAA,uBAAoB,GAAE,CAAC;QACrC,MAAM,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IAC/B,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -1,3 +0,0 @@
1
- import { Delegate } from "../models/Delegate";
2
- export declare function delegateOsmosis(delegatingAccount: Delegate): Promise<void>;
3
- //# sourceMappingURL=osmosis.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"osmosis.d.ts","sourceRoot":"","sources":["../../../src/e2e/families/osmosis.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAK9C,wBAAsB,eAAe,CAAC,iBAAiB,EAAE,QAAQ,iBAOhE"}
@@ -1,19 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.delegateOsmosis = void 0;
7
- const speculos_1 = require("../speculos");
8
- const DeviceLabels_1 = require("../enum/DeviceLabels");
9
- const expect_1 = __importDefault(require("expect"));
10
- async function delegateOsmosis(delegatingAccount) {
11
- await (0, speculos_1.waitFor)(DeviceLabels_1.DeviceLabels.PLEASE_REVIEW);
12
- const events = await (0, speculos_1.pressUntilTextFound)(DeviceLabels_1.DeviceLabels.CAPS_APPROVE);
13
- const amountInUosmo = (Number(delegatingAccount.amount) * 1_000_000).toString();
14
- const isAmountCorrect = (0, speculos_1.containsSubstringInEvent)(amountInUosmo, events);
15
- (0, expect_1.default)(isAmountCorrect).toBeTruthy();
16
- await (0, speculos_1.pressBoth)();
17
- }
18
- exports.delegateOsmosis = delegateOsmosis;
19
- //# sourceMappingURL=osmosis.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"osmosis.js","sourceRoot":"","sources":["../../../src/e2e/families/osmosis.ts"],"names":[],"mappings":";;;;;;AACA,0CAAgG;AAChG,uDAAoD;AACpD,oDAA4B;AAErB,KAAK,UAAU,eAAe,CAAC,iBAA2B;IAC/D,MAAM,IAAA,kBAAO,EAAC,2BAAY,CAAC,aAAa,CAAC,CAAC;IAC1C,MAAM,MAAM,GAAG,MAAM,IAAA,8BAAmB,EAAC,2BAAY,CAAC,YAAY,CAAC,CAAC;IACpE,MAAM,aAAa,GAAG,CAAC,MAAM,CAAC,iBAAiB,CAAC,MAAM,CAAC,GAAG,SAAS,CAAC,CAAC,QAAQ,EAAE,CAAC;IAChF,MAAM,eAAe,GAAG,IAAA,mCAAwB,EAAC,aAAa,EAAE,MAAM,CAAC,CAAC;IACxE,IAAA,gBAAM,EAAC,eAAe,CAAC,CAAC,UAAU,EAAE,CAAC;IACrC,MAAM,IAAA,oBAAS,GAAE,CAAC;AACpB,CAAC;AAPD,0CAOC"}
@@ -1,17 +0,0 @@
1
- import { TokenCurrency } from "@ledgerhq/types-cryptoassets";
2
- export declare const mockBtcCryptoCurrency: import("@ledgerhq/types-cryptoassets").CryptoCurrency;
3
- export declare const mockEthCryptoCurrency: import("@ledgerhq/types-cryptoassets").CryptoCurrency;
4
- export declare const mockArbitrumCryptoCurrency: import("@ledgerhq/types-cryptoassets").CryptoCurrency;
5
- export declare const mockBaseCryptoCurrency: import("@ledgerhq/types-cryptoassets").CryptoCurrency;
6
- export declare const mockScrollCryptoCurrency: import("@ledgerhq/types-cryptoassets").CryptoCurrency;
7
- export declare const mockInjectiveCryptoCurrency: import("@ledgerhq/types-cryptoassets").CryptoCurrency;
8
- export declare const arbitrumToken: TokenCurrency;
9
- export declare const usdcToken: TokenCurrency;
10
- export declare const findCryptoCurrencyById: (id: string) => import("@ledgerhq/types-cryptoassets").CryptoCurrency | undefined;
11
- export declare const getTokenOrCryptoCurrencyById: (id: string) => import("@ledgerhq/types-cryptoassets").CryptoCurrency | TokenCurrency | undefined;
12
- export declare const mockCurrenciesByProvider: {
13
- providerId: string;
14
- currenciesByNetwork: import("@ledgerhq/types-cryptoassets").CryptoCurrency[];
15
- }[];
16
- export declare const mockCurrencyIds: string[];
17
- //# sourceMappingURL=currencies.mock.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"currencies.mock.d.ts","sourceRoot":"","sources":["../../../src/modularDrawer/__mocks__/currencies.mock.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAE7D,eAAO,MAAM,qBAAqB,uDAAmC,CAAC;AACtE,eAAO,MAAM,qBAAqB,uDAAoC,CAAC;AACvE,eAAO,MAAM,0BAA0B,uDAAoC,CAAC;AAC5E,eAAO,MAAM,sBAAsB,uDAAgC,CAAC;AACpE,eAAO,MAAM,wBAAwB,uDAAkC,CAAC;AACxE,eAAO,MAAM,2BAA2B,uDAAqC,CAAC;AAE9E,eAAO,MAAM,aAAa,EAAE,aAe3B,CAAC;AACF,eAAO,MAAM,SAAS,EAAE,aAevB,CAAC;AAEF,eAAO,MAAM,sBAAsB,OAAQ,MAAM,sEACkD,CAAC;AACpG,eAAO,MAAM,4BAA4B,OAAQ,MAAM,sFAO7B,CAAC;AAE3B,eAAO,MAAM,wBAAwB;;;GAKpC,CAAC;AAEF,eAAO,MAAM,eAAe,UAA8C,CAAC"}
@@ -1,60 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.mockCurrencyIds = exports.mockCurrenciesByProvider = exports.getTokenOrCryptoCurrencyById = exports.findCryptoCurrencyById = exports.usdcToken = exports.arbitrumToken = exports.mockInjectiveCryptoCurrency = exports.mockScrollCryptoCurrency = exports.mockBaseCryptoCurrency = exports.mockArbitrumCryptoCurrency = exports.mockEthCryptoCurrency = exports.mockBtcCryptoCurrency = void 0;
4
- const index_1 = require("@ledgerhq/live-common/currencies/index");
5
- exports.mockBtcCryptoCurrency = (0, index_1.getCryptoCurrencyById)("bitcoin");
6
- exports.mockEthCryptoCurrency = (0, index_1.getCryptoCurrencyById)("ethereum");
7
- exports.mockArbitrumCryptoCurrency = (0, index_1.getCryptoCurrencyById)("arbitrum");
8
- exports.mockBaseCryptoCurrency = (0, index_1.getCryptoCurrencyById)("base");
9
- exports.mockScrollCryptoCurrency = (0, index_1.getCryptoCurrencyById)("scroll");
10
- exports.mockInjectiveCryptoCurrency = (0, index_1.getCryptoCurrencyById)("injective");
11
- exports.arbitrumToken = {
12
- type: "TokenCurrency",
13
- id: "arbitrum/erc20/arbitrum",
14
- contractAddress: "0x912CE59144191C1204E64559FE8253a0e49E6548",
15
- parentCurrency: exports.mockArbitrumCryptoCurrency,
16
- tokenType: "erc20",
17
- name: "Arbitrum",
18
- ticker: "ARB",
19
- units: [
20
- {
21
- name: "Arbitrum",
22
- code: "ARB",
23
- magnitude: 18,
24
- },
25
- ],
26
- };
27
- exports.usdcToken = {
28
- type: "TokenCurrency",
29
- id: "ethereum/erc20/usd__coin",
30
- contractAddress: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
31
- parentCurrency: exports.mockEthCryptoCurrency,
32
- tokenType: "erc20",
33
- name: "USD Coin",
34
- ticker: "USDC",
35
- units: [
36
- {
37
- name: "USD Coin",
38
- code: "USDC",
39
- magnitude: 6,
40
- },
41
- ],
42
- };
43
- const findCryptoCurrencyById = (id) => [exports.mockBtcCryptoCurrency, exports.mockEthCryptoCurrency, exports.mockArbitrumCryptoCurrency].find(a => a.id === id);
44
- exports.findCryptoCurrencyById = findCryptoCurrencyById;
45
- const getTokenOrCryptoCurrencyById = (id) => [
46
- exports.mockBtcCryptoCurrency,
47
- exports.mockEthCryptoCurrency,
48
- exports.mockArbitrumCryptoCurrency,
49
- exports.arbitrumToken,
50
- exports.usdcToken,
51
- ].find(a => a.id === id);
52
- exports.getTokenOrCryptoCurrencyById = getTokenOrCryptoCurrencyById;
53
- exports.mockCurrenciesByProvider = [
54
- {
55
- providerId: "ethereum",
56
- currenciesByNetwork: [exports.mockEthCryptoCurrency],
57
- },
58
- ];
59
- exports.mockCurrencyIds = ["bitcoin", "ethereum", "arbitrum", "base"];
60
- //# sourceMappingURL=currencies.mock.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"currencies.mock.js","sourceRoot":"","sources":["../../../src/modularDrawer/__mocks__/currencies.mock.ts"],"names":[],"mappings":";;;AAAA,kEAA+E;AAGlE,QAAA,qBAAqB,GAAG,IAAA,6BAAqB,EAAC,SAAS,CAAC,CAAC;AACzD,QAAA,qBAAqB,GAAG,IAAA,6BAAqB,EAAC,UAAU,CAAC,CAAC;AAC1D,QAAA,0BAA0B,GAAG,IAAA,6BAAqB,EAAC,UAAU,CAAC,CAAC;AAC/D,QAAA,sBAAsB,GAAG,IAAA,6BAAqB,EAAC,MAAM,CAAC,CAAC;AACvD,QAAA,wBAAwB,GAAG,IAAA,6BAAqB,EAAC,QAAQ,CAAC,CAAC;AAC3D,QAAA,2BAA2B,GAAG,IAAA,6BAAqB,EAAC,WAAW,CAAC,CAAC;AAEjE,QAAA,aAAa,GAAkB;IAC1C,IAAI,EAAE,eAAe;IACrB,EAAE,EAAE,yBAAyB;IAC7B,eAAe,EAAE,4CAA4C;IAC7D,cAAc,EAAE,kCAA0B;IAC1C,SAAS,EAAE,OAAO;IAClB,IAAI,EAAE,UAAU;IAChB,MAAM,EAAE,KAAK;IACb,KAAK,EAAE;QACL;YACE,IAAI,EAAE,UAAU;YAChB,IAAI,EAAE,KAAK;YACX,SAAS,EAAE,EAAE;SACd;KACF;CACF,CAAC;AACW,QAAA,SAAS,GAAkB;IACtC,IAAI,EAAE,eAAe;IACrB,EAAE,EAAE,0BAA0B;IAC9B,eAAe,EAAE,4CAA4C;IAC7D,cAAc,EAAE,6BAAqB;IACrC,SAAS,EAAE,OAAO;IAClB,IAAI,EAAE,UAAU;IAChB,MAAM,EAAE,MAAM;IACd,KAAK,EAAE;QACL;YACE,IAAI,EAAE,UAAU;YAChB,IAAI,EAAE,MAAM;YACZ,SAAS,EAAE,CAAC;SACb;KACF;CACF,CAAC;AAEK,MAAM,sBAAsB,GAAG,CAAC,EAAU,EAAE,EAAE,CACnD,CAAC,6BAAqB,EAAE,6BAAqB,EAAE,kCAA0B,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC;AADvF,QAAA,sBAAsB,0BACiE;AAC7F,MAAM,4BAA4B,GAAG,CAAC,EAAU,EAAE,EAAE,CACzD;IACE,6BAAqB;IACrB,6BAAqB;IACrB,kCAA0B;IAC1B,qBAAa;IACb,iBAAS;CACV,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC;AAPd,QAAA,4BAA4B,gCAOd;AAEd,QAAA,wBAAwB,GAAG;IACtC;QACE,UAAU,EAAE,UAAU;QACtB,mBAAmB,EAAE,CAAC,6BAAqB,CAAC;KAC7C;CACF,CAAC;AAEW,QAAA,eAAe,GAAG,CAAC,SAAS,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,CAAC,CAAC"}
@@ -1,22 +0,0 @@
1
- /// <reference types="jest" />
2
- export declare const providers: ({
3
- providerId: string;
4
- currenciesByNetwork: import("@ledgerhq/types-cryptoassets").CryptoCurrency[];
5
- } | {
6
- providerId: string;
7
- currenciesByNetwork: import("@ledgerhq/types-cryptoassets").TokenCurrency[];
8
- })[];
9
- export declare const res: {
10
- result: {
11
- currenciesByProvider: ({
12
- providerId: string;
13
- currenciesByNetwork: import("@ledgerhq/types-cryptoassets").CryptoCurrency[];
14
- } | {
15
- providerId: string;
16
- currenciesByNetwork: import("@ledgerhq/types-cryptoassets").TokenCurrency[];
17
- })[];
18
- sortedCryptoCurrencies: import("@ledgerhq/types-cryptoassets").CryptoCurrency[];
19
- };
20
- };
21
- export declare const useGroupedCurrenciesByProvider: jest.Mock;
22
- //# sourceMappingURL=useGroupedCurrenciesByProvider.mock.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useGroupedCurrenciesByProvider.mock.d.ts","sourceRoot":"","sources":["../../../src/modularDrawer/__mocks__/useGroupedCurrenciesByProvider.mock.ts"],"names":[],"mappings":";AAYA,eAAO,MAAM,SAAS;;;;;;IAiBrB,CAAC;AAEF,eAAO,MAAM,GAAG;;;;;;;;;;;CAYf,CAAC;AAEF,eAAO,MAAM,8BAA8B,EAAE,IAAI,CAAC,IAG/C,CAAC"}
@@ -1,41 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.useGroupedCurrenciesByProvider = exports.res = exports.providers = void 0;
4
- const type_1 = require("@ledgerhq/live-common/deposit/type");
5
- const currencies_mock_1 = require("./currencies.mock");
6
- exports.providers = [
7
- {
8
- providerId: "bitcoin",
9
- currenciesByNetwork: [currencies_mock_1.mockBtcCryptoCurrency],
10
- },
11
- {
12
- providerId: "ethereum",
13
- currenciesByNetwork: [
14
- currencies_mock_1.mockEthCryptoCurrency,
15
- currencies_mock_1.mockArbitrumCryptoCurrency,
16
- currencies_mock_1.mockBaseCryptoCurrency,
17
- currencies_mock_1.mockScrollCryptoCurrency,
18
- ],
19
- },
20
- { providerId: "arbitrum", currenciesByNetwork: [currencies_mock_1.arbitrumToken] },
21
- { providerId: "usd-coin", currenciesByNetwork: [currencies_mock_1.usdcToken] },
22
- { providerId: "injective-protocol", currenciesByNetwork: [currencies_mock_1.mockInjectiveCryptoCurrency] },
23
- ];
24
- exports.res = {
25
- result: {
26
- currenciesByProvider: exports.providers,
27
- sortedCryptoCurrencies: [
28
- currencies_mock_1.mockBtcCryptoCurrency,
29
- currencies_mock_1.mockEthCryptoCurrency,
30
- currencies_mock_1.mockArbitrumCryptoCurrency,
31
- currencies_mock_1.mockBaseCryptoCurrency,
32
- currencies_mock_1.mockScrollCryptoCurrency,
33
- currencies_mock_1.mockInjectiveCryptoCurrency,
34
- ],
35
- },
36
- };
37
- exports.useGroupedCurrenciesByProvider = jest.fn(() => ({
38
- ...exports.res,
39
- loadingStatus: type_1.LoadingStatus.Success,
40
- }));
41
- //# sourceMappingURL=useGroupedCurrenciesByProvider.mock.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useGroupedCurrenciesByProvider.mock.js","sourceRoot":"","sources":["../../../src/modularDrawer/__mocks__/useGroupedCurrenciesByProvider.mock.ts"],"names":[],"mappings":";;;AAAA,6DAAmE;AACnE,uDAS2B;AAEd,QAAA,SAAS,GAAG;IACvB;QACE,UAAU,EAAE,SAAS;QACrB,mBAAmB,EAAE,CAAC,uCAAqB,CAAC;KAC7C;IACD;QACE,UAAU,EAAE,UAAU;QACtB,mBAAmB,EAAE;YACnB,uCAAqB;YACrB,4CAA0B;YAC1B,wCAAsB;YACtB,0CAAwB;SACzB;KACF;IACD,EAAE,UAAU,EAAE,UAAU,EAAE,mBAAmB,EAAE,CAAC,+BAAa,CAAC,EAAE;IAChE,EAAE,UAAU,EAAE,UAAU,EAAE,mBAAmB,EAAE,CAAC,2BAAS,CAAC,EAAE;IAC5D,EAAE,UAAU,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,CAAC,6CAA2B,CAAC,EAAE;CACzF,CAAC;AAEW,QAAA,GAAG,GAAG;IACjB,MAAM,EAAE;QACN,oBAAoB,EAAE,iBAAS;QAC/B,sBAAsB,EAAE;YACtB,uCAAqB;YACrB,uCAAqB;YACrB,4CAA0B;YAC1B,wCAAsB;YACtB,0CAAwB;YACxB,6CAA2B;SAC5B;KACF;CACF,CAAC;AAEW,QAAA,8BAA8B,GAAc,IAAI,CAAC,EAAE,CAAC,GAAG,EAAE,CAAC,CAAC;IACtE,GAAG,WAAG;IACN,aAAa,EAAE,oBAAa,CAAC,OAAO;CACrC,CAAC,CAAC,CAAC"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=haveOneCommonProvider.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"haveOneCommonProvider.test.d.ts","sourceRoot":"","sources":["../../../../src/modularDrawer/utils/__tests__/haveOneCommonProvider.test.ts"],"names":[],"mappings":""}
@@ -1,28 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const haveOneCommonProvider_1 = require("../haveOneCommonProvider");
4
- const useGroupedCurrenciesByProvider_mock_1 = require("../../__mocks__/useGroupedCurrenciesByProvider.mock");
5
- jest.mock("@ledgerhq/live-common/deposit/useGroupedCurrenciesByProvider.hook", () => ({
6
- useGroupedCurrenciesByProvider: () => (0, useGroupedCurrenciesByProvider_mock_1.useGroupedCurrenciesByProvider)(),
7
- }));
8
- describe("haveOneCommonProvider", () => {
9
- it("should return false for an empty array", () => {
10
- expect((0, haveOneCommonProvider_1.haveOneCommonProvider)([], [])).toBe(false);
11
- });
12
- it("should return true for a single currency with one provider", () => {
13
- const { result } = (0, useGroupedCurrenciesByProvider_mock_1.useGroupedCurrenciesByProvider)(true);
14
- const { currenciesByProvider } = result;
15
- expect((0, haveOneCommonProvider_1.haveOneCommonProvider)(["bitcoin"], currenciesByProvider)).toBe(true);
16
- });
17
- it("should return false for multiple currencies with different providers", () => {
18
- const { result } = (0, useGroupedCurrenciesByProvider_mock_1.useGroupedCurrenciesByProvider)(true);
19
- const { currenciesByProvider } = result;
20
- expect((0, haveOneCommonProvider_1.haveOneCommonProvider)(["bitcoin", "ethereum"], currenciesByProvider)).toBe(false);
21
- });
22
- it("should return true for multiple currencies with the same provider", () => {
23
- const { result } = (0, useGroupedCurrenciesByProvider_mock_1.useGroupedCurrenciesByProvider)(true);
24
- const { currenciesByProvider } = result;
25
- expect((0, haveOneCommonProvider_1.haveOneCommonProvider)(["ethereum", "arbitrum"], currenciesByProvider)).toBe(true);
26
- });
27
- });
28
- //# sourceMappingURL=haveOneCommonProvider.test.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"haveOneCommonProvider.test.js","sourceRoot":"","sources":["../../../../src/modularDrawer/utils/__tests__/haveOneCommonProvider.test.ts"],"names":[],"mappings":";;AAAA,oEAAiE;AACjE,6GAAqG;AAGrG,IAAI,CAAC,IAAI,CAAC,mEAAmE,EAAE,GAAG,EAAE,CAAC,CAAC;IACpF,8BAA8B,EAAE,GAAG,EAAE,CAAC,IAAA,oEAA8B,GAAE;CACvE,CAAC,CAAC,CAAC;AAEJ,QAAQ,CAAC,uBAAuB,EAAE,GAAG,EAAE;IACrC,EAAE,CAAC,wCAAwC,EAAE,GAAG,EAAE;QAChD,MAAM,CAAC,IAAA,6CAAqB,EAAC,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IACpD,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,4DAA4D,EAAE,GAAG,EAAE;QACpE,MAAM,EAAE,MAAM,EAAE,GAAG,IAAA,oEAA8B,EAAC,IAAI,CAAkC,CAAC;QACzF,MAAM,EAAE,oBAAoB,EAAE,GAAG,MAAM,CAAC;QAExC,MAAM,CAAC,IAAA,6CAAqB,EAAC,CAAC,SAAS,CAAC,EAAE,oBAAoB,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC9E,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,sEAAsE,EAAE,GAAG,EAAE;QAC9E,MAAM,EAAE,MAAM,EAAE,GAAG,IAAA,oEAA8B,EAAC,IAAI,CAAkC,CAAC;QACzF,MAAM,EAAE,oBAAoB,EAAE,GAAG,MAAM,CAAC;QAExC,MAAM,CAAC,IAAA,6CAAqB,EAAC,CAAC,SAAS,EAAE,UAAU,CAAC,EAAE,oBAAoB,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAC3F,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,mEAAmE,EAAE,GAAG,EAAE;QAC3E,MAAM,EAAE,MAAM,EAAE,GAAG,IAAA,oEAA8B,EAAC,IAAI,CAAkC,CAAC;QACzF,MAAM,EAAE,oBAAoB,EAAE,GAAG,MAAM,CAAC;QAExC,MAAM,CAAC,IAAA,6CAAqB,EAAC,CAAC,UAAU,EAAE,UAAU,CAAC,EAAE,oBAAoB,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC3F,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -1,11 +0,0 @@
1
- import { CurrenciesByProviderId } from "@ledgerhq/live-common/deposit/type";
2
- /**
3
- * This function checks if all currencies in the provided array
4
- * it stopped at the first currency that does not match to prevent unnecessary iterations.
5
- *
6
- * @param currenciesIdsArray array of currency IDs to check
7
- * @param currenciesByProvider array of currencies grouped by provider
8
- * @returns boolean indicating whether all currencies in the array have one common provider
9
- */
10
- export declare const haveOneCommonProvider: (currenciesIdsArray: string[], currenciesByProvider: CurrenciesByProviderId[]) => boolean;
11
- //# sourceMappingURL=haveOneCommonProvider.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"haveOneCommonProvider.d.ts","sourceRoot":"","sources":["../../../src/modularDrawer/utils/haveOneCommonProvider.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,oCAAoC,CAAC;AAE5E;;;;;;;GAOG;AACH,eAAO,MAAM,qBAAqB,uBACZ,MAAM,EAAE,wBACN,sBAAsB,EAAE,KAC7C,OAiBF,CAAC"}
@@ -1,29 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.haveOneCommonProvider = void 0;
4
- /**
5
- * This function checks if all currencies in the provided array
6
- * it stopped at the first currency that does not match to prevent unnecessary iterations.
7
- *
8
- * @param currenciesIdsArray array of currency IDs to check
9
- * @param currenciesByProvider array of currencies grouped by provider
10
- * @returns boolean indicating whether all currencies in the array have one common provider
11
- */
12
- const haveOneCommonProvider = (currenciesIdsArray, currenciesByProvider) => {
13
- if (currenciesIdsArray.length === 0)
14
- return false;
15
- const providerIds = new Set();
16
- for (const currencyId of currenciesIdsArray) {
17
- for (const provider of currenciesByProvider) {
18
- if (provider.currenciesByNetwork.some(currency => currency.id === currencyId)) {
19
- providerIds.add(provider.providerId);
20
- if (providerIds.size > 1) {
21
- return false;
22
- }
23
- }
24
- }
25
- }
26
- return true;
27
- };
28
- exports.haveOneCommonProvider = haveOneCommonProvider;
29
- //# sourceMappingURL=haveOneCommonProvider.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"haveOneCommonProvider.js","sourceRoot":"","sources":["../../../src/modularDrawer/utils/haveOneCommonProvider.ts"],"names":[],"mappings":";;;AAEA;;;;;;;GAOG;AACI,MAAM,qBAAqB,GAAG,CACnC,kBAA4B,EAC5B,oBAA8C,EACrC,EAAE;IACX,IAAI,kBAAkB,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,KAAK,CAAC;IAElD,MAAM,WAAW,GAAG,IAAI,GAAG,EAAU,CAAC;IAEtC,KAAK,MAAM,UAAU,IAAI,kBAAkB,EAAE;QAC3C,KAAK,MAAM,QAAQ,IAAI,oBAAoB,EAAE;YAC3C,IAAI,QAAQ,CAAC,mBAAmB,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,QAAQ,CAAC,EAAE,KAAK,UAAU,CAAC,EAAE;gBAC7E,WAAW,CAAC,GAAG,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC;gBACrC,IAAI,WAAW,CAAC,IAAI,GAAG,CAAC,EAAE;oBACxB,OAAO,KAAK,CAAC;iBACd;aACF;SACF;KACF;IAED,OAAO,IAAI,CAAC;AACd,CAAC,CAAC;AApBW,QAAA,qBAAqB,yBAoBhC"}
@@ -1,4 +0,0 @@
1
- import { CryptoAssetsStore } from "@ledgerhq/coin-framework/crypto-assets/type";
2
- export declare function setCryptoAssetsStore(store: CryptoAssetsStore): void;
3
- export declare function getCryptoAssetsStore(): CryptoAssetsStore;
4
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/bridge/crypto-assets/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,6CAA6C,CAAC;AAKhF,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,iBAAiB,QAE5D;AAUD,wBAAgB,oBAAoB,IAAI,iBAAiB,CAWxD"}
@@ -1,24 +0,0 @@
1
- import { LiveConfig } from "@ledgerhq/live-config/LiveConfig";
2
- import * as legacy from "@ledgerhq/cryptoassets/tokens";
3
- let cryptoAssetsStore = undefined;
4
- export function setCryptoAssetsStore(store) {
5
- cryptoAssetsStore = store;
6
- }
7
- const legacyStore = {
8
- findTokenByAddress: legacy.findTokenByAddress,
9
- getTokenById: legacy.getTokenById,
10
- findTokenById: legacy.findTokenById,
11
- findTokenByAddressInCurrency: legacy.findTokenByAddressInCurrency,
12
- findTokenByTicker: legacy.findTokenByTicker,
13
- };
14
- export function getCryptoAssetsStore() {
15
- const featureEnabled = LiveConfig.getValueByKey("feature_cal_lazy_loading");
16
- if (!featureEnabled) {
17
- return legacyStore;
18
- }
19
- if (!cryptoAssetsStore) {
20
- throw new Error("CryptoAssetsStore is not set. Please call setCryptoAssetsStore first.");
21
- }
22
- return cryptoAssetsStore;
23
- }
24
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/bridge/crypto-assets/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,kCAAkC,CAAC;AAE9D,OAAO,KAAK,MAAM,MAAM,+BAA+B,CAAC;AAExD,IAAI,iBAAiB,GAAkC,SAAS,CAAC;AAEjE,MAAM,UAAU,oBAAoB,CAAC,KAAwB;IAC3D,iBAAiB,GAAG,KAAK,CAAC;AAC5B,CAAC;AAED,MAAM,WAAW,GAAsB;IACrC,kBAAkB,EAAE,MAAM,CAAC,kBAAkB;IAC7C,YAAY,EAAE,MAAM,CAAC,YAAY;IACjC,aAAa,EAAE,MAAM,CAAC,aAAa;IACnC,4BAA4B,EAAE,MAAM,CAAC,4BAA4B;IACjE,iBAAiB,EAAE,MAAM,CAAC,iBAAiB;CAC5C,CAAC;AAEF,MAAM,UAAU,oBAAoB;IAClC,MAAM,cAAc,GAAG,UAAU,CAAC,aAAa,CAAC,0BAA0B,CAAC,CAAC;IAC5E,IAAI,CAAC,cAAc,EAAE;QACnB,OAAO,WAAW,CAAC;KACpB;IAED,IAAI,CAAC,iBAAiB,EAAE;QACtB,MAAM,IAAI,KAAK,CAAC,uEAAuE,CAAC,CAAC;KAC1F;IAED,OAAO,iBAAiB,CAAC;AAC3B,CAAC"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=index.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.test.d.ts","sourceRoot":"","sources":["../../../src/bridge/crypto-assets/index.test.ts"],"names":[],"mappings":""}
@@ -1,60 +0,0 @@
1
- import { LiveConfig } from "@ledgerhq/live-config/LiveConfig";
2
- import { getCryptoAssetsStore, setCryptoAssetsStore } from ".";
3
- import * as legacy from "@ledgerhq/cryptoassets/tokens";
4
- describe("Testing CryptoAssetStore", () => {
5
- it("should return the default methods from cryptoassets libs when feature flag does not exists", () => {
6
- LiveConfig.setConfig({
7
- some_other_feature: {
8
- type: "boolean",
9
- default: true,
10
- },
11
- });
12
- const store = getCryptoAssetsStore();
13
- expect(store).toEqual({
14
- findTokenByAddress: legacy.findTokenByAddress,
15
- getTokenById: legacy.getTokenById,
16
- findTokenById: legacy.findTokenById,
17
- findTokenByAddressInCurrency: legacy.findTokenByAddressInCurrency,
18
- findTokenByTicker: legacy.findTokenByTicker,
19
- });
20
- });
21
- it("should return the default methods from cryptoassets libs when feature flag is disabled", () => {
22
- LiveConfig.setConfig({
23
- feature_cal_lazy_loading: {
24
- type: "boolean",
25
- default: false,
26
- },
27
- });
28
- const store = getCryptoAssetsStore();
29
- expect(store).toEqual({
30
- findTokenByAddress: legacy.findTokenByAddress,
31
- getTokenById: legacy.getTokenById,
32
- findTokenById: legacy.findTokenById,
33
- findTokenByAddressInCurrency: legacy.findTokenByAddressInCurrency,
34
- findTokenByTicker: legacy.findTokenByTicker,
35
- });
36
- });
37
- it("should throw an error when no store is set and feature flag is enabled", () => {
38
- LiveConfig.setConfig({
39
- feature_cal_lazy_loading: {
40
- type: "boolean",
41
- default: true,
42
- },
43
- });
44
- expect(() => getCryptoAssetsStore()).toThrow("CryptoAssetsStore is not set. Please call setCryptoAssetsStore first.");
45
- });
46
- it("should throw return the new store when feature flag is enabled", () => {
47
- LiveConfig.setConfig({
48
- feature_cal_lazy_loading: {
49
- type: "boolean",
50
- default: true,
51
- },
52
- });
53
- // eslint-disable-next-line @typescript-eslint/consistent-type-assertions
54
- const newStore = {};
55
- setCryptoAssetsStore(newStore);
56
- const store = getCryptoAssetsStore();
57
- expect(store).toBe(newStore);
58
- });
59
- });
60
- //# sourceMappingURL=index.test.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.test.js","sourceRoot":"","sources":["../../../src/bridge/crypto-assets/index.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,kCAAkC,CAAC;AAC9D,OAAO,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,MAAM,GAAG,CAAC;AAC/D,OAAO,KAAK,MAAM,MAAM,+BAA+B,CAAC;AAGxD,QAAQ,CAAC,0BAA0B,EAAE,GAAG,EAAE;IACxC,EAAE,CAAC,4FAA4F,EAAE,GAAG,EAAE;QACpG,UAAU,CAAC,SAAS,CAAC;YACnB,kBAAkB,EAAE;gBAClB,IAAI,EAAE,SAAS;gBACf,OAAO,EAAE,IAAI;aACd;SACF,CAAC,CAAC;QAEH,MAAM,KAAK,G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,IAAI;aACd;SACF,CAAC,CAAC;QAEH,yEAAyE;QACzE,MAAM,QAAQ,GAAG,EAAkC,CAAC;QACpD,oBAAoB,CAAC,QAAQ,CAAC,CAAC;QAE/B,MAAM,KAAK,GAAG,oBAAoB,EAAE,CAAC;QACrC,MAAM,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IAC/B,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -1,3 +0,0 @@
1
- import { Delegate } from "../models/Delegate";
2
- export declare function delegateOsmosis(delegatingAccount: Delegate): Promise<void>;
3
- //# sourceMappingURL=osmosis.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"osmosis.d.ts","sourceRoot":"","sources":["../../../src/e2e/families/osmosis.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAK9C,wBAAsB,eAAe,CAAC,iBAAiB,EAAE,QAAQ,iBAOhE"}
@@ -1,12 +0,0 @@
1
- import { containsSubstringInEvent, pressBoth, pressUntilTextFound, waitFor } from "../speculos";
2
- import { DeviceLabels } from "../enum/DeviceLabels";
3
- import expect from "expect";
4
- export async function delegateOsmosis(delegatingAccount) {
5
- await waitFor(DeviceLabels.PLEASE_REVIEW);
6
- const events = await pressUntilTextFound(DeviceLabels.CAPS_APPROVE);
7
- const amountInUosmo = (Number(delegatingAccount.amount) * 1_000_000).toString();
8
- const isAmountCorrect = containsSubstringInEvent(amountInUosmo, events);
9
- expect(isAmountCorrect).toBeTruthy();
10
- await pressBoth();
11
- }
12
- //# sourceMappingURL=osmosis.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"osmosis.js","sourceRoot":"","sources":["../../../src/e2e/families/osmosis.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,wBAAwB,EAAE,SAAS,EAAE,mBAAmB,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAChG,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,MAAM,MAAM,QAAQ,CAAC;AAE5B,MAAM,CAAC,KAAK,UAAU,eAAe,CAAC,iBAA2B;IAC/D,MAAM,OAAO,CAAC,YAAY,CAAC,aAAa,CAAC,CAAC;IAC1C,MAAM,MAAM,GAAG,MAAM,mBAAmB,CAAC,YAAY,CAAC,YAAY,CAAC,CAAC;IACpE,MAAM,aAAa,GAAG,CAAC,MAAM,CAAC,iBAAiB,CAAC,MAAM,CAAC,GAAG,SAAS,CAAC,CAAC,QAAQ,EAAE,CAAC;IAChF,MAAM,eAAe,GAAG,wBAAwB,CAAC,aAAa,EAAE,MAAM,CAAC,CAAC;IACxE,MAAM,CAAC,eAAe,CAAC,CAAC,UAAU,EAAE,CAAC;IACrC,MAAM,SAAS,EAAE,CAAC;AACpB,CAAC"}
@@ -1,17 +0,0 @@
1
- import { TokenCurrency } from "@ledgerhq/types-cryptoassets";
2
- export declare const mockBtcCryptoCurrency: import("@ledgerhq/types-cryptoassets").CryptoCurrency;
3
- export declare const mockEthCryptoCurrency: import("@ledgerhq/types-cryptoassets").CryptoCurrency;
4
- export declare const mockArbitrumCryptoCurrency: import("@ledgerhq/types-cryptoassets").CryptoCurrency;
5
- export declare const mockBaseCryptoCurrency: import("@ledgerhq/types-cryptoassets").CryptoCurrency;
6
- export declare const mockScrollCryptoCurrency: import("@ledgerhq/types-cryptoassets").CryptoCurrency;
7
- export declare const mockInjectiveCryptoCurrency: import("@ledgerhq/types-cryptoassets").CryptoCurrency;
8
- export declare const arbitrumToken: TokenCurrency;
9
- export declare const usdcToken: TokenCurrency;
10
- export declare const findCryptoCurrencyById: (id: string) => import("@ledgerhq/types-cryptoassets").CryptoCurrency | undefined;
11
- export declare const getTokenOrCryptoCurrencyById: (id: string) => import("@ledgerhq/types-cryptoassets").CryptoCurrency | TokenCurrency | undefined;
12
- export declare const mockCurrenciesByProvider: {
13
- providerId: string;
14
- currenciesByNetwork: import("@ledgerhq/types-cryptoassets").CryptoCurrency[];
15
- }[];
16
- export declare const mockCurrencyIds: string[];
17
- //# sourceMappingURL=currencies.mock.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"currencies.mock.d.ts","sourceRoot":"","sources":["../../../src/modularDrawer/__mocks__/currencies.mock.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAE7D,eAAO,MAAM,qBAAqB,uDAAmC,CAAC;AACtE,eAAO,MAAM,qBAAqB,uDAAoC,CAAC;AACvE,eAAO,MAAM,0BAA0B,uDAAoC,CAAC;AAC5E,eAAO,MAAM,sBAAsB,uDAAgC,CAAC;AACpE,eAAO,MAAM,wBAAwB,uDAAkC,CAAC;AACxE,eAAO,MAAM,2BAA2B,uDAAqC,CAAC;AAE9E,eAAO,MAAM,aAAa,EAAE,aAe3B,CAAC;AACF,eAAO,MAAM,SAAS,EAAE,aAevB,CAAC;AAEF,eAAO,MAAM,sBAAsB,OAAQ,MAAM,sEACkD,CAAC;AACpG,eAAO,MAAM,4BAA4B,OAAQ,MAAM,sFAO7B,CAAC;AAE3B,eAAO,MAAM,wBAAwB;;;GAKpC,CAAC;AAEF,eAAO,MAAM,eAAe,UAA8C,CAAC"}
@@ -1,55 +0,0 @@
1
- import { getCryptoCurrencyById } from "@ledgerhq/live-common/currencies/index";
2
- export const mockBtcCryptoCurrency = getCryptoCurrencyById("bitcoin");
3
- export const mockEthCryptoCurrency = getCryptoCurrencyById("ethereum");
4
- export const mockArbitrumCryptoCurrency = getCryptoCurrencyById("arbitrum");
5
- export const mockBaseCryptoCurrency = getCryptoCurrencyById("base");
6
- export const mockScrollCryptoCurrency = getCryptoCurrencyById("scroll");
7
- export const mockInjectiveCryptoCurrency = getCryptoCurrencyById("injective");
8
- export const arbitrumToken = {
9
- type: "TokenCurrency",
10
- id: "arbitrum/erc20/arbitrum",
11
- contractAddress: "0x912CE59144191C1204E64559FE8253a0e49E6548",
12
- parentCurrency: mockArbitrumCryptoCurrency,
13
- tokenType: "erc20",
14
- name: "Arbitrum",
15
- ticker: "ARB",
16
- units: [
17
- {
18
- name: "Arbitrum",
19
- code: "ARB",
20
- magnitude: 18,
21
- },
22
- ],
23
- };
24
- export const usdcToken = {
25
- type: "TokenCurrency",
26
- id: "ethereum/erc20/usd__coin",
27
- contractAddress: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
28
- parentCurrency: mockEthCryptoCurrency,
29
- tokenType: "erc20",
30
- name: "USD Coin",
31
- ticker: "USDC",
32
- units: [
33
- {
34
- name: "USD Coin",
35
- code: "USDC",
36
- magnitude: 6,
37
- },
38
- ],
39
- };
40
- export const findCryptoCurrencyById = (id) => [mockBtcCryptoCurrency, mockEthCryptoCurrency, mockArbitrumCryptoCurrency].find(a => a.id === id);
41
- export const getTokenOrCryptoCurrencyById = (id) => [
42
- mockBtcCryptoCurrency,
43
- mockEthCryptoCurrency,
44
- mockArbitrumCryptoCurrency,
45
- arbitrumToken,
46
- usdcToken,
47
- ].find(a => a.id === id);
48
- export const mockCurrenciesByProvider = [
49
- {
50
- providerId: "ethereum",
51
- currenciesByNetwork: [mockEthCryptoCurrency],
52
- },
53
- ];
54
- export const mockCurrencyIds = ["bitcoin", "ethereum", "arbitrum", "base"];
55
- //# sourceMappingURL=currencies.mock.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"currencies.mock.js","sourceRoot":"","sources":["../../../src/modularDrawer/__mocks__/currencies.mock.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,wCAAwC,CAAC;AAG/E,MAAM,CAAC,MAAM,qBAAqB,GAAG,qBAAqB,CAAC,SAAS,CAAC,CAAC;AACtE,MAAM,CAAC,MAAM,qBAAqB,GAAG,qBAAqB,CAAC,UAAU,CAAC,CAAC;AACvE,MAAM,CAAC,MAAM,0BAA0B,GAAG,qBAAqB,CAAC,UAAU,CAAC,CAAC;AAC5E,MAAM,CAAC,MAAM,sBAAsB,GAAG,qBAAqB,CAAC,MAA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