@ledgerhq/live-common 34.42.0-nightly.3 → 34.42.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/__tests__/migration/account-migration.js +0 -3
- package/lib/__tests__/migration/account-migration.js.map +1 -1
- package/lib/__tests__/test-helpers/environment.js +0 -3
- package/lib/__tests__/test-helpers/environment.js.map +1 -1
- package/lib/bridge/generic-alpaca/alpaca/network/network-alpaca.d.ts +1 -3
- package/lib/bridge/generic-alpaca/alpaca/network/network-alpaca.d.ts.map +1 -1
- package/lib/bridge/generic-alpaca/alpaca/network/network-alpaca.js +0 -6
- package/lib/bridge/generic-alpaca/alpaca/network/network-alpaca.js.map +1 -1
- package/lib/bridge/impl.d.ts +0 -2
- package/lib/bridge/impl.d.ts.map +1 -1
- package/lib/bridge/impl.js +1 -8
- package/lib/bridge/impl.js.map +1 -1
- package/lib/bridge/useBridgeTransaction.test.js +1 -1
- package/lib/bridge/useBridgeTransaction.test.js.map +1 -1
- package/lib/e2e/index.d.ts +0 -6
- package/lib/e2e/index.d.ts.map +1 -1
- package/lib/e2e/speculos.d.ts.map +1 -1
- package/lib/e2e/speculos.js +2 -5
- package/lib/e2e/speculos.js.map +1 -1
- package/lib/families/evm/config.d.ts.map +1 -1
- package/lib/families/evm/config.js +0 -51
- package/lib/families/evm/config.js.map +1 -1
- package/lib/families/evm/walletApiAdapter.js +1 -1
- package/lib/featureFlags/defaultFeatures.d.ts +0 -3
- package/lib/featureFlags/defaultFeatures.d.ts.map +1 -1
- package/lib/featureFlags/defaultFeatures.js +0 -3
- package/lib/featureFlags/defaultFeatures.js.map +1 -1
- package/lib/modularDrawer/utils/index.d.ts +1 -2
- package/lib/modularDrawer/utils/index.d.ts.map +1 -1
- package/lib/modularDrawer/utils/index.js +1 -3
- package/lib/modularDrawer/utils/index.js.map +1 -1
- package/lib/wallet-api/Exchange/server.d.ts.map +1 -1
- package/lib/wallet-api/Exchange/server.js +6 -6
- package/lib/wallet-api/Exchange/server.js.map +1 -1
- package/lib-es/__tests__/migration/account-migration.js +0 -3
- package/lib-es/__tests__/migration/account-migration.js.map +1 -1
- package/lib-es/__tests__/test-helpers/environment.js +0 -3
- package/lib-es/__tests__/test-helpers/environment.js.map +1 -1
- package/lib-es/bridge/generic-alpaca/alpaca/network/network-alpaca.d.ts +1 -3
- package/lib-es/bridge/generic-alpaca/alpaca/network/network-alpaca.d.ts.map +1 -1
- package/lib-es/bridge/generic-alpaca/alpaca/network/network-alpaca.js +0 -6
- package/lib-es/bridge/generic-alpaca/alpaca/network/network-alpaca.js.map +1 -1
- package/lib-es/bridge/impl.d.ts +0 -2
- package/lib-es/bridge/impl.d.ts.map +1 -1
- package/lib-es/bridge/impl.js +0 -6
- package/lib-es/bridge/impl.js.map +1 -1
- package/lib-es/bridge/useBridgeTransaction.test.js +1 -1
- package/lib-es/bridge/useBridgeTransaction.test.js.map +1 -1
- package/lib-es/e2e/index.d.ts +0 -6
- package/lib-es/e2e/index.d.ts.map +1 -1
- package/lib-es/e2e/speculos.d.ts.map +1 -1
- package/lib-es/e2e/speculos.js +2 -5
- package/lib-es/e2e/speculos.js.map +1 -1
- package/lib-es/families/evm/config.d.ts.map +1 -1
- package/lib-es/families/evm/config.js +0 -51
- package/lib-es/families/evm/config.js.map +1 -1
- package/lib-es/families/evm/walletApiAdapter.js +1 -1
- package/lib-es/featureFlags/defaultFeatures.d.ts +0 -3
- package/lib-es/featureFlags/defaultFeatures.d.ts.map +1 -1
- package/lib-es/featureFlags/defaultFeatures.js +0 -3
- package/lib-es/featureFlags/defaultFeatures.js.map +1 -1
- package/lib-es/modularDrawer/utils/index.d.ts +1 -2
- package/lib-es/modularDrawer/utils/index.d.ts.map +1 -1
- package/lib-es/modularDrawer/utils/index.js +1 -2
- package/lib-es/modularDrawer/utils/index.js.map +1 -1
- package/lib-es/wallet-api/Exchange/server.d.ts.map +1 -1
- package/lib-es/wallet-api/Exchange/server.js +6 -6
- package/lib-es/wallet-api/Exchange/server.js.map +1 -1
- package/package.json +64 -64
- package/src/__tests__/migration/account-migration.ts +0 -3
- package/src/__tests__/test-helpers/environment.ts +0 -3
- package/src/bridge/generic-alpaca/alpaca/network/network-alpaca.ts +1 -8
- package/src/bridge/impl.ts +0 -8
- package/src/bridge/useBridgeTransaction.test.ts +1 -1
- package/src/e2e/speculos.ts +2 -5
- package/src/families/evm/config.ts +0 -51
- package/src/families/evm/walletApiAdapter.ts +1 -1
- package/src/featureFlags/defaultFeatures.ts +0 -3
- package/src/modularDrawer/utils/index.ts +1 -2
- package/src/wallet-api/Exchange/server.ts +6 -7
- package/lib/bridge/crypto-assets/index.d.ts +0 -4
- package/lib/bridge/crypto-assets/index.d.ts.map +0 -1
- package/lib/bridge/crypto-assets/index.js +0 -52
- package/lib/bridge/crypto-assets/index.js.map +0 -1
- package/lib/bridge/crypto-assets/index.test.d.ts +0 -2
- package/lib/bridge/crypto-assets/index.test.d.ts.map +0 -1
- package/lib/bridge/crypto-assets/index.test.js +0 -85
- package/lib/bridge/crypto-assets/index.test.js.map +0 -1
- package/lib/e2e/families/osmosis.d.ts +0 -3
- package/lib/e2e/families/osmosis.d.ts.map +0 -1
- package/lib/e2e/families/osmosis.js +0 -19
- package/lib/e2e/families/osmosis.js.map +0 -1
- package/lib/modularDrawer/__mocks__/currencies.mock.d.ts +0 -17
- package/lib/modularDrawer/__mocks__/currencies.mock.d.ts.map +0 -1
- package/lib/modularDrawer/__mocks__/currencies.mock.js +0 -60
- package/lib/modularDrawer/__mocks__/currencies.mock.js.map +0 -1
- package/lib/modularDrawer/__mocks__/useGroupedCurrenciesByProvider.mock.d.ts +0 -22
- package/lib/modularDrawer/__mocks__/useGroupedCurrenciesByProvider.mock.d.ts.map +0 -1
- package/lib/modularDrawer/__mocks__/useGroupedCurrenciesByProvider.mock.js +0 -41
- package/lib/modularDrawer/__mocks__/useGroupedCurrenciesByProvider.mock.js.map +0 -1
- package/lib/modularDrawer/utils/__tests__/haveOneCommonProvider.test.d.ts +0 -2
- package/lib/modularDrawer/utils/__tests__/haveOneCommonProvider.test.d.ts.map +0 -1
- package/lib/modularDrawer/utils/__tests__/haveOneCommonProvider.test.js +0 -28
- package/lib/modularDrawer/utils/__tests__/haveOneCommonProvider.test.js.map +0 -1
- package/lib/modularDrawer/utils/haveOneCommonProvider.d.ts +0 -11
- package/lib/modularDrawer/utils/haveOneCommonProvider.d.ts.map +0 -1
- package/lib/modularDrawer/utils/haveOneCommonProvider.js +0 -29
- package/lib/modularDrawer/utils/haveOneCommonProvider.js.map +0 -1
- package/lib-es/bridge/crypto-assets/index.d.ts +0 -4
- package/lib-es/bridge/crypto-assets/index.d.ts.map +0 -1
- package/lib-es/bridge/crypto-assets/index.js +0 -24
- package/lib-es/bridge/crypto-assets/index.js.map +0 -1
- package/lib-es/bridge/crypto-assets/index.test.d.ts +0 -2
- package/lib-es/bridge/crypto-assets/index.test.d.ts.map +0 -1
- package/lib-es/bridge/crypto-assets/index.test.js +0 -60
- package/lib-es/bridge/crypto-assets/index.test.js.map +0 -1
- package/lib-es/e2e/families/osmosis.d.ts +0 -3
- package/lib-es/e2e/families/osmosis.d.ts.map +0 -1
- package/lib-es/e2e/families/osmosis.js +0 -12
- package/lib-es/e2e/families/osmosis.js.map +0 -1
- package/lib-es/modularDrawer/__mocks__/currencies.mock.d.ts +0 -17
- package/lib-es/modularDrawer/__mocks__/currencies.mock.d.ts.map +0 -1
- package/lib-es/modularDrawer/__mocks__/currencies.mock.js +0 -55
- package/lib-es/modularDrawer/__mocks__/currencies.mock.js.map +0 -1
- package/lib-es/modularDrawer/__mocks__/useGroupedCurrenciesByProvider.mock.d.ts +0 -22
- package/lib-es/modularDrawer/__mocks__/useGroupedCurrenciesByProvider.mock.d.ts.map +0 -1
- package/lib-es/modularDrawer/__mocks__/useGroupedCurrenciesByProvider.mock.js +0 -38
- package/lib-es/modularDrawer/__mocks__/useGroupedCurrenciesByProvider.mock.js.map +0 -1
- package/lib-es/modularDrawer/utils/__tests__/haveOneCommonProvider.test.d.ts +0 -2
- package/lib-es/modularDrawer/utils/__tests__/haveOneCommonProvider.test.d.ts.map +0 -1
- package/lib-es/modularDrawer/utils/__tests__/haveOneCommonProvider.test.js +0 -26
- package/lib-es/modularDrawer/utils/__tests__/haveOneCommonProvider.test.js.map +0 -1
- package/lib-es/modularDrawer/utils/haveOneCommonProvider.d.ts +0 -11
- package/lib-es/modularDrawer/utils/haveOneCommonProvider.d.ts.map +0 -1
- package/lib-es/modularDrawer/utils/haveOneCommonProvider.js +0 -25
- package/lib-es/modularDrawer/utils/haveOneCommonProvider.js.map +0 -1
- package/src/bridge/crypto-assets/index.test.ts +0 -71
- package/src/bridge/crypto-assets/index.ts +0 -30
- package/src/e2e/families/osmosis.ts +0 -13
- package/src/modularDrawer/__mocks__/currencies.mock.ts +0 -62
- package/src/modularDrawer/__mocks__/useGroupedCurrenciesByProvider.mock.ts +0 -49
- package/src/modularDrawer/utils/__tests__/haveOneCommonProvider.test.ts +0 -34
- package/src/modularDrawer/utils/haveOneCommonProvider.ts +0 -31
@@ -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 +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 +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 +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,GAAG,oBAAoB,EAAE,CAAC;QACrC,MAAM,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC;YACpB,kBAAkB,EAAE,MAAM,CAAC,kBAAkB;YAC7C,YAAY,EAAE,MAAM,CAAC,YAAY;YACjC,aAAa,EAAE,MAAM,CAAC,aAAa;YACnC,4BAA4B,EAAE,MAAM,CAAC,4BAA4B;YACjE,iBAAiB,EAAE,MAAM,CAAC,iBAAiB;SAC5C,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,wFAAwF,EAAE,GAAG,EAAE;QAChG,UAAU,CAAC,SAAS,CAAC;YACnB,wBAAwB,EAAE;gBACxB,IAAI,EAAE,SAAS;gBACf,OAAO,EAAE,KAAK;aACf;SACF,CAAC,CAAC;QAEH,MAAM,KAAK,GAAG,oBAAoB,EAAE,CAAC;QACrC,MAAM,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC;YACpB,kBAAkB,EAAE,MAAM,CAAC,kBAAkB;YAC7C,YAAY,EAAE,MAAM,CAAC,YAAY;YACjC,aAAa,EAAE,MAAM,CAAC,aAAa;YACnC,4BAA4B,EAAE,MAAM,CAAC,4BAA4B;YACjE,iBAAiB,EAAE,MAAM,CAAC,iBAAiB;SAC5C,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,wEAAwE,EAAE,GAAG,EAAE;QAChF,UAAU,CAAC,SAAS,CAAC;YACnB,wBAAwB,EAAE;gBACxB,IAAI,EAAE,SAAS;gBACf,OAAO,EAAE,IAAI;aACd;SACF,CAAC,CAAC;QAEH,MAAM,CAAC,GAAG,EAAE,CAAC,oBAAoB,EAAE,CAAC,CAAC,OAAO,CAC1C,uEAAuE,CACxE,CAAC;IACJ,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,gEAAgE,EAAE,GAAG,EAAE;QACxE,UAAU,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,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 +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,MAAM,CAAC,CAAC;AACpE,MAAM,CAAC,MAAM,wBAAwB,GAAG,qBAAqB,CAAC,QAAQ,CAAC,CAAC;AACxE,MAAM,CAAC,MAAM,2BAA2B,GAAG,qBAAqB,CAAC,WAAW,CAAC,CAAC;AAE9E,MAAM,CAAC,MAAM,aAAa,GAAkB;IAC1C,IAAI,EAAE,eAAe;IACrB,EAAE,EAAE,yBAAyB;IAC7B,eAAe,EAAE,4CAA4C;IAC7D,cAAc,EAAE,0BAA0B;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;AACF,MAAM,CAAC,MAAM,SAAS,GAAkB;IACtC,IAAI,EAAE,eAAe;IACrB,EAAE,EAAE,0BAA0B;IAC9B,eAAe,EAAE,4CAA4C;IAC7D,cAAc,EAAE,qBAAqB;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;AAEF,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,EAAU,EAAE,EAAE,CACnD,CAAC,qBAAqB,EAAE,qBAAqB,EAAE,0BAA0B,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC;AACpG,MAAM,CAAC,MAAM,4BAA4B,GAAG,CAAC,EAAU,EAAE,EAAE,CACzD;IACE,qBAAqB;IACrB,qBAAqB;IACrB,0BAA0B;IAC1B,aAAa;IACb,SAAS;CACV,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC;AAE3B,MAAM,CAAC,MAAM,wBAAwB,GAAG;IACtC;QACE,UAAU,EAAE,UAAU;QACtB,mBAAmB,EAAE,CAAC,qBAAqB,CAAC;KAC7C;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,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,38 +0,0 @@
|
|
1
|
-
import { LoadingStatus } from "@ledgerhq/live-common/deposit/type";
|
2
|
-
import { arbitrumToken, mockArbitrumCryptoCurrency, mockBaseCryptoCurrency, mockBtcCryptoCurrency, mockEthCryptoCurrency, mockInjectiveCryptoCurrency, mockScrollCryptoCurrency, usdcToken, } from "./currencies.mock";
|
3
|
-
export const providers = [
|
4
|
-
{
|
5
|
-
providerId: "bitcoin",
|
6
|
-
currenciesByNetwork: [mockBtcCryptoCurrency],
|
7
|
-
},
|
8
|
-
{
|
9
|
-
providerId: "ethereum",
|
10
|
-
currenciesByNetwork: [
|
11
|
-
mockEthCryptoCurrency,
|
12
|
-
mockArbitrumCryptoCurrency,
|
13
|
-
mockBaseCryptoCurrency,
|
14
|
-
mockScrollCryptoCurrency,
|
15
|
-
],
|
16
|
-
},
|
17
|
-
{ providerId: "arbitrum", currenciesByNetwork: [arbitrumToken] },
|
18
|
-
{ providerId: "usd-coin", currenciesByNetwork: [usdcToken] },
|
19
|
-
{ providerId: "injective-protocol", currenciesByNetwork: [mockInjectiveCryptoCurrency] },
|
20
|
-
];
|
21
|
-
export const res = {
|
22
|
-
result: {
|
23
|
-
currenciesByProvider: providers,
|
24
|
-
sortedCryptoCurrencies: [
|
25
|
-
mockBtcCryptoCurrency,
|
26
|
-
mockEthCryptoCurrency,
|
27
|
-
mockArbitrumCryptoCurrency,
|
28
|
-
mockBaseCryptoCurrency,
|
29
|
-
mockScrollCryptoCurrency,
|
30
|
-
mockInjectiveCryptoCurrency,
|
31
|
-
],
|
32
|
-
},
|
33
|
-
};
|
34
|
-
export const useGroupedCurrenciesByProvider = jest.fn(() => ({
|
35
|
-
...res,
|
36
|
-
loadingStatus: LoadingStatus.Success,
|
37
|
-
}));
|
38
|
-
//# 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,OAAO,EAAE,aAAa,EAAE,MAAM,oCAAoC,CAAC;AACnE,OAAO,EACL,aAAa,EACb,0BAA0B,EAC1B,sBAAsB,EACtB,qBAAqB,EACrB,qBAAqB,EACrB,2BAA2B,EAC3B,wBAAwB,EACxB,SAAS,GACV,MAAM,mBAAmB,CAAC;AAE3B,MAAM,CAAC,MAAM,SAAS,GAAG;IACvB;QACE,UAAU,EAAE,SAAS;QACrB,mBAAmB,EAAE,CAAC,qBAAqB,CAAC;KAC7C;IACD;QACE,UAAU,EAAE,UAAU;QACtB,mBAAmB,EAAE;YACnB,qBAAqB;YACrB,0BAA0B;YAC1B,sBAAsB;YACtB,wBAAwB;SACzB;KACF;IACD,EAAE,UAAU,EAAE,UAAU,EAAE,mBAAmB,EAAE,CAAC,aAAa,CAAC,EAAE;IAChE,EAAE,UAAU,EAAE,UAAU,EAAE,mBAAmB,EAAE,CAAC,SAAS,CAAC,EAAE;IAC5D,EAAE,UAAU,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,CAAC,2BAA2B,CAAC,EAAE;CACzF,CAAC;AAEF,MAAM,CAAC,MAAM,GAAG,GAAG;IACjB,MAAM,EAAE;QACN,oBAAoB,EAAE,SAAS;QAC/B,sBAAsB,EAAE;YACtB,qBAAqB;YACrB,qBAAqB;YACrB,0BAA0B;YAC1B,sBAAsB;YACtB,wBAAwB;YACxB,2BAA2B;SAC5B;KACF;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,8BAA8B,GAAc,IAAI,CAAC,EAAE,CAAC,GAAG,EAAE,CAAC,CAAC;IACtE,GAAG,GAAG;IACN,aAAa,EAAE,aAAa,CAAC,OAAO;CACrC,CAAC,CAAC,CAAC"}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"haveOneCommonProvider.test.d.ts","sourceRoot":"","sources":["../../../../src/modularDrawer/utils/__tests__/haveOneCommonProvider.test.ts"],"names":[],"mappings":""}
|
@@ -1,26 +0,0 @@
|
|
1
|
-
import { haveOneCommonProvider } from "../haveOneCommonProvider";
|
2
|
-
import { useGroupedCurrenciesByProvider } from "../../__mocks__/useGroupedCurrenciesByProvider.mock";
|
3
|
-
jest.mock("@ledgerhq/live-common/deposit/useGroupedCurrenciesByProvider.hook", () => ({
|
4
|
-
useGroupedCurrenciesByProvider: () => useGroupedCurrenciesByProvider(),
|
5
|
-
}));
|
6
|
-
describe("haveOneCommonProvider", () => {
|
7
|
-
it("should return false for an empty array", () => {
|
8
|
-
expect(haveOneCommonProvider([], [])).toBe(false);
|
9
|
-
});
|
10
|
-
it("should return true for a single currency with one provider", () => {
|
11
|
-
const { result } = useGroupedCurrenciesByProvider(true);
|
12
|
-
const { currenciesByProvider } = result;
|
13
|
-
expect(haveOneCommonProvider(["bitcoin"], currenciesByProvider)).toBe(true);
|
14
|
-
});
|
15
|
-
it("should return false for multiple currencies with different providers", () => {
|
16
|
-
const { result } = useGroupedCurrenciesByProvider(true);
|
17
|
-
const { currenciesByProvider } = result;
|
18
|
-
expect(haveOneCommonProvider(["bitcoin", "ethereum"], currenciesByProvider)).toBe(false);
|
19
|
-
});
|
20
|
-
it("should return true for multiple currencies with the same provider", () => {
|
21
|
-
const { result } = useGroupedCurrenciesByProvider(true);
|
22
|
-
const { currenciesByProvider } = result;
|
23
|
-
expect(haveOneCommonProvider(["ethereum", "arbitrum"], currenciesByProvider)).toBe(true);
|
24
|
-
});
|
25
|
-
});
|
26
|
-
//# 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,OAAO,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AACjE,OAAO,EAAE,8BAA8B,EAAE,MAAM,qDAAqD,CAAC;AAGrG,IAAI,CAAC,IAAI,CAAC,mEAAmE,EAAE,GAAG,EAAE,CAAC,CAAC;IACpF,8BAA8B,EAAE,GAAG,EAAE,CAAC,8BAA8B,EAAE;CACvE,CAAC,CAAC,CAAC;AAEJ,QAAQ,CAAC,uBAAuB,EAAE,GAAG,EAAE;IACrC,EAAE,CAAC,wCAAwC,EAAE,GAAG,EAAE;QAChD,MAAM,CAAC,qBAAqB,CAAC,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,8BAA8B,CAAC,IAAI,CAAkC,CAAC;QACzF,MAAM,EAAE,oBAAoB,EAAE,GAAG,MAAM,CAAC;QAExC,MAAM,CAAC,qBAAqB,CAAC,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,8BAA8B,CAAC,IAAI,CAAkC,CAAC;QACzF,MAAM,EAAE,oBAAoB,EAAE,GAAG,MAAM,CAAC;QAExC,MAAM,CAAC,qBAAqB,CAAC,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,8BAA8B,CAAC,IAAI,CAAkC,CAAC;QACzF,MAAM,EAAE,oBAAoB,EAAE,GAAG,MAAM,CAAC;QAExC,MAAM,CAAC,qBAAqB,CAAC,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,25 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* This function checks if all currencies in the provided array
|
3
|
-
* it stopped at the first currency that does not match to prevent unnecessary iterations.
|
4
|
-
*
|
5
|
-
* @param currenciesIdsArray array of currency IDs to check
|
6
|
-
* @param currenciesByProvider array of currencies grouped by provider
|
7
|
-
* @returns boolean indicating whether all currencies in the array have one common provider
|
8
|
-
*/
|
9
|
-
export const haveOneCommonProvider = (currenciesIdsArray, currenciesByProvider) => {
|
10
|
-
if (currenciesIdsArray.length === 0)
|
11
|
-
return false;
|
12
|
-
const providerIds = new Set();
|
13
|
-
for (const currencyId of currenciesIdsArray) {
|
14
|
-
for (const provider of currenciesByProvider) {
|
15
|
-
if (provider.currenciesByNetwork.some(currency => currency.id === currencyId)) {
|
16
|
-
providerIds.add(provider.providerId);
|
17
|
-
if (providerIds.size > 1) {
|
18
|
-
return false;
|
19
|
-
}
|
20
|
-
}
|
21
|
-
}
|
22
|
-
}
|
23
|
-
return true;
|
24
|
-
};
|
25
|
-
//# sourceMappingURL=haveOneCommonProvider.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"haveOneCommonProvider.js","sourceRoot":"","sources":["../../../src/modularDrawer/utils/haveOneCommonProvider.ts"],"names":[],"mappings":"AAEA;;;;;;;GAOG;AACH,MAAM,CAAC,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"}
|