@ledgerhq/live-common 34.43.0 → 34.44.0-nightly.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/DataModel.test.js +6 -0
- package/lib/DataModel.test.js.map +1 -1
- package/lib/__fixtures__/solana-spl-epjfwdd5aufqssqem2qn1xzybapc8g4weggkzwytdt1v.json +53 -0
- package/lib/__tests__/accounts/groupPerDay.js +10 -0
- package/lib/__tests__/accounts/groupPerDay.js.map +1 -1
- package/lib/__tests__/test-helpers/environment.js +1 -0
- package/lib/__tests__/test-helpers/environment.js.map +1 -1
- package/lib/__tests__/test-helpers/setup.d.ts.map +1 -1
- package/lib/__tests__/test-helpers/setup.js +6 -0
- package/lib/__tests__/test-helpers/setup.js.map +1 -1
- package/lib/account/serialization.test.js +17 -1
- package/lib/account/serialization.test.js.map +1 -1
- package/lib/appSupportsQuitApp.d.ts +1 -0
- package/lib/appSupportsQuitApp.d.ts.map +1 -1
- package/lib/appSupportsQuitApp.js +1 -0
- package/lib/appSupportsQuitApp.js.map +1 -1
- package/lib/appSupportsQuitApp.test.js +28 -3
- package/lib/appSupportsQuitApp.test.js.map +1 -1
- package/lib/bridge/crypto-assets/index.d.ts.map +1 -1
- package/lib/bridge/crypto-assets/index.js +5 -5
- package/lib/bridge/crypto-assets/index.js.map +1 -1
- package/lib/bridge/generic-alpaca/alpaca/index.d.ts +1 -1
- package/lib/bridge/generic-alpaca/alpaca/index.d.ts.map +1 -1
- package/lib/bridge/generic-alpaca/alpaca/index.js.map +1 -1
- package/lib/bridge/generic-alpaca/alpaca/network/network-alpaca.d.ts +2 -6
- package/lib/bridge/generic-alpaca/alpaca/network/network-alpaca.d.ts.map +1 -1
- package/lib/bridge/generic-alpaca/alpaca/network/network-alpaca.js.map +1 -1
- package/lib/bridge/generic-alpaca/getAccountShape.d.ts.map +1 -1
- package/lib/bridge/generic-alpaca/getAccountShape.js +5 -6
- package/lib/bridge/generic-alpaca/getAccountShape.js.map +1 -1
- package/lib/bridge/generic-alpaca/signOperation.js.map +1 -1
- package/lib/bridge/generic-alpaca/utils.d.ts +3 -2
- package/lib/bridge/generic-alpaca/utils.d.ts.map +1 -1
- package/lib/bridge/generic-alpaca/utils.js +6 -2
- package/lib/bridge/generic-alpaca/utils.js.map +1 -1
- package/lib/bridge/generic-alpaca/utils.test.d.ts +2 -0
- package/lib/bridge/generic-alpaca/utils.test.d.ts.map +1 -0
- package/lib/bridge/generic-alpaca/utils.test.js +20 -0
- package/lib/bridge/generic-alpaca/utils.test.js.map +1 -0
- package/lib/currencies/sortByMarketcap.test.js +5 -0
- package/lib/currencies/sortByMarketcap.test.js.map +1 -1
- package/lib/e2e/enum/Currency.js +1 -1
- package/lib/e2e/enum/Currency.js.map +1 -1
- package/lib/e2e/enum/Provider.d.ts +1 -0
- package/lib/e2e/enum/Provider.d.ts.map +1 -1
- package/lib/e2e/enum/Provider.js +1 -0
- package/lib/e2e/enum/Provider.js.map +1 -1
- package/lib/e2e/index.d.ts +3 -0
- package/lib/e2e/index.d.ts.map +1 -1
- package/lib/e2e/speculos.d.ts.map +1 -1
- package/lib/e2e/speculos.js +45 -15
- package/lib/e2e/speculos.js.map +1 -1
- package/lib/e2e/speculosCI.d.ts.map +1 -1
- package/lib/e2e/speculosCI.js +22 -4
- package/lib/e2e/speculosCI.js.map +1 -1
- package/lib/env.react.d.ts +1 -1
- package/lib/env.react.d.ts.map +1 -1
- package/lib/families/bitcoin/satstack.test.js +6 -0
- package/lib/families/bitcoin/satstack.test.js.map +1 -1
- package/lib/families/canton/bridge.integration.test.d.ts +2 -0
- package/lib/families/canton/bridge.integration.test.d.ts.map +1 -0
- package/lib/families/canton/bridge.integration.test.js +7 -0
- package/lib/families/canton/bridge.integration.test.js.map +1 -0
- package/lib/families/canton/config.d.ts +3 -0
- package/lib/families/canton/config.d.ts.map +1 -0
- package/lib/families/canton/config.js +14 -0
- package/lib/families/canton/config.js.map +1 -0
- package/lib/families/canton/logic.d.ts +2 -0
- package/lib/families/canton/logic.d.ts.map +1 -0
- package/lib/families/canton/logic.js +19 -0
- package/lib/families/canton/logic.js.map +1 -0
- package/lib/families/canton/setup.d.ts +27 -0
- package/lib/families/canton/setup.d.ts.map +1 -0
- package/lib/families/canton/setup.js +27 -0
- package/lib/families/canton/setup.js.map +1 -0
- package/lib/families/canton/types.d.ts +2 -0
- package/lib/families/canton/types.d.ts.map +1 -0
- package/lib/families/canton/types.js +19 -0
- package/lib/families/canton/types.js.map +1 -0
- package/lib/families/solana/bridge/mock-data.d.ts.map +1 -1
- package/lib/families/solana/bridge/mock-data.js +46 -316
- package/lib/families/solana/bridge/mock-data.js.map +1 -1
- package/lib/families/solana/bridge/mock.js +2 -2
- package/lib/families/solana/bridge/mock.js.map +1 -1
- package/lib/families/stellar/ui.d.ts +6 -0
- package/lib/families/stellar/ui.d.ts.map +1 -0
- package/lib/families/stellar/ui.js +18 -0
- package/lib/families/stellar/ui.js.map +1 -0
- package/lib/families/tron/data.mock.d.ts.map +1 -1
- package/lib/families/tron/data.mock.js +6 -0
- package/lib/families/tron/data.mock.js.map +1 -1
- package/lib/featureFlags/defaultFeatures.d.ts +1 -0
- package/lib/featureFlags/defaultFeatures.d.ts.map +1 -1
- package/lib/featureFlags/defaultFeatures.js +1 -0
- package/lib/featureFlags/defaultFeatures.js.map +1 -1
- package/lib/generated/bridge/js.d.ts +1 -0
- package/lib/generated/bridge/js.d.ts.map +1 -1
- package/lib/generated/bridge/js.js +40 -38
- package/lib/generated/bridge/js.js.map +1 -1
- package/lib/generated/cli-transaction.d.ts +20 -0
- package/lib/generated/cli-transaction.d.ts.map +1 -1
- package/lib/generated/cli-transaction.js +42 -40
- package/lib/generated/cli-transaction.js.map +1 -1
- package/lib/generated/deviceTransactionConfig.d.ts +2 -0
- package/lib/generated/deviceTransactionConfig.d.ts.map +1 -1
- package/lib/generated/deviceTransactionConfig.js +38 -36
- package/lib/generated/deviceTransactionConfig.js.map +1 -1
- package/lib/generated/hw-getAddress.d.ts +1 -0
- package/lib/generated/hw-getAddress.d.ts.map +1 -1
- package/lib/generated/hw-getAddress.js +42 -40
- package/lib/generated/hw-getAddress.js.map +1 -1
- package/lib/generated/specs.d.ts +2 -0
- package/lib/generated/specs.d.ts.map +1 -1
- package/lib/generated/specs.js +40 -38
- package/lib/generated/specs.js.map +1 -1
- package/lib/generated/transaction.d.ts +8 -0
- package/lib/generated/transaction.d.ts.map +1 -1
- package/lib/generated/transaction.js +42 -40
- package/lib/generated/transaction.js.map +1 -1
- package/lib/generated/types.d.ts +5 -4
- package/lib/generated/types.d.ts.map +1 -1
- package/lib/modularDrawer/__mocks__/accounts.mock.d.ts +18 -0
- package/lib/modularDrawer/__mocks__/accounts.mock.d.ts.map +1 -0
- package/lib/modularDrawer/__mocks__/accounts.mock.js +48 -0
- package/lib/modularDrawer/__mocks__/accounts.mock.js.map +1 -0
- package/lib/modularDrawer/utils/__tests__/currencyUtils.test.d.ts +2 -0
- package/lib/modularDrawer/utils/__tests__/currencyUtils.test.d.ts.map +1 -0
- package/lib/modularDrawer/utils/__tests__/currencyUtils.test.js +100 -0
- package/lib/modularDrawer/utils/__tests__/currencyUtils.test.js.map +1 -0
- package/lib/modularDrawer/utils/currencyUtils.d.ts +10 -0
- package/lib/modularDrawer/utils/currencyUtils.d.ts.map +1 -0
- package/lib/modularDrawer/utils/currencyUtils.js +74 -0
- package/lib/modularDrawer/utils/currencyUtils.js.map +1 -0
- package/lib/modularDrawer/utils/haveOneCommonProvider.d.ts +1 -1
- package/lib/modularDrawer/utils/haveOneCommonProvider.d.ts.map +1 -1
- package/lib/utils/__tests__/composeHooks.test.d.ts +2 -0
- package/lib/utils/__tests__/composeHooks.test.d.ts.map +1 -0
- package/lib/utils/__tests__/composeHooks.test.js +35 -0
- package/lib/utils/__tests__/composeHooks.test.js.map +1 -0
- package/lib/utils/__tests__/getAccountTuplesForCurrency.test.d.ts +2 -0
- package/lib/utils/__tests__/getAccountTuplesForCurrency.test.d.ts.map +1 -0
- package/lib/utils/__tests__/getAccountTuplesForCurrency.test.js +104 -0
- package/lib/utils/__tests__/getAccountTuplesForCurrency.test.js.map +1 -0
- package/lib/utils/composeHooks.d.ts +11 -0
- package/lib/utils/composeHooks.d.ts.map +1 -0
- package/lib/utils/composeHooks.js +25 -0
- package/lib/utils/composeHooks.js.map +1 -0
- package/lib/utils/getAccountTuplesForCurrency.d.ts +8 -0
- package/lib/utils/getAccountTuplesForCurrency.d.ts.map +1 -0
- package/lib/utils/getAccountTuplesForCurrency.js +19 -0
- package/lib/utils/getAccountTuplesForCurrency.js.map +1 -0
- package/lib/wallet-api/helpers.d.ts +1 -0
- package/lib/wallet-api/helpers.d.ts.map +1 -1
- package/lib/wallet-api/helpers.js +16 -1
- package/lib/wallet-api/helpers.js.map +1 -1
- package/lib-es/DataModel.test.js +6 -0
- package/lib-es/DataModel.test.js.map +1 -1
- package/lib-es/__fixtures__/solana-spl-epjfwdd5aufqssqem2qn1xzybapc8g4weggkzwytdt1v.json +53 -0
- package/lib-es/__tests__/accounts/groupPerDay.js +10 -0
- package/lib-es/__tests__/accounts/groupPerDay.js.map +1 -1
- package/lib-es/__tests__/test-helpers/environment.js +1 -0
- package/lib-es/__tests__/test-helpers/environment.js.map +1 -1
- package/lib-es/__tests__/test-helpers/setup.d.ts.map +1 -1
- package/lib-es/__tests__/test-helpers/setup.js +6 -0
- package/lib-es/__tests__/test-helpers/setup.js.map +1 -1
- package/lib-es/account/serialization.test.js +15 -2
- package/lib-es/account/serialization.test.js.map +1 -1
- package/lib-es/appSupportsQuitApp.d.ts +1 -0
- package/lib-es/appSupportsQuitApp.d.ts.map +1 -1
- package/lib-es/appSupportsQuitApp.js +1 -0
- package/lib-es/appSupportsQuitApp.js.map +1 -1
- package/lib-es/appSupportsQuitApp.test.js +6 -1
- package/lib-es/appSupportsQuitApp.test.js.map +1 -1
- package/lib-es/bridge/crypto-assets/index.d.ts.map +1 -1
- package/lib-es/bridge/crypto-assets/index.js +4 -4
- package/lib-es/bridge/crypto-assets/index.js.map +1 -1
- package/lib-es/bridge/generic-alpaca/alpaca/index.d.ts +1 -1
- package/lib-es/bridge/generic-alpaca/alpaca/index.d.ts.map +1 -1
- package/lib-es/bridge/generic-alpaca/alpaca/index.js.map +1 -1
- package/lib-es/bridge/generic-alpaca/alpaca/network/network-alpaca.d.ts +2 -6
- 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.map +1 -1
- package/lib-es/bridge/generic-alpaca/getAccountShape.d.ts.map +1 -1
- package/lib-es/bridge/generic-alpaca/getAccountShape.js +6 -7
- package/lib-es/bridge/generic-alpaca/getAccountShape.js.map +1 -1
- package/lib-es/bridge/generic-alpaca/signOperation.js.map +1 -1
- package/lib-es/bridge/generic-alpaca/utils.d.ts +3 -2
- package/lib-es/bridge/generic-alpaca/utils.d.ts.map +1 -1
- package/lib-es/bridge/generic-alpaca/utils.js +4 -1
- package/lib-es/bridge/generic-alpaca/utils.js.map +1 -1
- package/lib-es/bridge/generic-alpaca/utils.test.d.ts +2 -0
- package/lib-es/bridge/generic-alpaca/utils.test.d.ts.map +1 -0
- package/lib-es/bridge/generic-alpaca/utils.test.js +18 -0
- package/lib-es/bridge/generic-alpaca/utils.test.js.map +1 -0
- package/lib-es/currencies/sortByMarketcap.test.js +5 -0
- package/lib-es/currencies/sortByMarketcap.test.js.map +1 -1
- package/lib-es/e2e/enum/Currency.js +1 -1
- package/lib-es/e2e/enum/Currency.js.map +1 -1
- package/lib-es/e2e/enum/Provider.d.ts +1 -0
- package/lib-es/e2e/enum/Provider.d.ts.map +1 -1
- package/lib-es/e2e/enum/Provider.js +1 -0
- package/lib-es/e2e/enum/Provider.js.map +1 -1
- package/lib-es/e2e/index.d.ts +3 -0
- 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 +45 -15
- package/lib-es/e2e/speculos.js.map +1 -1
- package/lib-es/e2e/speculosCI.d.ts.map +1 -1
- package/lib-es/e2e/speculosCI.js +22 -4
- package/lib-es/e2e/speculosCI.js.map +1 -1
- package/lib-es/env.react.d.ts +1 -1
- package/lib-es/env.react.d.ts.map +1 -1
- package/lib-es/families/bitcoin/satstack.test.js +6 -0
- package/lib-es/families/bitcoin/satstack.test.js.map +1 -1
- package/lib-es/families/canton/bridge.integration.test.d.ts +2 -0
- package/lib-es/families/canton/bridge.integration.test.d.ts.map +1 -0
- package/lib-es/families/canton/bridge.integration.test.js +5 -0
- package/lib-es/families/canton/bridge.integration.test.js.map +1 -0
- package/lib-es/families/canton/config.d.ts +3 -0
- package/lib-es/families/canton/config.d.ts.map +1 -0
- package/lib-es/families/canton/config.js +11 -0
- package/lib-es/families/canton/config.js.map +1 -0
- package/lib-es/families/canton/logic.d.ts +2 -0
- package/lib-es/families/canton/logic.d.ts.map +1 -0
- package/lib-es/families/canton/logic.js +3 -0
- package/lib-es/families/canton/logic.js.map +1 -0
- package/lib-es/families/canton/setup.d.ts +27 -0
- package/lib-es/families/canton/setup.d.ts.map +1 -0
- package/lib-es/families/canton/setup.js +19 -0
- package/lib-es/families/canton/setup.js.map +1 -0
- package/lib-es/families/canton/types.d.ts +2 -0
- package/lib-es/families/canton/types.d.ts.map +1 -0
- package/lib-es/families/canton/types.js +3 -0
- package/lib-es/families/canton/types.js.map +1 -0
- package/lib-es/families/solana/bridge/mock-data.d.ts.map +1 -1
- package/lib-es/families/solana/bridge/mock-data.js +46 -316
- package/lib-es/families/solana/bridge/mock-data.js.map +1 -1
- package/lib-es/families/solana/bridge/mock.js +3 -3
- package/lib-es/families/solana/bridge/mock.js.map +1 -1
- package/lib-es/families/stellar/ui.d.ts +6 -0
- package/lib-es/families/stellar/ui.d.ts.map +1 -0
- package/lib-es/families/stellar/ui.js +14 -0
- package/lib-es/families/stellar/ui.js.map +1 -0
- package/lib-es/families/tron/data.mock.d.ts.map +1 -1
- package/lib-es/families/tron/data.mock.js +6 -0
- package/lib-es/families/tron/data.mock.js.map +1 -1
- package/lib-es/featureFlags/defaultFeatures.d.ts +1 -0
- package/lib-es/featureFlags/defaultFeatures.d.ts.map +1 -1
- package/lib-es/featureFlags/defaultFeatures.js +1 -0
- package/lib-es/featureFlags/defaultFeatures.js.map +1 -1
- package/lib-es/generated/bridge/js.d.ts +1 -0
- package/lib-es/generated/bridge/js.d.ts.map +1 -1
- package/lib-es/generated/bridge/js.js +2 -0
- package/lib-es/generated/bridge/js.js.map +1 -1
- package/lib-es/generated/cli-transaction.d.ts +20 -0
- package/lib-es/generated/cli-transaction.d.ts.map +1 -1
- package/lib-es/generated/cli-transaction.js +2 -0
- package/lib-es/generated/cli-transaction.js.map +1 -1
- package/lib-es/generated/deviceTransactionConfig.d.ts +2 -0
- package/lib-es/generated/deviceTransactionConfig.d.ts.map +1 -1
- package/lib-es/generated/deviceTransactionConfig.js +2 -0
- package/lib-es/generated/deviceTransactionConfig.js.map +1 -1
- package/lib-es/generated/hw-getAddress.d.ts +1 -0
- package/lib-es/generated/hw-getAddress.d.ts.map +1 -1
- package/lib-es/generated/hw-getAddress.js +2 -0
- package/lib-es/generated/hw-getAddress.js.map +1 -1
- package/lib-es/generated/specs.d.ts +2 -0
- package/lib-es/generated/specs.d.ts.map +1 -1
- package/lib-es/generated/specs.js +2 -0
- package/lib-es/generated/specs.js.map +1 -1
- package/lib-es/generated/transaction.d.ts +8 -0
- package/lib-es/generated/transaction.d.ts.map +1 -1
- package/lib-es/generated/transaction.js +2 -0
- package/lib-es/generated/transaction.js.map +1 -1
- package/lib-es/generated/types.d.ts +5 -4
- package/lib-es/generated/types.d.ts.map +1 -1
- package/lib-es/modularDrawer/__mocks__/accounts.mock.d.ts +18 -0
- package/lib-es/modularDrawer/__mocks__/accounts.mock.d.ts.map +1 -0
- package/lib-es/modularDrawer/__mocks__/accounts.mock.js +42 -0
- package/lib-es/modularDrawer/__mocks__/accounts.mock.js.map +1 -0
- package/lib-es/modularDrawer/utils/__tests__/currencyUtils.test.d.ts +2 -0
- package/lib-es/modularDrawer/utils/__tests__/currencyUtils.test.d.ts.map +1 -0
- package/lib-es/modularDrawer/utils/__tests__/currencyUtils.test.js +98 -0
- package/lib-es/modularDrawer/utils/__tests__/currencyUtils.test.js.map +1 -0
- package/lib-es/modularDrawer/utils/currencyUtils.d.ts +10 -0
- package/lib-es/modularDrawer/utils/currencyUtils.d.ts.map +1 -0
- package/lib-es/modularDrawer/utils/currencyUtils.js +65 -0
- package/lib-es/modularDrawer/utils/currencyUtils.js.map +1 -0
- package/lib-es/modularDrawer/utils/haveOneCommonProvider.d.ts +1 -1
- package/lib-es/modularDrawer/utils/haveOneCommonProvider.d.ts.map +1 -1
- package/lib-es/utils/__tests__/composeHooks.test.d.ts +2 -0
- package/lib-es/utils/__tests__/composeHooks.test.d.ts.map +1 -0
- package/lib-es/utils/__tests__/composeHooks.test.js +33 -0
- package/lib-es/utils/__tests__/composeHooks.test.js.map +1 -0
- package/lib-es/utils/__tests__/getAccountTuplesForCurrency.test.d.ts +2 -0
- package/lib-es/utils/__tests__/getAccountTuplesForCurrency.test.d.ts.map +1 -0
- package/lib-es/utils/__tests__/getAccountTuplesForCurrency.test.js +102 -0
- package/lib-es/utils/__tests__/getAccountTuplesForCurrency.test.js.map +1 -0
- package/lib-es/utils/composeHooks.d.ts +11 -0
- package/lib-es/utils/composeHooks.d.ts.map +1 -0
- package/lib-es/utils/composeHooks.js +21 -0
- package/lib-es/utils/composeHooks.js.map +1 -0
- package/lib-es/utils/getAccountTuplesForCurrency.d.ts +8 -0
- package/lib-es/utils/getAccountTuplesForCurrency.d.ts.map +1 -0
- package/lib-es/utils/getAccountTuplesForCurrency.js +15 -0
- package/lib-es/utils/getAccountTuplesForCurrency.js.map +1 -0
- package/lib-es/wallet-api/helpers.d.ts +1 -0
- package/lib-es/wallet-api/helpers.d.ts.map +1 -1
- package/lib-es/wallet-api/helpers.js +14 -0
- package/lib-es/wallet-api/helpers.js.map +1 -1
- package/package.json +40 -38
- package/src/DataModel.test.ts +8 -0
- package/src/__fixtures__/solana-spl-epjfwdd5aufqssqem2qn1xzybapc8g4weggkzwytdt1v.json +53 -0
- package/src/__tests__/accounts/groupPerDay.ts +13 -0
- package/src/__tests__/test-helpers/environment.ts +1 -0
- package/src/__tests__/test-helpers/setup.ts +8 -0
- package/src/account/serialization.test.ts +20 -2
- package/src/appSupportsQuitApp.test.ts +7 -1
- package/src/appSupportsQuitApp.ts +1 -0
- package/src/bridge/crypto-assets/index.ts +6 -6
- package/src/bridge/generic-alpaca/alpaca/index.ts +3 -3
- package/src/bridge/generic-alpaca/alpaca/network/network-alpaca.ts +3 -8
- package/src/bridge/generic-alpaca/getAccountShape.ts +6 -7
- package/src/bridge/generic-alpaca/signOperation.ts +1 -1
- package/src/bridge/generic-alpaca/utils.test.ts +19 -0
- package/src/bridge/generic-alpaca/utils.ts +7 -6
- package/src/currencies/sortByMarketcap.test.ts +7 -0
- package/src/e2e/enum/Currency.ts +1 -1
- package/src/e2e/enum/Provider.ts +1 -0
- package/src/e2e/speculos.ts +77 -21
- package/src/e2e/speculosCI.ts +32 -10
- package/src/families/bitcoin/satstack.test.ts +7 -0
- package/src/families/canton/bridge.integration.test.ts +6 -0
- package/src/families/canton/config.ts +12 -0
- package/src/families/canton/logic.ts +2 -0
- package/src/families/canton/setup.ts +34 -0
- package/src/families/canton/types.ts +2 -0
- package/src/families/solana/bridge/mock-data.ts +52 -316
- package/src/families/solana/bridge/mock.ts +3 -3
- package/src/families/stellar/__snapshots__/bridge.integration.test.ts.snap +1930 -94
- package/src/families/stellar/ui.ts +15 -0
- package/src/families/tron/data.mock.ts +8 -0
- package/src/featureFlags/defaultFeatures.ts +1 -0
- package/src/generated/bridge/js.ts +2 -0
- package/src/generated/cli-transaction.ts +2 -0
- package/src/generated/deviceTransactionConfig.ts +2 -0
- package/src/generated/hw-getAddress.ts +2 -0
- package/src/generated/specs.ts +2 -0
- package/src/generated/transaction.ts +2 -0
- package/src/generated/types.ts +10 -0
- package/src/modularDrawer/__mocks__/accounts.mock.ts +43 -0
- package/src/modularDrawer/utils/__tests__/currencyUtils.test.ts +126 -0
- package/src/modularDrawer/utils/currencyUtils.ts +95 -0
- package/src/modularDrawer/utils/haveOneCommonProvider.ts +1 -1
- package/src/utils/__tests__/composeHooks.test.ts +46 -0
- package/src/utils/__tests__/getAccountTuplesForCurrency.test.ts +138 -0
- package/src/utils/composeHooks.ts +26 -0
- package/src/utils/getAccountTuplesForCurrency.ts +34 -0
- package/src/wallet-api/helpers.ts +16 -0
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"hw-getAddress.js","sourceRoot":"","sources":["../../src/generated/hw-getAddress.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,IAAI,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AAClE,OAAO,EAAE,QAAQ,IAAI,KAAK,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,EAAE,QAAQ,IAAI,OAAO,EAAE,MAAM,2BAA2B,CAAC;AAChE,OAAO,EAAE,QAAQ,IAAI,OAAO,EAAE,MAAM,2BAA2B,CAAC;AAChE,OAAO,EAAE,QAAQ,IAAI,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAC9D,OAAO,EAAE,QAAQ,IAAI,IAAI,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,QAAQ,IAAI,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAC9D,OAAO,EAAE,QAAQ,IAAI,GAAG,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,QAAQ,IAAI,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAC9D,OAAO,EAAE,QAAQ,IAAI,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AAClE,OAAO,EAAE,QAAQ,IAAI,iBAAiB,EAAE,MAAM,qCAAqC,CAAC;AACpF,OAAO,EAAE,QAAQ,IAAI,IAAI,EAAE,MAAM,wBAAwB,CAAC;AAC1D,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O,EAAE,QAAQ,IAAI,KAAK,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,EAAE,QAAQ,IAAI,GAAG,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,QAAQ,IAAI,IAAI,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,QAAQ,IAAI,OAAO,EAAE,MAAM,2BAA2B,CAAC;AAChE,OAAO,EAAE,QAAQ,IAAI,GAAG,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,QAAQ,IAAI,GAAG,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,QAAQ,IAAI,IAAI,EAAE,MAAM,wBAAwB,CAAC;AAE1D,eAAe;IACb,QAAQ;IACR,KAAK;IACL,OAAO;IACP,OAAO;IACP,MAAM;IACN,MAAM;IACN,IAAI;IACJ,MAAM;IACN,GAAG;IACH,MAAM;IACN,QAAQ;IACR,iBAAiB;IACjB,IAAI;IACJ,UAAU;IACV,IAAI;IACJ,QAAQ;IACR,MAAM;IACN,MAAM;IACN,OAAO;IACP,KAAK;IACL,GAAG;IACH,IAAI;IACJ,OAAO;IACP,GAAG;IACH,GAAG;IACH,IAAI;CACL,CAAC"}
|
@@ -1,3 +1,4 @@
|
|
1
|
+
import canton from "@ledgerhq/coin-canton/specs";
|
1
2
|
declare const _default: {
|
2
3
|
algorand: {
|
3
4
|
algorand: import("@ledgerhq/coin-framework/lib/bot/types").AppSpec<import("@ledgerhq/coin-algorand/lib/types").AlgorandTransaction>;
|
@@ -26,6 +27,7 @@ declare const _default: {
|
|
26
27
|
casper: {
|
27
28
|
casperSpecs: import("@ledgerhq/coin-framework/lib/bot/types").AppSpec<import("@ledgerhq/coin-casper/lib/types/common").Transaction>;
|
28
29
|
};
|
30
|
+
canton: typeof canton;
|
29
31
|
celo: {
|
30
32
|
celo: import("@ledgerhq/coin-framework/lib/bot/types").AppSpec<import("@ledgerhq/coin-celo/lib/types/types").Transaction>;
|
31
33
|
};
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"specs.d.ts","sourceRoot":"","sources":["../../src/generated/specs.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"specs.d.ts","sourceRoot":"","sources":["../../src/generated/specs.ts"],"names":[],"mappings":"AAKA,OAAO,MAAM,MAAM,6BAA6B,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqBjD,wBA0BE"}
|
@@ -3,6 +3,7 @@ import aptos from "@ledgerhq/coin-aptos/specs";
|
|
3
3
|
import bitcoin from "@ledgerhq/coin-bitcoin/specs";
|
4
4
|
import cardano from "@ledgerhq/coin-cardano/specs";
|
5
5
|
import casper from "@ledgerhq/coin-casper/specs";
|
6
|
+
import canton from "@ledgerhq/coin-canton/specs";
|
6
7
|
import celo from "@ledgerhq/coin-celo/specs";
|
7
8
|
import cosmos from "@ledgerhq/coin-cosmos/specs";
|
8
9
|
import evm from "@ledgerhq/coin-evm/specs";
|
@@ -28,6 +29,7 @@ export default {
|
|
28
29
|
bitcoin,
|
29
30
|
cardano,
|
30
31
|
casper,
|
32
|
+
canton,
|
31
33
|
celo,
|
32
34
|
cosmos,
|
33
35
|
evm,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"specs.js","sourceRoot":"","sources":["../../src/generated/specs.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,+BAA+B,CAAC;AACrD,OAAO,KAAK,MAAM,4BAA4B,CAAC;AAC/C,OAAO,OAAO,MAAM,8BAA8B,CAAC;AACnD,OAAO,OAAO,MAAM,8BAA8B,CAAC;AACnD,OAAO,MAAM,MAAM,6BAA6B,CAAC;AACjD,OAAO,IAAI,MAAM,2BAA2B,CAAC;AAC7C,OAAO,MAAM,MAAM,6BAA6B,CAAC;AACjD,OAAO,GAAG,MAAM,0BAA0B,CAAC;AAC3C,OAAO,MAAM,MAAM,6BAA6B,CAAC;AACjD,OAAO,QAAQ,MAAM,+BAA+B,CAAC;AACrD,OAAO,iBAAiB,MAAM,wCAAwC,CAAC;AACvE,OAAO,IAAI,MAAM,2BAA2B,CAAC;AAC7C,OAAO,UAAU,MAAM,iCAAiC,CAAC;AACzD,OAAO,IAAI,MAAM,2BAA2B,CAAC;AAC7C,OAAO,QAAQ,MAAM,+BAA+B,CAAC;AACrD,OAAO,MAAM,MAAM,6BAA6B,CAAC;AACjD,OAAO,MAAM,MAAM,6BAA6B,CAAC;AACjD,OAAO,OAAO,MAAM,8BAA8B,CAAC;AACnD,OAAO,KAAK,MAAM,4BAA4B,CAAC;AAC/C,OAAO,GAAG,MAAM,0BAA0B,CAAC;AAC3C,OAAO,IAAI,MAAM,2BAA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A8B,CAAC;AACnD,OAAO,KAAK,MAAM,4BAA4B,CAAC;AAC/C,OAAO,GAAG,MAAM,0BAA0B,CAAC;AAC3C,OAAO,IAAI,MAAM,2BAA2B,CAAC;AAC7C,OAAO,OAAO,MAAM,8BAA8B,CAAC;AACnD,OAAO,GAAG,MAAM,0BAA0B,CAAC;AAC3C,OAAO,IAAI,MAAM,2BAA2B,CAAC;AAE7C,eAAe;IACb,QAAQ;IACR,KAAK;IACL,OAAO;IACP,OAAO;IACP,MAAM;IACN,MAAM;IACN,IAAI;IACJ,MAAM;IACN,GAAG;IACH,MAAM;IACN,QAAQ;IACR,iBAAiB;IACjB,IAAI;IACJ,UAAU;IACV,IAAI;IACJ,QAAQ;IACR,MAAM;IACN,MAAM;IACN,OAAO;IACP,KAAK;IACL,GAAG;IACH,IAAI;IACJ,OAAO;IACP,GAAG;IACH,IAAI;CACL,CAAC"}
|
@@ -39,6 +39,14 @@ declare const _default: {
|
|
39
39
|
toTransactionStatusRaw: (ts: import("@ledgerhq/types-live").TransactionStatusCommon) => import("@ledgerhq/types-live").TransactionStatusCommonRaw;
|
40
40
|
formatTransactionStatus: (t: import("@ledgerhq/types-live").TransactionCommon, { errors, warnings, estimatedFees, amount, totalSpent }: import("@ledgerhq/types-live").TransactionStatusCommon, mainAccount: import("@ledgerhq/types-live").Account) => string;
|
41
41
|
};
|
42
|
+
canton: {
|
43
|
+
formatTransaction: ({ amount, recipient, fee, useAllAmount }: import("@ledgerhq/coin-canton/lib/index").Transaction, account: import("@ledgerhq/types-live").Account) => string;
|
44
|
+
fromTransactionRaw: (tr: import("@ledgerhq/coin-canton/lib/index").TransactionRaw) => import("@ledgerhq/coin-canton/lib/index").Transaction;
|
45
|
+
toTransactionRaw: (t: import("@ledgerhq/coin-canton/lib/index").Transaction) => import("@ledgerhq/coin-canton/lib/index").TransactionRaw;
|
46
|
+
fromTransactionStatusRaw: (ts: import("@ledgerhq/types-live").TransactionStatusCommonRaw) => import("@ledgerhq/types-live").TransactionStatusCommon;
|
47
|
+
toTransactionStatusRaw: (ts: import("@ledgerhq/types-live").TransactionStatusCommon) => import("@ledgerhq/types-live").TransactionStatusCommonRaw;
|
48
|
+
formatTransactionStatus: (t: import("@ledgerhq/types-live").TransactionCommon, { errors, warnings, estimatedFees, amount, totalSpent }: import("@ledgerhq/types-live").TransactionStatusCommon, mainAccount: import("@ledgerhq/types-live").Account) => string;
|
49
|
+
};
|
42
50
|
celo: {
|
43
51
|
formatTransaction: (t: import("@ledgerhq/coin-celo/lib/types/types").Transaction, account: import("@ledgerhq/types-live").Account) => string;
|
44
52
|
fromTransactionRaw: (tr: import("@ledgerhq/coin-celo/lib/types/types").TransactionRaw) => import("@ledgerhq/coin-celo/lib/types/types").Transaction;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"transaction.d.ts","sourceRoot":"","sources":["../../src/generated/transaction.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"transaction.d.ts","sourceRoot":"","sources":["../../src/generated/transaction.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2BA,wBA2BE"}
|
@@ -3,6 +3,7 @@ import aptos from "@ledgerhq/coin-aptos/transaction";
|
|
3
3
|
import bitcoin from "@ledgerhq/coin-bitcoin/transaction";
|
4
4
|
import cardano from "@ledgerhq/coin-cardano/transaction";
|
5
5
|
import casper from "@ledgerhq/coin-casper/transaction";
|
6
|
+
import canton from "@ledgerhq/coin-canton/transaction";
|
6
7
|
import celo from "@ledgerhq/coin-celo/transaction";
|
7
8
|
import cosmos from "@ledgerhq/coin-cosmos/transaction";
|
8
9
|
import evm from "@ledgerhq/coin-evm/transaction";
|
@@ -29,6 +30,7 @@ export default {
|
|
29
30
|
bitcoin,
|
30
31
|
cardano,
|
31
32
|
casper,
|
33
|
+
canton,
|
32
34
|
celo,
|
33
35
|
cosmos,
|
34
36
|
evm,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"transaction.js","sourceRoot":"","sources":["../../src/generated/transaction.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,qCAAqC,CAAC;AAC3D,OAAO,KAAK,MAAM,kCAAkC,CAAC;AACrD,OAAO,OAAO,MAAM,oCAAoC,CAAC;AACzD,OAAO,OAAO,MAAM,oCAAoC,CAAC;AACzD,OAAO,MAAM,MAAM,mCAAmC,CAAC;AACvD,OAAO,IAAI,MAAM,iCAAiC,CAAC;AACnD,OAAO,MAAM,MAAM,mCAAmC,CAAC;AACvD,OAAO,GAAG,MAAM,gCAAgC,CAAC;AACjD,OAAO,MAAM,MAAM,mCAAmC,CAAC;AACvD,OAAO,QAAQ,MAAM,qCAAqC,CAAC;AAC3D,OAAO,iBAAiB,MAAM,8CAA8C,CAAC;AAC7E,OAAO,IAAI,MAAM,iCAAiC,CAAC;AACnD,OAAO,UAAU,MAAM,uCAAuC,CAAC;AAC/D,OAAO,IAAI,MAAM,iCAAiC,CAAC;AACnD,OAAO,QAAQ,MAAM,qCAAqC,CAAC;AAC3D,OAAO,MAAM,MAAM,mCAAmC,CAAC;AACvD,OAAO,MAAM,MAAM,mCAAmC,CAAC;AACvD,OAAO,OAAO,MAAM,oCAAoC,CAAC;AACzD,OAAO,KAAK,MAAM,kCAAkC,CAAC;AACrD,OAAO,GAAG,MAAM,gCAAgC,CAAC;AACjD,OAAO,IAAI,MAAM,iCAAiC,CAAC;AACnD,OAAO,OAAO,MAAM,oCAAoC,CAAC;AACzD,OAAO,GAAG,MAAM,gCAAgC,CAAC;AACjD,OAAO,GAAG,MAAM,gCAAgC,CAAC;AACjD,OAAO,IAAI,MAAM,iCAAiC,CAAC;AAEnD,e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AC;AACnD,OAAO,OAAO,MAAM,oCAAoC,CAAC;AACzD,OAAO,GAAG,MAAM,gCAAgC,CAAC;AACjD,OAAO,GAAG,MAAM,gCAAgC,CAAC;AACjD,OAAO,IAAI,MAAM,iCAAiC,CAAC;AAEnD,eAAe;IACb,QAAQ;IACR,KAAK;IACL,OAAO;IACP,OAAO;IACP,MAAM;IACN,MAAM;IACN,IAAI;IACJ,MAAM;IACN,GAAG;IACH,MAAM;IACN,QAAQ;IACR,iBAAiB;IACjB,IAAI;IACJ,UAAU;IACV,IAAI;IACJ,QAAQ;IACR,MAAM;IACN,MAAM;IACN,OAAO;IACP,KAAK;IACL,GAAG;IACH,IAAI;IACJ,OAAO;IACP,GAAG;IACH,GAAG;IACH,IAAI;CACL,CAAC"}
|
@@ -1,6 +1,7 @@
|
|
1
1
|
import type { Transaction as algorandTransaction, TransactionRaw as algorandTransactionRaw, TransactionStatus as algorandTransactionStatus, TransactionStatusRaw as algorandTransactionStatusRaw } from "@ledgerhq/coin-algorand/types";
|
2
2
|
import type { Transaction as aptosTransaction, TransactionRaw as aptosTransactionRaw, TransactionStatus as aptosTransactionStatus, TransactionStatusRaw as aptosTransactionStatusRaw } from "@ledgerhq/coin-aptos/types/index";
|
3
3
|
import type { Transaction as bitcoinTransaction, TransactionRaw as bitcoinTransactionRaw, TransactionStatus as bitcoinTransactionStatus, TransactionStatusRaw as bitcoinTransactionStatusRaw } from "@ledgerhq/coin-bitcoin/types";
|
4
|
+
import type { Transaction as cantonTransaction, TransactionRaw as cantonTransactionRaw, TransactionStatus as cantonTransactionStatus, TransactionStatusRaw as cantonTransactionStatusRaw } from "@ledgerhq/coin-canton/types/index";
|
4
5
|
import type { Transaction as cardanoTransaction, TransactionRaw as cardanoTransactionRaw, TransactionStatus as cardanoTransactionStatus, TransactionStatusRaw as cardanoTransactionStatusRaw } from "@ledgerhq/coin-cardano/types";
|
5
6
|
import type { Transaction as casperTransaction, TransactionRaw as casperTransactionRaw, TransactionStatus as casperTransactionStatus, TransactionStatusRaw as casperTransactionStatusRaw } from "@ledgerhq/coin-casper/types/index";
|
6
7
|
import type { Transaction as celoTransaction, TransactionRaw as celoTransactionRaw, TransactionStatus as celoTransactionStatus, TransactionStatusRaw as celoTransactionStatusRaw } from "@ledgerhq/coin-celo/types/index";
|
@@ -23,8 +24,8 @@ import type { Transaction as tonTransaction, TransactionRaw as tonTransactionRaw
|
|
23
24
|
import type { Transaction as tronTransaction, TransactionRaw as tronTransactionRaw, TransactionStatus as tronTransactionStatus, TransactionStatusRaw as tronTransactionStatusRaw } from "@ledgerhq/coin-tron/types/index";
|
24
25
|
import type { Transaction as vechainTransaction, TransactionRaw as vechainTransactionRaw, TransactionStatus as vechainTransactionStatus, TransactionStatusRaw as vechainTransactionStatusRaw } from "@ledgerhq/coin-vechain/types/index";
|
25
26
|
import type { Transaction as xrpTransaction, TransactionRaw as xrpTransactionRaw, TransactionStatus as xrpTransactionStatus, TransactionStatusRaw as xrpTransactionStatusRaw } from "@ledgerhq/coin-xrp/types/index";
|
26
|
-
export type Transaction = algorandTransaction | aptosTransaction | bitcoinTransaction | cardanoTransaction | casperTransaction | celoTransaction | cosmosTransaction | evmTransaction | filecoinTransaction | hederaTransaction | iconTransaction | internet_computerTransaction | minaTransaction | multiversxTransaction | nearTransaction | polkadotTransaction | solanaTransaction | stacksTransaction | stellarTransaction | suiTransaction | tezosTransaction | tonTransaction | tronTransaction | vechainTransaction | xrpTransaction;
|
27
|
-
export type TransactionRaw = algorandTransactionRaw | aptosTransactionRaw | bitcoinTransactionRaw | cardanoTransactionRaw | casperTransactionRaw | celoTransactionRaw | cosmosTransactionRaw | evmTransactionRaw | filecoinTransactionRaw | hederaTransactionRaw | iconTransactionRaw | internet_computerTransactionRaw | minaTransactionRaw | multiversxTransactionRaw | nearTransactionRaw | polkadotTransactionRaw | solanaTransactionRaw | stacksTransactionRaw | stellarTransactionRaw | suiTransactionRaw | tezosTransactionRaw | tonTransactionRaw | tronTransactionRaw | vechainTransactionRaw | xrpTransactionRaw;
|
28
|
-
export type TransactionStatus = algorandTransactionStatus | aptosTransactionStatus | bitcoinTransactionStatus | cardanoTransactionStatus | casperTransactionStatus | celoTransactionStatus | cosmosTransactionStatus | evmTransactionStatus | filecoinTransactionStatus | hederaTransactionStatus | iconTransactionStatus | internet_computerTransactionStatus | minaTransactionStatus | multiversxTransactionStatus | nearTransactionStatus | polkadotTransactionStatus | solanaTransactionStatus | stacksTransactionStatus | stellarTransactionStatus | suiTransactionStatus | tezosTransactionStatus | tonTransactionStatus | tronTransactionStatus | vechainTransactionStatus | xrpTransactionStatus;
|
29
|
-
export type TransactionStatusRaw = algorandTransactionStatusRaw | aptosTransactionStatusRaw | bitcoinTransactionStatusRaw | cardanoTransactionStatusRaw | casperTransactionStatusRaw | celoTransactionStatusRaw | cosmosTransactionStatusRaw | evmTransactionStatusRaw | filecoinTransactionStatusRaw | hederaTransactionStatusRaw | iconTransactionStatusRaw | internet_computerTransactionStatusRaw | minaTransactionStatusRaw | multiversxTransactionStatusRaw | nearTransactionStatusRaw | polkadotTransactionStatusRaw | solanaTransactionStatusRaw | stacksTransactionStatusRaw | stellarTransactionStatusRaw | suiTransactionStatusRaw | tezosTransactionStatusRaw | tonTransactionStatusRaw | tronTransactionStatusRaw | vechainTransactionStatusRaw | xrpTransactionStatusRaw;
|
27
|
+
export type Transaction = algorandTransaction | aptosTransaction | bitcoinTransaction | cantonTransaction | cardanoTransaction | casperTransaction | celoTransaction | cosmosTransaction | evmTransaction | filecoinTransaction | hederaTransaction | iconTransaction | internet_computerTransaction | minaTransaction | multiversxTransaction | nearTransaction | polkadotTransaction | solanaTransaction | stacksTransaction | stellarTransaction | suiTransaction | tezosTransaction | tonTransaction | tronTransaction | vechainTransaction | xrpTransaction;
|
28
|
+
export type TransactionRaw = algorandTransactionRaw | aptosTransactionRaw | bitcoinTransactionRaw | cantonTransactionRaw | cardanoTransactionRaw | casperTransactionRaw | celoTransactionRaw | cosmosTransactionRaw | evmTransactionRaw | filecoinTransactionRaw | hederaTransactionRaw | iconTransactionRaw | internet_computerTransactionRaw | minaTransactionRaw | multiversxTransactionRaw | nearTransactionRaw | polkadotTransactionRaw | solanaTransactionRaw | stacksTransactionRaw | stellarTransactionRaw | suiTransactionRaw | tezosTransactionRaw | tonTransactionRaw | tronTransactionRaw | vechainTransactionRaw | xrpTransactionRaw;
|
29
|
+
export type TransactionStatus = algorandTransactionStatus | aptosTransactionStatus | bitcoinTransactionStatus | cantonTransactionStatus | cardanoTransactionStatus | casperTransactionStatus | celoTransactionStatus | cosmosTransactionStatus | evmTransactionStatus | filecoinTransactionStatus | hederaTransactionStatus | iconTransactionStatus | internet_computerTransactionStatus | minaTransactionStatus | multiversxTransactionStatus | nearTransactionStatus | polkadotTransactionStatus | solanaTransactionStatus | stacksTransactionStatus | stellarTransactionStatus | suiTransactionStatus | tezosTransactionStatus | tonTransactionStatus | tronTransactionStatus | vechainTransactionStatus | xrpTransactionStatus;
|
30
|
+
export type TransactionStatusRaw = algorandTransactionStatusRaw | aptosTransactionStatusRaw | bitcoinTransactionStatusRaw | cantonTransactionStatusRaw | cardanoTransactionStatusRaw | casperTransactionStatusRaw | celoTransactionStatusRaw | cosmosTransactionStatusRaw | evmTransactionStatusRaw | filecoinTransactionStatusRaw | hederaTransactionStatusRaw | iconTransactionStatusRaw | internet_computerTransactionStatusRaw | minaTransactionStatusRaw | multiversxTransactionStatusRaw | nearTransactionStatusRaw | polkadotTransactionStatusRaw | solanaTransactionStatusRaw | stacksTransactionStatusRaw | stellarTransactionStatusRaw | suiTransactionStatusRaw | tezosTransactionStatusRaw | tonTransactionStatusRaw | tronTransactionStatusRaw | vechainTransactionStatusRaw | xrpTransactionStatusRaw;
|
30
31
|
//# sourceMappingURL=types.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/generated/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,WAAW,IAAI,mBAAmB,EAClC,c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,GACxB,2BAA2B,GAC3B,uBAAuB,CAAC"}
|
@@ -0,0 +1,18 @@
|
|
1
|
+
import BigNumber from "bignumber.js";
|
2
|
+
export declare const MOCKED_ARB_ACCOUNT: {
|
3
|
+
type: string;
|
4
|
+
id: string;
|
5
|
+
balance: BigNumber;
|
6
|
+
creationDate: string;
|
7
|
+
currency: import("@ledgerhq/types-cryptoassets").CryptoCurrency;
|
8
|
+
derivationMode: string;
|
9
|
+
freshAddress: string;
|
10
|
+
};
|
11
|
+
export declare const ETH_ACCOUNT: import("@ledgerhq/types-live").Account;
|
12
|
+
export declare const ETH_ACCOUNT_2: import("@ledgerhq/types-live").Account;
|
13
|
+
export declare const BTC_ACCOUNT: import("@ledgerhq/types-live").Account;
|
14
|
+
export declare const ARB_ACCOUNT: import("@ledgerhq/types-live").Account;
|
15
|
+
export declare const ETH_ACCOUNT_WITH_USDC: import("@ledgerhq/types-live").Account;
|
16
|
+
export declare const BASE_ACCOUNT: import("@ledgerhq/types-live").Account;
|
17
|
+
export declare const SCROLL_ACCOUNT: import("@ledgerhq/types-live").Account;
|
18
|
+
//# sourceMappingURL=accounts.mock.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"accounts.mock.d.ts","sourceRoot":"","sources":["../../../src/modularDrawer/__mocks__/accounts.mock.ts"],"names":[],"mappings":"AACA,OAAO,SAAS,MAAM,cAAc,CAAC;AAOrC,eAAO,MAAM,kBAAkB;;;;;;;;CAQ9B,CAAC;AAEF,eAAO,MAAM,WAAW,wCAEtB,CAAC;AACH,eAAO,MAAM,aAAa,wCAExB,CAAC;AACH,eAAO,MAAM,WAAW,wCAEtB,CAAC;AACH,eAAO,MAAM,WAAW,wCAGtB,CAAC;AACH,eAAO,MAAM,qBAAqB,wCAGhC,CAAC;AACH,eAAO,MAAM,YAAY,wCAGvB,CAAC;AACH,eAAO,MAAM,cAAc,wCAGzB,CAAC"}
|
@@ -0,0 +1,42 @@
|
|
1
|
+
import { genAccount } from "@ledgerhq/coin-framework/lib/mocks/account";
|
2
|
+
import BigNumber from "bignumber.js";
|
3
|
+
import { mockBtcCryptoCurrency } from "./currencies.mock";
|
4
|
+
import { mockArbitrumCryptoCurrency } from "./currencies.mock";
|
5
|
+
import { mockEthCryptoCurrency } from "./currencies.mock";
|
6
|
+
import { mockBaseCryptoCurrency } from "./currencies.mock";
|
7
|
+
import { mockScrollCryptoCurrency } from "./currencies.mock";
|
8
|
+
export const MOCKED_ARB_ACCOUNT = {
|
9
|
+
type: "Account",
|
10
|
+
id: "arbitrum1",
|
11
|
+
balance: new BigNumber(34455),
|
12
|
+
creationDate: "2024-12-10T09:27:22.000Z",
|
13
|
+
currency: mockArbitrumCryptoCurrency,
|
14
|
+
derivationMode: "",
|
15
|
+
freshAddress: "s37rhmi7hsm3i73hsm7i3hm83m8h87hsm87h3s8h33",
|
16
|
+
};
|
17
|
+
export const ETH_ACCOUNT = genAccount("ethereum-1", {
|
18
|
+
currency: mockEthCryptoCurrency,
|
19
|
+
});
|
20
|
+
export const ETH_ACCOUNT_2 = genAccount("ethereum-2", {
|
21
|
+
currency: mockEthCryptoCurrency,
|
22
|
+
});
|
23
|
+
export const BTC_ACCOUNT = genAccount("bitcoin-1", {
|
24
|
+
currency: mockBtcCryptoCurrency,
|
25
|
+
});
|
26
|
+
export const ARB_ACCOUNT = genAccount("arbitrum-1", {
|
27
|
+
currency: mockArbitrumCryptoCurrency,
|
28
|
+
tokenIds: ["arbitrum/erc20/arbitrum"],
|
29
|
+
});
|
30
|
+
export const ETH_ACCOUNT_WITH_USDC = genAccount("ethereum-usdc", {
|
31
|
+
currency: mockEthCryptoCurrency,
|
32
|
+
tokenIds: ["ethereum/erc20/usdc"],
|
33
|
+
});
|
34
|
+
export const BASE_ACCOUNT = genAccount("base-1", {
|
35
|
+
currency: mockBaseCryptoCurrency,
|
36
|
+
operationsSize: 100,
|
37
|
+
});
|
38
|
+
export const SCROLL_ACCOUNT = genAccount("scroll-1", {
|
39
|
+
currency: mockScrollCryptoCurrency,
|
40
|
+
operationsSize: 100,
|
41
|
+
});
|
42
|
+
//# sourceMappingURL=accounts.mock.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"accounts.mock.js","sourceRoot":"","sources":["../../../src/modularDrawer/__mocks__/accounts.mock.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,4CAA4C,CAAC;AACxE,OAAO,SAAS,MAAM,cAAc,CAAC;AACrC,OAAO,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAC1D,OAAO,EAAE,0BAA0B,EAAE,MAAM,mBAAmB,CAAC;AAC/D,OAAO,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAC1D,OAAO,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;AAC3D,OAAO,EAAE,wBAAwB,EAAE,MAAM,mBAAmB,CAAC;AAE7D,MAAM,CAAC,MAAM,kBAAkB,GAAG;IAChC,IAAI,EAAE,SAAS;IACf,EAAE,EAAE,WAAW;IACf,OAAO,EAAE,IAAI,SAAS,CAAC,KAAK,CAAC;IAC7B,YAAY,EAAE,0BAA0B;IACxC,QAAQ,EAAE,0BAA0B;IACpC,cAAc,EAAE,EAAE;IAClB,YAAY,EAAE,4CAA4C;CAC3D,CAAC;AAEF,MAAM,CAAC,MAAM,WAAW,GAAG,UAAU,CAAC,YAAY,EAAE;IAClD,QAAQ,EAAE,qBAAqB;CAChC,CAAC,CAAC;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,UAAU,CAAC,YAAY,EAAE;IACpD,QAAQ,EAAE,qBAAqB;CAChC,CAAC,CAAC;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,UAAU,CAAC,WAAW,EAAE;IACjD,QAAQ,EAAE,qBAAqB;CAChC,CAAC,CAAC;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,UAAU,CAAC,YAAY,EAAE;IAClD,QAAQ,EAAE,0BAA0B;IACpC,QAAQ,EAAE,CAAC,yBAAyB,CAAC;CACtC,CAAC,CAAC;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,UAAU,CAAC,eAAe,EAAE;IAC/D,QAAQ,EAAE,qBAAqB;IAC/B,QAAQ,EAAE,CAAC,qBAAqB,CAAC;CAClC,CAAC,CAAC;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,UAAU,CAAC,QAAQ,EAAE;IAC/C,QAAQ,EAAE,sBAAsB;IAChC,cAAc,EAAE,GAAG;CACpB,CAAC,CAAC;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,UAAU,CAAC,UAAU,EAAE;IACnD,QAAQ,EAAE,wBAAwB;IAClC,cAAc,EAAE,GAAG;CACpB,CAAC,CAAC"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"currencyUtils.test.d.ts","sourceRoot":"","sources":["../../../../src/modularDrawer/utils/__tests__/currencyUtils.test.ts"],"names":[],"mappings":""}
|
@@ -0,0 +1,98 @@
|
|
1
|
+
import { useGroupedCurrenciesByProvider } from "@ledgerhq/live-common/modularDrawer/__mocks__/useGroupedCurrenciesByProvider.mock";
|
2
|
+
import { buildProviderCoverageMap, extractProviderCurrencies, filterProvidersByIds, getProviderCurrency, isProviderToken, safeCurrencyLookup, } from "../currencyUtils";
|
3
|
+
import { usdcToken, mockBaseCryptoCurrency, mockBtcCryptoCurrency, mockEthCryptoCurrency, } from "../../__mocks__/currencies.mock";
|
4
|
+
describe("safeCurrencyLookup", () => {
|
5
|
+
it("should return the currency if it is found", () => {
|
6
|
+
const currency = safeCurrencyLookup("ethereum");
|
7
|
+
expect(currency).toBeDefined();
|
8
|
+
});
|
9
|
+
it("should return null if the currency is not found", () => {
|
10
|
+
const currency = safeCurrencyLookup("not-a-currency");
|
11
|
+
expect(currency).toBeNull();
|
12
|
+
});
|
13
|
+
});
|
14
|
+
describe("isProviderToken", () => {
|
15
|
+
it("should return true if the currency is a provider token", () => {
|
16
|
+
const baseToken = {
|
17
|
+
type: "TokenCurrency",
|
18
|
+
id: "base/erc20/base",
|
19
|
+
contractAddress: "0x0000000000000000000000000000000000000000",
|
20
|
+
parentCurrency: mockBaseCryptoCurrency,
|
21
|
+
tokenType: "erc20",
|
22
|
+
name: "Base",
|
23
|
+
ticker: "BASE",
|
24
|
+
units: [
|
25
|
+
{
|
26
|
+
name: "Base",
|
27
|
+
code: "BASE",
|
28
|
+
magnitude: 18,
|
29
|
+
},
|
30
|
+
],
|
31
|
+
};
|
32
|
+
const currency = isProviderToken(baseToken, "base");
|
33
|
+
expect(currency).toBe(true);
|
34
|
+
});
|
35
|
+
it("should return false if the currency is not a provider token", () => {
|
36
|
+
const currency = isProviderToken(mockEthCryptoCurrency, "ethereum");
|
37
|
+
expect(currency).toBe(false);
|
38
|
+
});
|
39
|
+
});
|
40
|
+
describe("getProviderCurrency", () => {
|
41
|
+
it("should return the currency if it is a provider currency", () => {
|
42
|
+
const { result } = useGroupedCurrenciesByProvider();
|
43
|
+
const currency = getProviderCurrency(result.currenciesByProvider[0]);
|
44
|
+
expect(currency).toEqual(mockBtcCryptoCurrency);
|
45
|
+
});
|
46
|
+
it("should return the currency if it is a provider token", () => {
|
47
|
+
const { result } = useGroupedCurrenciesByProvider();
|
48
|
+
const currency = getProviderCurrency(result.currenciesByProvider[3]);
|
49
|
+
expect(currency).toEqual(usdcToken);
|
50
|
+
});
|
51
|
+
});
|
52
|
+
describe("buildProviderCoverageMap", () => {
|
53
|
+
it("should build a map of provider coverage correctly", () => {
|
54
|
+
const { result } = useGroupedCurrenciesByProvider();
|
55
|
+
const coverageMap = buildProviderCoverageMap(result.currenciesByProvider);
|
56
|
+
expect(coverageMap).toBeInstanceOf(Map);
|
57
|
+
expect(coverageMap.get("bitcoin")).toEqual(new Set(["bitcoin"]));
|
58
|
+
expect(coverageMap.get("ethereum")).toEqual(new Set(["ethereum"]));
|
59
|
+
expect(coverageMap.get("arbitrum")).toEqual(new Set(["ethereum"]));
|
60
|
+
expect(coverageMap.get("base")).toEqual(new Set(["ethereum"]));
|
61
|
+
expect(coverageMap.get("scroll")).toEqual(new Set(["ethereum"]));
|
62
|
+
expect(coverageMap.get("arbitrum/erc20/arbitrum")).toEqual(new Set(["arbitrum"]));
|
63
|
+
expect(coverageMap.get("ethereum/erc20/usd__coin")).toEqual(new Set(["usd-coin"]));
|
64
|
+
expect(coverageMap.get("injective")).toEqual(new Set(["injective-protocol"]));
|
65
|
+
});
|
66
|
+
it("should handle empty input", () => {
|
67
|
+
const coverageMap = buildProviderCoverageMap([]);
|
68
|
+
expect(coverageMap).toBeInstanceOf(Map);
|
69
|
+
expect(coverageMap.size).toBe(0);
|
70
|
+
});
|
71
|
+
});
|
72
|
+
describe("filterProvidersByIds", () => {
|
73
|
+
it("should filter providers by ids correctly #evm", () => {
|
74
|
+
const { result } = useGroupedCurrenciesByProvider();
|
75
|
+
const coverageMap = buildProviderCoverageMap(result.currenciesByProvider);
|
76
|
+
const filteredProviders = filterProvidersByIds(result.currenciesByProvider, new Set(["base"]), coverageMap);
|
77
|
+
expect(filteredProviders).toHaveLength(1);
|
78
|
+
expect(filteredProviders[0].providerId).toBe("ethereum");
|
79
|
+
});
|
80
|
+
it("should filter providers by ids correctly #bitcoin", () => {
|
81
|
+
const { result } = useGroupedCurrenciesByProvider();
|
82
|
+
const coverageMap = buildProviderCoverageMap(result.currenciesByProvider);
|
83
|
+
const filteredProviders = filterProvidersByIds(result.currenciesByProvider, new Set(["bitcoin"]), coverageMap);
|
84
|
+
expect(filteredProviders).toHaveLength(1);
|
85
|
+
expect(filteredProviders[0].providerId).toBe("bitcoin");
|
86
|
+
});
|
87
|
+
});
|
88
|
+
describe("extractProviderCurrencies", () => {
|
89
|
+
it("should extract provider currencies correctly", () => {
|
90
|
+
const { result } = useGroupedCurrenciesByProvider();
|
91
|
+
const providerCurrencies = extractProviderCurrencies(result.currenciesByProvider);
|
92
|
+
expect(providerCurrencies).toHaveLength(5);
|
93
|
+
expect(providerCurrencies[0]).toEqual(mockBtcCryptoCurrency);
|
94
|
+
expect(providerCurrencies[1].id).toBe("ethereum");
|
95
|
+
expect(providerCurrencies[2].id).toBe("arbitrum/erc20/arbitrum");
|
96
|
+
});
|
97
|
+
});
|
98
|
+
//# sourceMappingURL=currencyUtils.test.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"currencyUtils.test.js","sourceRoot":"","sources":["../../../../src/modularDrawer/utils/__tests__/currencyUtils.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,8BAA8B,EAAE,MAAM,mFAAmF,CAAC;AAGnI,OAAO,EACL,wBAAwB,EACxB,yBAAyB,EACzB,oBAAoB,EACpB,mBAAmB,EACnB,eAAe,EACf,kBAAkB,GACnB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,SAAS,EACT,sBAAsB,EACtB,qBAAqB,EACrB,qBAAqB,GACtB,MAAM,iCAAiC,CAAC;AAEzC,QAAQ,CAAC,oBAAoB,EAAE,GAAG,EAAE;IAClC,EAAE,CAAC,2CAA2C,EAAE,GAAG,EAAE;QACnD,MAAM,QAAQ,GAAG,kBAAkB,CAAC,UAAU,CAAC,CAAC;QAChD,MAAM,CAAC,QAAQ,CAAC,CAAC,WAAW,EAAE,CAAC;IACjC,CAAC,CAAC,CAAC;IACH,EAAE,CAAC,iDAAiD,EAAE,GAAG,EAAE;QACzD,MAAM,QAAQ,GAAG,kBAAkB,CAAC,gBAAgB,CAAC,CAAC;QACtD,MAAM,CAAC,QAAQ,CAAC,CAAC,QAAQ,EAAE,CAAC;IAC9B,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC;AAEH,QAAQ,CAAC,iBAAiB,EAAE,GAAG,EAAE;IAC/B,EAAE,CAAC,wDAAwD,EAAE,GAAG,EAAE;QAChE,MAAM,SAAS,GAAkB;YAC/B,IAAI,EAAE,eAAe;YACrB,EAAE,EAAE,iBAAiB;YACrB,eAAe,EAAE,4CAA4C;YAC7D,cAAc,EAAE,sBAAsB;YACtC,SAAS,EAAE,OAAO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ACpB,WAAW,CACZ,CAAC;QACF,MAAM,CAAC,iBAAiB,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;QAC1C,MAAM,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IAC1D,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC;AAEH,QAAQ,CAAC,2BAA2B,EAAE,GAAG,EAAE;IACzC,EAAE,CAAC,8CAA8C,EAAE,GAAG,EAAE;QACtD,MAAM,EAAE,MAAM,EAAE,GAAG,8BAA8B,EAAE,CAAC;QACpD,MAAM,kBAAkB,GAAG,yBAAyB,CAAC,MAAM,CAAC,oBAAoB,CAAC,CAAC;QAClF,MAAM,CAAC,kBAAkB,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;QAC3C,MAAM,CAAC,kBAAkB,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,qBAAqB,CAAC,CAAC;QAC7D,MAAM,CAAC,kBAAkB,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QAClD,MAAM,CAAC,kBAAkB,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,yBAAyB,CAAC,CAAC;IACnE,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
@@ -0,0 +1,10 @@
|
|
1
|
+
import { CryptoOrTokenCurrency } from "@ledgerhq/types-cryptoassets";
|
2
|
+
import { CurrenciesByProviderId } from "../../deposit/type";
|
3
|
+
export type ProviderCoverageMap = Map<string, Set<string>>;
|
4
|
+
export declare const safeCurrencyLookup: (id: string) => CryptoOrTokenCurrency | null;
|
5
|
+
export declare const isProviderToken: (currency: CryptoOrTokenCurrency, providerId: string) => boolean;
|
6
|
+
export declare const getProviderCurrency: (provider: CurrenciesByProviderId) => CryptoOrTokenCurrency | null;
|
7
|
+
export declare const buildProviderCoverageMap: (providers: CurrenciesByProviderId[]) => ProviderCoverageMap;
|
8
|
+
export declare const filterProvidersByIds: (providers: CurrenciesByProviderId[], currencyIdsSet: Set<string>, providerCoverageMap: ProviderCoverageMap) => CurrenciesByProviderId[];
|
9
|
+
export declare const extractProviderCurrencies: (providers: CurrenciesByProviderId[]) => CryptoOrTokenCurrency[];
|
10
|
+
//# sourceMappingURL=currencyUtils.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"currencyUtils.d.ts","sourceRoot":"","sources":["../../../src/modularDrawer/utils/currencyUtils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AAGrE,OAAO,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAE5D,MAAM,MAAM,mBAAmB,GAAG,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC;AAE3D,eAAO,MAAM,kBAAkB,OAAQ,MAAM,KAAG,qBAAqB,GAAG,IAMvE,CAAC;AAEF,eAAO,MAAM,eAAe,aAAc,qBAAqB,cAAc,MAAM,KAAG,OAErF,CAAC;AAEF,eAAO,MAAM,mBAAmB,aACpB,sBAAsB,KAC/B,qBAAqB,GAAG,IAU1B,CAAC;AAEF,eAAO,MAAM,wBAAwB,cACxB,sBAAsB,EAAE,wBAcpC,CAAC;AAEF,eAAO,MAAM,oBAAoB,cACpB,sBAAsB,EAAE,kBACnB,IAAI,MAAM,CAAC,+CAE1B,sBAAsB,EAgCxB,CAAC;AAEF,eAAO,MAAM,yBAAyB,cACzB,sBAAsB,EAAE,KAClC,qBAAqB,EAIvB,CAAC"}
|
@@ -0,0 +1,65 @@
|
|
1
|
+
import { getTokenOrCryptoCurrencyById } from "../../deposit/helper";
|
2
|
+
import { isTokenCurrency } from "../../currencies";
|
3
|
+
export const safeCurrencyLookup = (id) => {
|
4
|
+
try {
|
5
|
+
return getTokenOrCryptoCurrencyById(id);
|
6
|
+
}
|
7
|
+
catch {
|
8
|
+
return null;
|
9
|
+
}
|
10
|
+
};
|
11
|
+
export const isProviderToken = (currency, providerId) => {
|
12
|
+
return isTokenCurrency(currency) && currency.id.toLowerCase().includes(providerId.toLowerCase());
|
13
|
+
};
|
14
|
+
export const getProviderCurrency = (provider) => {
|
15
|
+
const providerToken = provider.currenciesByNetwork.find(currency => {
|
16
|
+
return isProviderToken(currency, provider.providerId);
|
17
|
+
});
|
18
|
+
if (providerToken) {
|
19
|
+
return providerToken;
|
20
|
+
}
|
21
|
+
return safeCurrencyLookup(provider.providerId) ?? provider.currenciesByNetwork[0];
|
22
|
+
};
|
23
|
+
export const buildProviderCoverageMap = (providers) => {
|
24
|
+
const providerIdToCoveringProviders = new Map();
|
25
|
+
for (const { providerId, currenciesByNetwork } of providers) {
|
26
|
+
for (const { id } of currenciesByNetwork) {
|
27
|
+
if (!providerIdToCoveringProviders.has(id)) {
|
28
|
+
providerIdToCoveringProviders.set(id, new Set());
|
29
|
+
}
|
30
|
+
providerIdToCoveringProviders.get(id).add(providerId);
|
31
|
+
}
|
32
|
+
}
|
33
|
+
return providerIdToCoveringProviders;
|
34
|
+
};
|
35
|
+
export const filterProvidersByIds = (providers, currencyIdsSet, providerCoverageMap) => {
|
36
|
+
const filtered = [];
|
37
|
+
for (const provider of providers) {
|
38
|
+
const filteredCurrencies = provider.currenciesByNetwork.filter(currency => currencyIdsSet.has(currency.id));
|
39
|
+
if (filteredCurrencies.length === 0)
|
40
|
+
continue;
|
41
|
+
const providerHasOwnCurrency = provider.currenciesByNetwork.some(currency => currency.id === provider.providerId);
|
42
|
+
if (!providerHasOwnCurrency) {
|
43
|
+
const coveringProviders = providerCoverageMap.get(provider.providerId);
|
44
|
+
const isProviderIdCoveredElsewhere = coveringProviders && coveringProviders.size > 1;
|
45
|
+
if (isProviderIdCoveredElsewhere)
|
46
|
+
continue;
|
47
|
+
}
|
48
|
+
if (filteredCurrencies.length === provider.currenciesByNetwork.length) {
|
49
|
+
filtered.push(provider);
|
50
|
+
}
|
51
|
+
else {
|
52
|
+
filtered.push({
|
53
|
+
...provider,
|
54
|
+
currenciesByNetwork: filteredCurrencies,
|
55
|
+
});
|
56
|
+
}
|
57
|
+
}
|
58
|
+
return filtered;
|
59
|
+
};
|
60
|
+
export const extractProviderCurrencies = (providers) => {
|
61
|
+
return providers
|
62
|
+
.map(provider => getProviderCurrency(provider))
|
63
|
+
.filter((currency) => currency !== null);
|
64
|
+
};
|
65
|
+
//# sourceMappingURL=currencyUtils.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"currencyUtils.js","sourceRoot":"","sources":["../../../src/modularDrawer/utils/currencyUtils.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,4BAA4B,EAAE,MAAM,sBAAsB,CAAC;AACpE,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAKnD,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,EAAU,EAAgC,EAAE;IAC7E,IAAI;QACF,OAAO,4BAA4B,CAAC,EAAE,CAAC,CAAC;KACzC;IAAC,MAAM;QACN,OAAO,IAAI,CAAC;KACb;AACH,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,QAA+B,EAAE,UAAkB,EAAW,EAAE;IAC9F,OAAO,eAAe,CAAC,QAAQ,CAAC,IAAI,QAAQ,CAAC,EAAE,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,UAAU,CAAC,WAAW,EAAE,CAAC,CAAC;AACnG,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,mBAAmB,GAAG,CACjC,QAAgC,EACF,EAAE;IAChC,MAAM,aAAa,GAAG,QAAQ,CAAC,mBAAmB,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE;QACjE,OAAO,eAAe,CAAC,QAAQ,EAAE,QAAQ,CAAC,UAAU,CAAC,CAAC;IACxD,CAAC,CAAC,CAAC;IAEH,IAAI,aAAa,EAAE;QACjB,OAAO,aAAa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M,iBAAiB,GAAG,mBAAmB,CAAC,GAAG,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC;YACvE,MAAM,4BAA4B,GAAG,iBAAiB,IAAI,iBAAiB,CAAC,IAAI,GAAG,CAAC,CAAC;YAErF,IAAI,4BAA4B;gBAAE,SAAS;SAC5C;QAED,IAAI,kBAAkB,CAAC,MAAM,KAAK,QAAQ,CAAC,mBAAmB,CAAC,MAAM,EAAE;YACrE,QAAQ,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;SACzB;aAAM;YACL,QAAQ,CAAC,IAAI,CAAC;gBACZ,GAAG,QAAQ;gBACX,mBAAmB,EAAE,kBAAkB;aACxC,CAAC,CAAC;SACJ;KACF;IAED,OAAO,QAAQ,CAAC;AAClB,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,yBAAyB,GAAG,CACvC,SAAmC,EACV,EAAE;IAC3B,OAAO,SAAS;SACb,GAAG,CAAC,QAAQ,CAAC,EAAE,CAAC,mBAAmB,CAAC,QAAQ,CAAC,CAAC;SAC9C,MAAM,CAAC,CAAC,QAAQ,EAAqC,EAAE,CAAC,QAAQ,KAAK,IAAI,CAAC,CAAC;AAChF,CAAC,CAAC"}
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { CurrenciesByProviderId } from "
|
1
|
+
import { CurrenciesByProviderId } from "../../deposit/type";
|
2
2
|
/**
|
3
3
|
* This function checks if all currencies in the provided array
|
4
4
|
* it stopped at the first currency that does not match to prevent unnecessary iterations.
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"haveOneCommonProvider.d.ts","sourceRoot":"","sources":["../../../src/modularDrawer/utils/haveOneCommonProvider.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,
|
1
|
+
{"version":3,"file":"haveOneCommonProvider.d.ts","sourceRoot":"","sources":["../../../src/modularDrawer/utils/haveOneCommonProvider.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAE5D;;;;;;;GAOG;AACH,eAAO,MAAM,qBAAqB,uBACZ,MAAM,EAAE,wBACN,sBAAsB,EAAE,KAC7C,OAiBF,CAAC"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"composeHooks.test.d.ts","sourceRoot":"","sources":["../../../src/utils/__tests__/composeHooks.test.ts"],"names":[],"mappings":""}
|
@@ -0,0 +1,33 @@
|
|
1
|
+
import { composeHooks } from "../composeHooks";
|
2
|
+
describe("composeHooks", () => {
|
3
|
+
it("should compose hooks and merge their results", () => {
|
4
|
+
const hook1 = (items) => items.map(item => ({ id: item.id, extra: item.id * 2 }));
|
5
|
+
const hook2 = (items) => items.map(item => ({ ...item, final: item.extra + 1 }));
|
6
|
+
const composed = composeHooks(hook1, hook2);
|
7
|
+
const input = [{ id: 1 }, { id: 2 }];
|
8
|
+
const processedInput = input.map(item => ({ id: item.id, extra: item.id * 2 }));
|
9
|
+
const result = composed(processedInput);
|
10
|
+
expect(result).toEqual([
|
11
|
+
{ id: 1, extra: 2, final: 3 },
|
12
|
+
{ id: 2, extra: 4, final: 5 },
|
13
|
+
]);
|
14
|
+
});
|
15
|
+
it("should handle hooks that return undefined", () => {
|
16
|
+
const hook1 = (items) => items.map(item => ({ id: item.id, extra: item.id * 2 }));
|
17
|
+
const hook2 = () => undefined;
|
18
|
+
const composed = composeHooks(hook1, hook2);
|
19
|
+
const input = [{ id: 1 }, { id: 2 }];
|
20
|
+
const result = composed(input);
|
21
|
+
expect(result).toEqual([
|
22
|
+
{ id: 1, extra: 2 },
|
23
|
+
{ id: 2, extra: 4 },
|
24
|
+
]);
|
25
|
+
});
|
26
|
+
it("should return the original items if no hooks are provided", () => {
|
27
|
+
const composed = composeHooks();
|
28
|
+
const input = [{ id: 1 }, { id: 2 }];
|
29
|
+
const result = composed(input);
|
30
|
+
expect(result).toEqual(input);
|
31
|
+
});
|
32
|
+
});
|
33
|
+
//# sourceMappingURL=composeHooks.test.js.map
|
@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