@ledgerhq/live-common 34.52.0-nightly.1 → 34.52.0-nightly.10
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__/test-helpers/environment.js +2 -0
- package/lib/__tests__/test-helpers/environment.js.map +1 -1
- package/lib/apps/config.js +1 -1
- package/lib/bridge/generic-alpaca/alpaca/network/network-alpaca.d.ts +2 -1
- package/lib/bridge/generic-alpaca/alpaca/network/network-alpaca.d.ts.map +1 -1
- package/lib/bridge/generic-alpaca/alpaca/network/network-alpaca.js +3 -0
- 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 +7 -1
- package/lib/bridge/generic-alpaca/getAccountShape.js.map +1 -1
- package/lib/bridge/generic-alpaca/utils.d.ts.map +1 -1
- package/lib/bridge/generic-alpaca/utils.js +5 -4
- package/lib/bridge/generic-alpaca/utils.js.map +1 -1
- package/lib/dada-client/hooks/useAssetsData.d.ts +4 -10
- package/lib/dada-client/hooks/useAssetsData.d.ts.map +1 -1
- package/lib/dada-client/hooks/useAssetsData.js +2 -1
- package/lib/dada-client/hooks/useAssetsData.js.map +1 -1
- package/lib/dada-client/hooks/useInterestRatesByCurrencies.d.ts +5 -1
- package/lib/dada-client/hooks/useInterestRatesByCurrencies.d.ts.map +1 -1
- package/lib/dada-client/hooks/useMarketByCurrencies.d.ts +4 -1
- package/lib/dada-client/hooks/useMarketByCurrencies.d.ts.map +1 -1
- package/lib/dada-client/state-manager/api.d.ts.map +1 -1
- package/lib/dada-client/state-manager/api.js +3 -0
- package/lib/dada-client/state-manager/api.js.map +1 -1
- package/lib/dada-client/state-manager/types.d.ts +1 -0
- package/lib/dada-client/state-manager/types.d.ts.map +1 -1
- package/lib/deposit/helper.d.ts.map +1 -1
- package/lib/deposit/helper.js +54 -1
- package/lib/deposit/helper.js.map +1 -1
- package/lib/e2e/data/deviceLabelsData.d.ts.map +1 -1
- package/lib/e2e/data/deviceLabelsData.js +37 -33
- package/lib/e2e/data/deviceLabelsData.js.map +1 -1
- package/lib/e2e/deviceInteraction/TouchDeviceSimulator.d.ts.map +1 -1
- package/lib/e2e/deviceInteraction/TouchDeviceSimulator.js +13 -5
- package/lib/e2e/deviceInteraction/TouchDeviceSimulator.js.map +1 -1
- package/lib/e2e/enum/Account.d.ts +0 -1
- package/lib/e2e/enum/Account.d.ts.map +1 -1
- package/lib/e2e/enum/Account.js +0 -1
- package/lib/e2e/enum/Account.js.map +1 -1
- package/lib/e2e/enum/Currency.d.ts +0 -1
- package/lib/e2e/enum/Currency.d.ts.map +1 -1
- package/lib/e2e/enum/Currency.js +0 -1
- package/lib/e2e/enum/Currency.js.map +1 -1
- package/lib/e2e/enum/Device.d.ts +1 -0
- package/lib/e2e/enum/Device.d.ts.map +1 -1
- package/lib/e2e/enum/Device.js +1 -0
- package/lib/e2e/enum/Device.js.map +1 -1
- package/lib/e2e/enum/DeviceLabels.d.ts +2 -0
- package/lib/e2e/enum/DeviceLabels.d.ts.map +1 -1
- package/lib/e2e/enum/DeviceLabels.js +2 -0
- package/lib/e2e/enum/DeviceLabels.js.map +1 -1
- package/lib/e2e/families/bitcoin.js +1 -1
- package/lib/e2e/families/bitcoin.js.map +1 -1
- package/lib/e2e/families/cardano.d.ts.map +1 -1
- package/lib/e2e/families/cardano.js +12 -11
- package/lib/e2e/families/cardano.js.map +1 -1
- package/lib/e2e/families/evm.d.ts.map +1 -1
- package/lib/e2e/families/evm.js +4 -3
- package/lib/e2e/families/evm.js.map +1 -1
- package/lib/e2e/families/solana.d.ts.map +1 -1
- package/lib/e2e/families/solana.js +1 -1
- package/lib/e2e/families/solana.js.map +1 -1
- package/lib/e2e/index.d.ts +8 -0
- package/lib/e2e/index.d.ts.map +1 -1
- package/lib/e2e/speculos.d.ts +2 -0
- package/lib/e2e/speculos.d.ts.map +1 -1
- package/lib/e2e/speculos.js +22 -17
- package/lib/e2e/speculos.js.map +1 -1
- package/lib/e2e/speculosAppVersion.d.ts.map +1 -1
- package/lib/e2e/speculosAppVersion.js +5 -2
- package/lib/e2e/speculosAppVersion.js.map +1 -1
- package/lib/e2e/speculosCI.d.ts.map +1 -1
- package/lib/e2e/speculosCI.js +4 -0
- 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/exchange/swap/completeExchange.d.ts.map +1 -1
- package/lib/exchange/swap/completeExchange.js +13 -0
- package/lib/exchange/swap/completeExchange.js.map +1 -1
- package/lib/exchange/swap/getIncompatibleCurrencyKeys.d.ts.map +1 -1
- package/lib/exchange/swap/getIncompatibleCurrencyKeys.js +4 -0
- package/lib/exchange/swap/getIncompatibleCurrencyKeys.js.map +1 -1
- package/lib/exchange/swap/transactionStrategies.d.ts +3 -0
- package/lib/exchange/swap/transactionStrategies.d.ts.map +1 -1
- package/lib/exchange/swap/transactionStrategies.js +12 -2
- package/lib/exchange/swap/transactionStrategies.js.map +1 -1
- package/lib/families/canton/bridge/mock.d.ts +2 -2
- package/lib/families/canton/bridge/mock.d.ts.map +1 -1
- package/lib/families/canton/bridge/mock.js +3 -0
- package/lib/families/canton/bridge/mock.js.map +1 -1
- package/lib/families/canton/config.d.ts.map +1 -1
- package/lib/families/canton/config.js +3 -0
- package/lib/families/canton/config.js.map +1 -1
- package/lib/families/canton/setup.d.ts +3 -3
- package/lib/families/canton/setup.d.ts.map +1 -1
- package/lib/families/canton/setup.js.map +1 -1
- package/lib/families/evm/config.d.ts.map +1 -1
- package/lib/families/evm/config.js +18 -1
- package/lib/families/evm/config.js.map +1 -1
- package/lib/families/hedera/utils.d.ts +2 -0
- package/lib/families/hedera/utils.d.ts.map +1 -0
- package/lib/families/hedera/{logic.js → utils.js} +2 -2
- package/lib/families/hedera/utils.js.map +1 -0
- package/lib/families/sui/react.d.ts.map +1 -1
- package/lib/families/sui/react.js +1 -0
- package/lib/families/sui/react.js.map +1 -1
- package/lib/featureFlags/defaultFeatures.d.ts +3 -0
- package/lib/featureFlags/defaultFeatures.d.ts.map +1 -1
- package/lib/featureFlags/defaultFeatures.js +3 -0
- package/lib/featureFlags/defaultFeatures.js.map +1 -1
- package/lib/generated/bridge/js.d.ts +1 -1
- package/lib/generated/bridge/mock.d.ts +1 -1
- package/lib/generated/deviceTransactionConfig.d.ts +1 -1
- package/lib/generated/specs.d.ts +1 -0
- package/lib/generated/specs.d.ts.map +1 -1
- package/lib/hooks/useDeviceTransactionConfig.d.ts +19 -0
- package/lib/hooks/useDeviceTransactionConfig.d.ts.map +1 -0
- package/lib/hooks/useDeviceTransactionConfig.js +45 -0
- package/lib/hooks/useDeviceTransactionConfig.js.map +1 -0
- package/lib/load/speculos.d.ts.map +1 -1
- package/lib/load/speculos.js +1 -0
- package/lib/load/speculos.js.map +1 -1
- package/lib/modularDrawer/__mocks__/currencies.mock.d.ts +3 -0
- package/lib/modularDrawer/__mocks__/currencies.mock.d.ts.map +1 -1
- package/lib/modularDrawer/__mocks__/currencies.mock.js +40 -1
- package/lib/modularDrawer/__mocks__/currencies.mock.js.map +1 -1
- package/lib/modularDrawer/hooks/useCurrenciesUnderFeatureFlag.d.ts.map +1 -1
- package/lib/modularDrawer/hooks/useCurrenciesUnderFeatureFlag.js +7 -0
- package/lib/modularDrawer/hooks/useCurrenciesUnderFeatureFlag.js.map +1 -1
- package/lib/modularDrawer/utils/index.d.ts +3 -2
- package/lib/modularDrawer/utils/index.d.ts.map +1 -1
- package/lib/modularDrawer/utils/index.js +6 -10
- package/lib/modularDrawer/utils/index.js.map +1 -1
- package/lib/postOnboarding/hooks/useAutoDismissPostOnboardingEntryPoint.js.map +1 -1
- package/lib/postOnboarding/hooks/usePostOnboardingHubState.d.ts.map +1 -1
- package/lib/postOnboarding/hooks/usePostOnboardingHubState.js +7 -6
- package/lib/postOnboarding/hooks/usePostOnboardingHubState.js.map +1 -1
- package/lib/transaction/deviceTransactionConfig.d.ts +1 -1
- package/lib/transaction/deviceTransactionConfig.d.ts.map +1 -1
- package/lib/transaction/deviceTransactionConfig.js +2 -2
- package/lib/transaction/deviceTransactionConfig.js.map +1 -1
- package/lib-es/__tests__/test-helpers/environment.js +2 -0
- package/lib-es/__tests__/test-helpers/environment.js.map +1 -1
- package/lib-es/apps/config.js +1 -1
- package/lib-es/bridge/generic-alpaca/alpaca/network/network-alpaca.d.ts +2 -1
- 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 +3 -0
- 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 +7 -1
- package/lib-es/bridge/generic-alpaca/getAccountShape.js.map +1 -1
- package/lib-es/bridge/generic-alpaca/utils.d.ts.map +1 -1
- package/lib-es/bridge/generic-alpaca/utils.js +5 -4
- package/lib-es/bridge/generic-alpaca/utils.js.map +1 -1
- package/lib-es/dada-client/hooks/useAssetsData.d.ts +4 -10
- package/lib-es/dada-client/hooks/useAssetsData.d.ts.map +1 -1
- package/lib-es/dada-client/hooks/useAssetsData.js +2 -1
- package/lib-es/dada-client/hooks/useAssetsData.js.map +1 -1
- package/lib-es/dada-client/hooks/useInterestRatesByCurrencies.d.ts +5 -1
- package/lib-es/dada-client/hooks/useInterestRatesByCurrencies.d.ts.map +1 -1
- package/lib-es/dada-client/hooks/useMarketByCurrencies.d.ts +4 -1
- package/lib-es/dada-client/hooks/useMarketByCurrencies.d.ts.map +1 -1
- package/lib-es/dada-client/state-manager/api.d.ts.map +1 -1
- package/lib-es/dada-client/state-manager/api.js +3 -0
- package/lib-es/dada-client/state-manager/api.js.map +1 -1
- package/lib-es/dada-client/state-manager/types.d.ts +1 -0
- package/lib-es/dada-client/state-manager/types.d.ts.map +1 -1
- package/lib-es/deposit/helper.d.ts.map +1 -1
- package/lib-es/deposit/helper.js +54 -1
- package/lib-es/deposit/helper.js.map +1 -1
- package/lib-es/e2e/data/deviceLabelsData.d.ts.map +1 -1
- package/lib-es/e2e/data/deviceLabelsData.js +37 -33
- package/lib-es/e2e/data/deviceLabelsData.js.map +1 -1
- package/lib-es/e2e/deviceInteraction/TouchDeviceSimulator.d.ts.map +1 -1
- package/lib-es/e2e/deviceInteraction/TouchDeviceSimulator.js +13 -5
- package/lib-es/e2e/deviceInteraction/TouchDeviceSimulator.js.map +1 -1
- package/lib-es/e2e/enum/Account.d.ts +0 -1
- package/lib-es/e2e/enum/Account.d.ts.map +1 -1
- package/lib-es/e2e/enum/Account.js +0 -1
- package/lib-es/e2e/enum/Account.js.map +1 -1
- package/lib-es/e2e/enum/Currency.d.ts +0 -1
- package/lib-es/e2e/enum/Currency.d.ts.map +1 -1
- package/lib-es/e2e/enum/Currency.js +0 -1
- package/lib-es/e2e/enum/Currency.js.map +1 -1
- package/lib-es/e2e/enum/Device.d.ts +1 -0
- package/lib-es/e2e/enum/Device.d.ts.map +1 -1
- package/lib-es/e2e/enum/Device.js +1 -0
- package/lib-es/e2e/enum/Device.js.map +1 -1
- package/lib-es/e2e/enum/DeviceLabels.d.ts +2 -0
- package/lib-es/e2e/enum/DeviceLabels.d.ts.map +1 -1
- package/lib-es/e2e/enum/DeviceLabels.js +2 -0
- package/lib-es/e2e/enum/DeviceLabels.js.map +1 -1
- package/lib-es/e2e/families/bitcoin.js +1 -1
- package/lib-es/e2e/families/bitcoin.js.map +1 -1
- package/lib-es/e2e/families/cardano.d.ts.map +1 -1
- package/lib-es/e2e/families/cardano.js +12 -11
- package/lib-es/e2e/families/cardano.js.map +1 -1
- package/lib-es/e2e/families/evm.d.ts.map +1 -1
- package/lib-es/e2e/families/evm.js +4 -3
- package/lib-es/e2e/families/evm.js.map +1 -1
- package/lib-es/e2e/families/solana.d.ts.map +1 -1
- package/lib-es/e2e/families/solana.js +1 -1
- package/lib-es/e2e/families/solana.js.map +1 -1
- package/lib-es/e2e/index.d.ts +8 -0
- package/lib-es/e2e/index.d.ts.map +1 -1
- package/lib-es/e2e/speculos.d.ts +2 -0
- package/lib-es/e2e/speculos.d.ts.map +1 -1
- package/lib-es/e2e/speculos.js +22 -17
- package/lib-es/e2e/speculos.js.map +1 -1
- package/lib-es/e2e/speculosAppVersion.d.ts.map +1 -1
- package/lib-es/e2e/speculosAppVersion.js +5 -2
- package/lib-es/e2e/speculosAppVersion.js.map +1 -1
- package/lib-es/e2e/speculosCI.d.ts.map +1 -1
- package/lib-es/e2e/speculosCI.js +4 -0
- 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/exchange/swap/completeExchange.d.ts.map +1 -1
- package/lib-es/exchange/swap/completeExchange.js +13 -0
- package/lib-es/exchange/swap/completeExchange.js.map +1 -1
- package/lib-es/exchange/swap/getIncompatibleCurrencyKeys.d.ts.map +1 -1
- package/lib-es/exchange/swap/getIncompatibleCurrencyKeys.js +4 -0
- package/lib-es/exchange/swap/getIncompatibleCurrencyKeys.js.map +1 -1
- package/lib-es/exchange/swap/transactionStrategies.d.ts +3 -0
- package/lib-es/exchange/swap/transactionStrategies.d.ts.map +1 -1
- package/lib-es/exchange/swap/transactionStrategies.js +10 -1
- package/lib-es/exchange/swap/transactionStrategies.js.map +1 -1
- package/lib-es/families/canton/bridge/mock.d.ts +2 -2
- package/lib-es/families/canton/bridge/mock.d.ts.map +1 -1
- package/lib-es/families/canton/bridge/mock.js +3 -0
- package/lib-es/families/canton/bridge/mock.js.map +1 -1
- package/lib-es/families/canton/config.d.ts.map +1 -1
- package/lib-es/families/canton/config.js +3 -0
- package/lib-es/families/canton/config.js.map +1 -1
- package/lib-es/families/canton/setup.d.ts +3 -3
- package/lib-es/families/canton/setup.d.ts.map +1 -1
- package/lib-es/families/canton/setup.js.map +1 -1
- package/lib-es/families/evm/config.d.ts.map +1 -1
- package/lib-es/families/evm/config.js +18 -1
- package/lib-es/families/evm/config.js.map +1 -1
- package/lib-es/families/hedera/utils.d.ts +2 -0
- package/lib-es/families/hedera/utils.d.ts.map +1 -0
- package/lib-es/families/hedera/utils.js +3 -0
- package/lib-es/families/hedera/utils.js.map +1 -0
- package/lib-es/families/sui/react.d.ts.map +1 -1
- package/lib-es/families/sui/react.js +1 -0
- package/lib-es/families/sui/react.js.map +1 -1
- package/lib-es/featureFlags/defaultFeatures.d.ts +3 -0
- package/lib-es/featureFlags/defaultFeatures.d.ts.map +1 -1
- package/lib-es/featureFlags/defaultFeatures.js +3 -0
- package/lib-es/featureFlags/defaultFeatures.js.map +1 -1
- package/lib-es/generated/bridge/js.d.ts +1 -1
- package/lib-es/generated/bridge/mock.d.ts +1 -1
- package/lib-es/generated/deviceTransactionConfig.d.ts +1 -1
- package/lib-es/generated/specs.d.ts +1 -0
- package/lib-es/generated/specs.d.ts.map +1 -1
- package/lib-es/hooks/useDeviceTransactionConfig.d.ts +19 -0
- package/lib-es/hooks/useDeviceTransactionConfig.d.ts.map +1 -0
- package/lib-es/hooks/useDeviceTransactionConfig.js +41 -0
- package/lib-es/hooks/useDeviceTransactionConfig.js.map +1 -0
- package/lib-es/load/speculos.d.ts.map +1 -1
- package/lib-es/load/speculos.js +1 -0
- package/lib-es/load/speculos.js.map +1 -1
- package/lib-es/modularDrawer/__mocks__/currencies.mock.d.ts +3 -0
- package/lib-es/modularDrawer/__mocks__/currencies.mock.d.ts.map +1 -1
- package/lib-es/modularDrawer/__mocks__/currencies.mock.js +39 -0
- package/lib-es/modularDrawer/__mocks__/currencies.mock.js.map +1 -1
- package/lib-es/modularDrawer/hooks/useCurrenciesUnderFeatureFlag.d.ts.map +1 -1
- package/lib-es/modularDrawer/hooks/useCurrenciesUnderFeatureFlag.js +7 -0
- package/lib-es/modularDrawer/hooks/useCurrenciesUnderFeatureFlag.js.map +1 -1
- package/lib-es/modularDrawer/utils/index.d.ts +3 -2
- package/lib-es/modularDrawer/utils/index.d.ts.map +1 -1
- package/lib-es/modularDrawer/utils/index.js +4 -9
- package/lib-es/modularDrawer/utils/index.js.map +1 -1
- package/lib-es/postOnboarding/hooks/useAutoDismissPostOnboardingEntryPoint.js.map +1 -1
- package/lib-es/postOnboarding/hooks/usePostOnboardingHubState.d.ts.map +1 -1
- package/lib-es/postOnboarding/hooks/usePostOnboardingHubState.js +7 -6
- package/lib-es/postOnboarding/hooks/usePostOnboardingHubState.js.map +1 -1
- package/lib-es/transaction/deviceTransactionConfig.d.ts +1 -1
- package/lib-es/transaction/deviceTransactionConfig.d.ts.map +1 -1
- package/lib-es/transaction/deviceTransactionConfig.js +2 -2
- package/lib-es/transaction/deviceTransactionConfig.js.map +1 -1
- package/package.json +72 -71
- package/src/__tests__/environment.test.ts +8 -5
- package/src/__tests__/migration/account-migration.ts +1 -0
- package/src/__tests__/test-helpers/environment.ts +2 -0
- package/src/account/serialization.test.ts +1 -0
- package/src/apps/config.ts +1 -1
- package/src/bridge/generic-alpaca/alpaca/network/network-alpaca.ts +4 -0
- package/src/bridge/generic-alpaca/getAccountShape.ts +8 -1
- package/src/bridge/generic-alpaca/tests/getAccountShape.test.ts +25 -2
- package/src/bridge/generic-alpaca/utils.test.ts +165 -0
- package/src/bridge/generic-alpaca/utils.ts +5 -4
- package/src/dada-client/hooks/useAssetsData.ts +4 -8
- package/src/dada-client/state-manager/api.ts +3 -0
- package/src/dada-client/state-manager/types.ts +1 -0
- package/src/deposit/helper.ts +65 -1
- package/src/e2e/data/deviceLabelsData.ts +38 -33
- package/src/e2e/deviceInteraction/TouchDeviceSimulator.ts +13 -5
- package/src/e2e/enum/Account.ts +0 -6
- package/src/e2e/enum/Currency.ts +0 -7
- package/src/e2e/enum/Device.ts +1 -0
- package/src/e2e/enum/DeviceLabels.ts +2 -0
- package/src/e2e/families/bitcoin.ts +1 -1
- package/src/e2e/families/cardano.ts +12 -15
- package/src/e2e/families/evm.ts +4 -3
- package/src/e2e/families/solana.ts +1 -4
- package/src/e2e/speculos.ts +32 -18
- package/src/e2e/speculosAppVersion.ts +5 -2
- package/src/e2e/speculosCI.ts +4 -0
- package/src/exchange/swap/completeExchange.ts +17 -0
- package/src/exchange/swap/getIncompatibleCurrencyKeys.ts +4 -0
- package/src/exchange/swap/transactionStrategies.ts +16 -1
- package/src/families/bitcoin/satstack.test.ts +1 -0
- package/src/families/canton/bridge/mock.ts +10 -7
- package/src/families/canton/config.ts +3 -0
- package/src/families/canton/setup.ts +3 -3
- package/src/families/evm/config.ts +18 -1
- package/src/families/hedera/__snapshots__/bridge.integration.test.ts.snap +222 -86
- package/src/families/hedera/utils.ts +2 -0
- package/src/families/sui/react.ts +5 -0
- package/src/featureFlags/defaultFeatures.ts +3 -0
- package/src/hooks/useDeviceTransactionConfig.test.tsx +200 -0
- package/src/hooks/useDeviceTransactionConfig.ts +65 -0
- package/src/load/speculos.ts +1 -0
- package/src/modularDrawer/__mocks__/currencies.mock.ts +40 -0
- package/src/modularDrawer/hooks/useCurrenciesUnderFeatureFlag.ts +7 -0
- package/src/modularDrawer/utils/index.ts +6 -10
- package/src/postOnboarding/hooks/useAutoDismissPostOnboardingEntryPoint.ts +1 -1
- package/src/postOnboarding/hooks/usePostOnboardingHubState.ts +7 -9
- package/src/transaction/deviceTransactionConfig.ts +3 -3
- package/lib/families/hedera/logic.d.ts +0 -2
- package/lib/families/hedera/logic.d.ts.map +0 -1
- package/lib/families/hedera/logic.js.map +0 -1
- package/lib-es/families/hedera/logic.d.ts +0 -2
- package/lib-es/families/hedera/logic.d.ts.map +0 -1
- package/lib-es/families/hedera/logic.js +0 -3
- package/lib-es/families/hedera/logic.js.map +0 -1
- package/src/dada-client/MIGRATION_GUIDE.md +0 -187
- package/src/families/hedera/logic.ts +0 -2
- package/src/families/sui/__snapshots__/bridge.integration.test.ts.snap +0 -428
- package/src/modularDrawer/utils/index.test.ts +0 -43
package/src/deposit/helper.ts
CHANGED
|
@@ -7,6 +7,66 @@ import {
|
|
|
7
7
|
hasCryptoCurrencyId,
|
|
8
8
|
} from "../currencies";
|
|
9
9
|
import { getMappedAssets } from "./api";
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* WORKAROUND: Fallback mappings for currencies not yet available in getMappedAssets()
|
|
13
|
+
* TODO: Remove these entries once they are properly supported by the mapping service
|
|
14
|
+
*
|
|
15
|
+
* Each entry maps a Ledger currency ID to its provider ID.
|
|
16
|
+
* The provider ID is used to group currencies by their external provider (e.g., CoinGecko).
|
|
17
|
+
*/
|
|
18
|
+
const FALLBACK_CURRENCY_MAPPINGS: Record<string, string> = {
|
|
19
|
+
// Canton Network - using canton_network as both ledgerId and providerId
|
|
20
|
+
canton_network: "canton_network",
|
|
21
|
+
canton_network_devnet: "canton_network_devnet",
|
|
22
|
+
canton_network_testnet: "canton_network_testnet",
|
|
23
|
+
|
|
24
|
+
// Add more fallback mappings here as needed:
|
|
25
|
+
// "ledger_currency_id": "provider_id",
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Creates synthetic MappedAsset entries for currencies that are not yet available
|
|
30
|
+
* in the mapping service API but need to be supported.
|
|
31
|
+
*/
|
|
32
|
+
const createFallbackMappedAssets = (
|
|
33
|
+
currencies: CryptoOrTokenCurrency[],
|
|
34
|
+
existingAssets: MappedAsset[],
|
|
35
|
+
): MappedAsset[] => {
|
|
36
|
+
const existingLedgerIds = new Set(existingAssets.map(asset => asset.ledgerId.toLowerCase()));
|
|
37
|
+
const fallbackAssets: MappedAsset[] = [];
|
|
38
|
+
|
|
39
|
+
for (const [currencyId, providerId] of Object.entries(FALLBACK_CURRENCY_MAPPINGS)) {
|
|
40
|
+
// Skip if currency already exists in mapped assets
|
|
41
|
+
if (existingLedgerIds.has(currencyId.toLowerCase())) {
|
|
42
|
+
continue;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
// Find the currency in the list
|
|
46
|
+
const currency = currencies.find(c => c.id === currencyId);
|
|
47
|
+
if (currency) {
|
|
48
|
+
fallbackAssets.push({
|
|
49
|
+
$type: currency.type === "TokenCurrency" ? "Token" : "Coin",
|
|
50
|
+
ledgerId: currency.id,
|
|
51
|
+
providerId: providerId,
|
|
52
|
+
name: currency.name,
|
|
53
|
+
ticker: currency.ticker,
|
|
54
|
+
network: currency.type === "TokenCurrency" ? currency.parentCurrency?.id : undefined,
|
|
55
|
+
contract: currency.type === "TokenCurrency" ? currency.contractAddress : undefined,
|
|
56
|
+
status: "active",
|
|
57
|
+
reason: null,
|
|
58
|
+
data: {
|
|
59
|
+
img: "",
|
|
60
|
+
marketCapRank: null,
|
|
61
|
+
},
|
|
62
|
+
ledgerCurrency: currency,
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
return fallbackAssets;
|
|
68
|
+
};
|
|
69
|
+
|
|
10
70
|
export const loadCurrenciesByProvider = async (
|
|
11
71
|
coinsAndTokensSupported: CryptoOrTokenCurrency[],
|
|
12
72
|
): Promise<GroupedCurrencies> => {
|
|
@@ -15,7 +75,11 @@ export const loadCurrenciesByProvider = async (
|
|
|
15
75
|
getMappedAssets(),
|
|
16
76
|
]);
|
|
17
77
|
|
|
18
|
-
|
|
78
|
+
// Merge API assets with fallback assets for currencies not yet in the API
|
|
79
|
+
const fallbackAssets = createFallbackMappedAssets(sortedCurrenciesSupported, assets);
|
|
80
|
+
const allAssets = [...assets, ...fallbackAssets];
|
|
81
|
+
|
|
82
|
+
return groupCurrenciesByProvider(allAssets, sortedCurrenciesSupported);
|
|
19
83
|
};
|
|
20
84
|
export const groupCurrenciesByProvider = (
|
|
21
85
|
assets: MappedAsset[],
|
|
@@ -35,6 +35,35 @@ type DeviceLabelsConfig = {
|
|
|
35
35
|
[key in DeviceModelId]?: LabelConfig;
|
|
36
36
|
};
|
|
37
37
|
|
|
38
|
+
const TOUCHSCREEN_DEVICE_CONFIG: LabelConfig = {
|
|
39
|
+
receiveVerify: {
|
|
40
|
+
[AppInfos.BNB_CHAIN.name]: DeviceLabels.VERIFY_BSC,
|
|
41
|
+
[AppInfos.COSMOS.name]: DeviceLabels.VERIFY_COSMOS,
|
|
42
|
+
[AppInfos.ETHEREUM.name]: DeviceLabels.VERIFY_ETHEREUM,
|
|
43
|
+
[AppInfos.POLKADOT.name]: DeviceLabels.PLEASE_REVIEW,
|
|
44
|
+
[AppInfos.POLYGON.name]: DeviceLabels.VERIFY_POLYGON,
|
|
45
|
+
[AppInfos.SOLANA.name]: DeviceLabels.VERIFY_SOLANA_ADDRESS,
|
|
46
|
+
default: DeviceLabels.ADDRESS,
|
|
47
|
+
},
|
|
48
|
+
receiveConfirm: {
|
|
49
|
+
default: DeviceLabels.CONFIRM,
|
|
50
|
+
},
|
|
51
|
+
delegateVerify: {
|
|
52
|
+
[AppInfos.NEAR.name]: DeviceLabels.VIEW_HEADER,
|
|
53
|
+
default: DeviceLabels.REVIEW_OPERATION,
|
|
54
|
+
},
|
|
55
|
+
delegateConfirm: {
|
|
56
|
+
[AppInfos.NEAR.name]: DeviceLabels.CONTINUE_TO_ACTION,
|
|
57
|
+
default: DeviceLabels.HOLD_TO_SIGN,
|
|
58
|
+
},
|
|
59
|
+
sendVerify: {
|
|
60
|
+
default: DeviceLabels.REVIEW_OPERATION,
|
|
61
|
+
},
|
|
62
|
+
sendConfirm: {
|
|
63
|
+
default: DeviceLabels.HOLD_TO_SIGN,
|
|
64
|
+
},
|
|
65
|
+
};
|
|
66
|
+
|
|
38
67
|
export const DEVICE_LABELS_CONFIG: DeviceLabelsConfig = {
|
|
39
68
|
[DeviceModelId.nanoS]: {
|
|
40
69
|
receiveVerify: {
|
|
@@ -66,10 +95,11 @@ export const DEVICE_LABELS_CONFIG: DeviceLabelsConfig = {
|
|
|
66
95
|
default: DeviceLabels.CAPS_APPROVE,
|
|
67
96
|
},
|
|
68
97
|
sendVerify: {
|
|
98
|
+
[AppInfos.SOLANA.name]: DeviceLabels.TRANSFER,
|
|
69
99
|
default: DeviceLabels.REVIEW_OPERATION,
|
|
70
100
|
},
|
|
71
101
|
sendConfirm: {
|
|
72
|
-
[AppInfos.SOLANA.name]: DeviceLabels.
|
|
102
|
+
[AppInfos.SOLANA.name]: DeviceLabels.APPROVE,
|
|
73
103
|
[AppInfos.TRON.name]: DeviceLabels.SIGN,
|
|
74
104
|
[AppInfos.STELLAR.name]: DeviceLabels.SIGN,
|
|
75
105
|
[AppInfos.RIPPLE.name]: DeviceLabels.SIGN,
|
|
@@ -79,34 +109,8 @@ export const DEVICE_LABELS_CONFIG: DeviceLabelsConfig = {
|
|
|
79
109
|
default: DeviceLabels.CAPS_APPROVE,
|
|
80
110
|
},
|
|
81
111
|
},
|
|
82
|
-
[DeviceModelId.stax]:
|
|
83
|
-
|
|
84
|
-
[AppInfos.BNB_CHAIN.name]: DeviceLabels.VERIFY_BSC,
|
|
85
|
-
[AppInfos.COSMOS.name]: DeviceLabels.PLEASE_REVIEW,
|
|
86
|
-
[AppInfos.ETHEREUM.name]: DeviceLabels.VERIFY_ETHEREUM,
|
|
87
|
-
[AppInfos.POLKADOT.name]: DeviceLabels.PLEASE_REVIEW,
|
|
88
|
-
[AppInfos.POLYGON.name]: DeviceLabels.VERIFY_POLYGON,
|
|
89
|
-
[AppInfos.SOLANA.name]: DeviceLabels.VERIFY_SOLANA_ADDRESS,
|
|
90
|
-
default: DeviceLabels.ADDRESS,
|
|
91
|
-
},
|
|
92
|
-
receiveConfirm: {
|
|
93
|
-
default: DeviceLabels.CONFIRM,
|
|
94
|
-
},
|
|
95
|
-
delegateVerify: {
|
|
96
|
-
[AppInfos.NEAR.name]: DeviceLabels.VIEW_HEADER,
|
|
97
|
-
default: DeviceLabels.REVIEW_OPERATION,
|
|
98
|
-
},
|
|
99
|
-
delegateConfirm: {
|
|
100
|
-
[AppInfos.NEAR.name]: DeviceLabels.CONTINUE_TO_ACTION,
|
|
101
|
-
default: DeviceLabels.HOLD_TO_SIGN,
|
|
102
|
-
},
|
|
103
|
-
sendVerify: {
|
|
104
|
-
default: DeviceLabels.REVIEW_OPERATION,
|
|
105
|
-
},
|
|
106
|
-
sendConfirm: {
|
|
107
|
-
default: DeviceLabels.HOLD_TO_SIGN,
|
|
108
|
-
},
|
|
109
|
-
},
|
|
112
|
+
[DeviceModelId.stax]: TOUCHSCREEN_DEVICE_CONFIG,
|
|
113
|
+
[DeviceModelId.europa]: TOUCHSCREEN_DEVICE_CONFIG,
|
|
110
114
|
default: {
|
|
111
115
|
receiveVerify: {
|
|
112
116
|
[AppInfos.BNB_CHAIN.name]: DeviceLabels.VERIFY_BSC,
|
|
@@ -131,7 +135,7 @@ export const DEVICE_LABELS_CONFIG: DeviceLabelsConfig = {
|
|
|
131
135
|
[AppInfos.COSMOS.name]: DeviceLabels.PLEASE_REVIEW,
|
|
132
136
|
[AppInfos.MULTIVERS_X.name]: DeviceLabels.RECEIVER,
|
|
133
137
|
[AppInfos.NEAR.name]: DeviceLabels.VIEW_HEADER,
|
|
134
|
-
[AppInfos.SOLANA.name]: DeviceLabels.
|
|
138
|
+
[AppInfos.SOLANA.name]: DeviceLabels.REVIEW_TRANSACTION_TO,
|
|
135
139
|
default: DeviceLabels.REVIEW_OPERATION,
|
|
136
140
|
},
|
|
137
141
|
delegateConfirm: {
|
|
@@ -141,17 +145,17 @@ export const DEVICE_LABELS_CONFIG: DeviceLabelsConfig = {
|
|
|
141
145
|
[AppInfos.INJECTIVE.name]: DeviceLabels.CAPS_APPROVE,
|
|
142
146
|
[AppInfos.MULTIVERS_X.name]: DeviceLabels.SIGN,
|
|
143
147
|
[AppInfos.NEAR.name]: DeviceLabels.CONTINUE_TO_ACTION,
|
|
144
|
-
[AppInfos.SOLANA.name]: DeviceLabels.SIGN_TRANSACTION,
|
|
145
148
|
[AppInfos.OSMOSIS.name]: DeviceLabels.CAPS_APPROVE,
|
|
149
|
+
[AppInfos.SOLANA.name]: DeviceLabels.SIGN,
|
|
146
150
|
default: DeviceLabels.APPROVE,
|
|
147
151
|
},
|
|
148
152
|
sendVerify: {
|
|
149
|
-
[AppInfos.SOLANA.name]: DeviceLabels.
|
|
153
|
+
[AppInfos.SOLANA.name]: DeviceLabels.REVIEW_TRANSACTION_TO,
|
|
150
154
|
[AppInfos.RIPPLE.name]: DeviceLabels.TRANSACTION_TYPE,
|
|
151
155
|
default: DeviceLabels.REVIEW_OPERATION,
|
|
152
156
|
},
|
|
153
157
|
sendConfirm: {
|
|
154
|
-
[AppInfos.SOLANA.name]: DeviceLabels.
|
|
158
|
+
[AppInfos.SOLANA.name]: DeviceLabels.SIGN_TRANSACTION,
|
|
155
159
|
[AppInfos.TRON.name]: DeviceLabels.SIGN,
|
|
156
160
|
[AppInfos.STELLAR.name]: DeviceLabels.SIGN,
|
|
157
161
|
[AppInfos.RIPPLE.name]: DeviceLabels.SIGN,
|
|
@@ -160,6 +164,7 @@ export const DEVICE_LABELS_CONFIG: DeviceLabelsConfig = {
|
|
|
160
164
|
[AppInfos.BITCOIN.name]: DeviceLabels.SIGN_TRANSACTION,
|
|
161
165
|
[AppInfos.KASPA.name]: DeviceLabels.APPROVE,
|
|
162
166
|
[AppInfos.DOGECOIN.name]: DeviceLabels.ACCEPT,
|
|
167
|
+
[AppInfos.BITCOIN_CASH.name]: DeviceLabels.ACCEPT,
|
|
163
168
|
default: DeviceLabels.CAPS_APPROVE,
|
|
164
169
|
},
|
|
165
170
|
},
|
|
@@ -10,16 +10,24 @@ function getSpeculosInfo(): {
|
|
|
10
10
|
const speculosAddress = getSpeculosAddress();
|
|
11
11
|
return { speculosApiPort, speculosAddress };
|
|
12
12
|
}
|
|
13
|
+
|
|
13
14
|
export async function pressAndRelease(deviceLabel: string, x?: number, y?: number) {
|
|
14
15
|
const { speculosApiPort, speculosAddress } = getSpeculosInfo();
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
let xCoord: number;
|
|
17
|
+
let yCoord: number;
|
|
18
|
+
if (x && y) {
|
|
19
|
+
xCoord = x;
|
|
20
|
+
yCoord = y;
|
|
21
|
+
} else {
|
|
22
|
+
const coords = await getDeviceLabelCoordinates(deviceLabel, speculosApiPort);
|
|
23
|
+
xCoord = coords.x;
|
|
24
|
+
yCoord = coords.y;
|
|
25
|
+
}
|
|
18
26
|
await retryAxiosRequest(() =>
|
|
19
27
|
axios.post(`${speculosAddress}:${speculosApiPort}/finger`, {
|
|
20
28
|
action: "press-and-release",
|
|
21
|
-
x:
|
|
22
|
-
y:
|
|
29
|
+
x: xCoord,
|
|
30
|
+
y: yCoord,
|
|
23
31
|
}),
|
|
24
32
|
);
|
|
25
33
|
}
|
package/src/e2e/enum/Account.ts
CHANGED
|
@@ -108,12 +108,6 @@ export class Account {
|
|
|
108
108
|
"0xa1baa625c5E6A9304cB7AcD86d2fee6B710eC3eB",
|
|
109
109
|
1,
|
|
110
110
|
);
|
|
111
|
-
static readonly BSC_POL = new Account(
|
|
112
|
-
Currency.BSC_POL,
|
|
113
|
-
"BNB Chain 1",
|
|
114
|
-
"0x4BE2E2B8872AA298D6d123b9211B53E41f611566",
|
|
115
|
-
0,
|
|
116
|
-
);
|
|
117
111
|
static readonly BSC_SHIBA = new Account(
|
|
118
112
|
Currency.BSC_SHIBA,
|
|
119
113
|
"BNB Chain 1",
|
package/src/e2e/enum/Currency.ts
CHANGED
|
@@ -156,13 +156,6 @@ export class Currency {
|
|
|
156
156
|
AppInfos.BNB_CHAIN,
|
|
157
157
|
[Network.BNB_CHAIN, Network.POLYGON],
|
|
158
158
|
);
|
|
159
|
-
static readonly BSC_POL = new Currency(
|
|
160
|
-
"Matic Token",
|
|
161
|
-
"MATIC",
|
|
162
|
-
"bsc/bep20/matic_token",
|
|
163
|
-
AppInfos.BNB_CHAIN,
|
|
164
|
-
[Network.BNB_CHAIN],
|
|
165
|
-
);
|
|
166
159
|
static readonly BSC_SHIBA = new Currency("Shiba Inu", "SHIB", "bsc", AppInfos.BNB_CHAIN, [
|
|
167
160
|
Network.BNB_CHAIN,
|
|
168
161
|
Network.ETHEREUM,
|
package/src/e2e/enum/Device.ts
CHANGED
|
@@ -39,6 +39,7 @@ export enum DeviceLabels {
|
|
|
39
39
|
REVIEW_OPERATION = "Review",
|
|
40
40
|
REMOVE_PHONE_OR_COMPUTER = "Remove phone or computer",
|
|
41
41
|
REVIEW_TRANSACTION = "Review transaction",
|
|
42
|
+
REVIEW_TRANSACTION_TO = "Review transaction to",
|
|
42
43
|
SEND = "Send",
|
|
43
44
|
SEND_TO_ADDRESS = "Send to address",
|
|
44
45
|
SEND_TO_ADDRESS_2 = "Send to address (2/2)",
|
|
@@ -59,6 +60,7 @@ export enum DeviceLabels {
|
|
|
59
60
|
VERIFY_BSC = "Verify BSC",
|
|
60
61
|
VERIFY_ETHEREUM = "Verify Ethereum",
|
|
61
62
|
VERIFY_POLYGON = "Verify Polygon",
|
|
63
|
+
VERIFY_COSMOS = "Verify Cosmos",
|
|
62
64
|
VERIFY_SOLANA_ADDRESS = "Verify Solana address",
|
|
63
65
|
VIEW_ACTION = "View action",
|
|
64
66
|
VIEW_HEADER = "View Header",
|
|
@@ -32,7 +32,7 @@ export async function sendBTC(tx: Transaction) {
|
|
|
32
32
|
expect(isAmountCorrect).toBeTruthy();
|
|
33
33
|
const isAddressCorrect = containsSubstringInEvent(tx.accountToCredit.address, events);
|
|
34
34
|
expect(isAddressCorrect).toBeTruthy();
|
|
35
|
-
if (
|
|
35
|
+
if (isTouchDevice()) {
|
|
36
36
|
await longPressAndRelease(DeviceLabels.HOLD_TO_SIGN, 3);
|
|
37
37
|
} else {
|
|
38
38
|
await pressBoth();
|
|
@@ -10,6 +10,7 @@ import {
|
|
|
10
10
|
} from "../deviceInteraction/TouchDeviceSimulator";
|
|
11
11
|
import { DeviceLabels } from "../enum/DeviceLabels";
|
|
12
12
|
import { DeviceModelId } from "@ledgerhq/types-devices";
|
|
13
|
+
import { isTouchDevice } from "../speculosAppVersion";
|
|
13
14
|
|
|
14
15
|
type ActionType = "both" | "right" | "tap" | "swipe" | "confirm" | "hold";
|
|
15
16
|
|
|
@@ -20,7 +21,7 @@ function validateTransactionData(tx: Transaction, events: string[]) {
|
|
|
20
21
|
expect(isAmountCorrect).toBeTruthy();
|
|
21
22
|
}
|
|
22
23
|
|
|
23
|
-
async function
|
|
24
|
+
async function sendCardanoTouchDevices(tx: Transaction) {
|
|
24
25
|
await waitFor(DeviceLabels.REVIEW_TRANSACTION);
|
|
25
26
|
const events = await pressUntilTextFound(DeviceLabels.TO);
|
|
26
27
|
validateTransactionData(tx, events);
|
|
@@ -60,8 +61,8 @@ async function sendCardanoButtonDevice(tx: Transaction) {
|
|
|
60
61
|
|
|
61
62
|
export async function sendCardano(tx: Transaction) {
|
|
62
63
|
const speculosModel = getSpeculosModel();
|
|
63
|
-
if (
|
|
64
|
-
return
|
|
64
|
+
if (isTouchDevice()) {
|
|
65
|
+
return sendCardanoTouchDevices(tx);
|
|
65
66
|
}
|
|
66
67
|
if (speculosModel === DeviceModelId.nanoS) {
|
|
67
68
|
return sendCardanoNanoS(tx);
|
|
@@ -70,7 +71,7 @@ export async function sendCardano(tx: Transaction) {
|
|
|
70
71
|
}
|
|
71
72
|
|
|
72
73
|
const DELEGATE_STEPS_CONFIG = {
|
|
73
|
-
[DeviceModelId.stax]: [
|
|
74
|
+
[DeviceModelId.stax || DeviceModelId.europa]: [
|
|
74
75
|
[DeviceLabels.REVIEW_TRANSACTION, "swipe"],
|
|
75
76
|
[DeviceLabels.TAP_TO_CONTINUE, "tap"],
|
|
76
77
|
[DeviceLabels.REGISTER, "swipe"],
|
|
@@ -107,7 +108,7 @@ const DELEGATE_STEPS_CONFIG = {
|
|
|
107
108
|
] as const,
|
|
108
109
|
};
|
|
109
110
|
|
|
110
|
-
async function
|
|
111
|
+
async function delegateTouchDevicesAction(label: DeviceLabels) {
|
|
111
112
|
const CONFIRM_BUTTON_COORDS = { x: 139, y: 532 };
|
|
112
113
|
await waitFor(label);
|
|
113
114
|
switch (label) {
|
|
@@ -135,14 +136,10 @@ async function delegateNanoAction(label: DeviceLabels, action: ActionType) {
|
|
|
135
136
|
}
|
|
136
137
|
}
|
|
137
138
|
|
|
138
|
-
async function executeDelegateStep(
|
|
139
|
-
label: DeviceLabels,
|
|
140
|
-
action: ActionType,
|
|
141
|
-
speculosModel: DeviceModelId,
|
|
142
|
-
) {
|
|
139
|
+
async function executeDelegateStep(label: DeviceLabels, action: ActionType) {
|
|
143
140
|
try {
|
|
144
|
-
if (
|
|
145
|
-
await
|
|
141
|
+
if (isTouchDevice()) {
|
|
142
|
+
await delegateTouchDevicesAction(label);
|
|
146
143
|
} else {
|
|
147
144
|
await delegateNanoAction(label, action);
|
|
148
145
|
}
|
|
@@ -156,13 +153,13 @@ async function executeDelegateStep(
|
|
|
156
153
|
export async function delegateCardano() {
|
|
157
154
|
const speculosModel = getSpeculosModel();
|
|
158
155
|
const steps =
|
|
159
|
-
speculosModel === DeviceModelId.stax
|
|
160
|
-
? DELEGATE_STEPS_CONFIG[
|
|
156
|
+
speculosModel === DeviceModelId.stax || speculosModel === DeviceModelId.europa
|
|
157
|
+
? DELEGATE_STEPS_CONFIG[speculosModel]
|
|
161
158
|
: speculosModel === DeviceModelId.nanoS
|
|
162
159
|
? DELEGATE_STEPS_CONFIG[DeviceModelId.nanoS]
|
|
163
160
|
: DELEGATE_STEPS_CONFIG.default;
|
|
164
161
|
|
|
165
162
|
for (const [label, action] of steps) {
|
|
166
|
-
await executeDelegateStep(label, action
|
|
163
|
+
await executeDelegateStep(label, action);
|
|
167
164
|
}
|
|
168
165
|
}
|
package/src/e2e/families/evm.ts
CHANGED
|
@@ -7,6 +7,7 @@ import { longPressAndRelease } from "../deviceInteraction/TouchDeviceSimulator";
|
|
|
7
7
|
import { DeviceLabels } from "../enum/DeviceLabels";
|
|
8
8
|
import { Device } from "../enum/Device";
|
|
9
9
|
import { DeviceModelId } from "@ledgerhq/types-devices";
|
|
10
|
+
import { isTouchDevice } from "../speculosAppVersion";
|
|
10
11
|
|
|
11
12
|
function validateTransactionData(tx: Transaction, events: string[]) {
|
|
12
13
|
const isAmountCorrect = containsSubstringInEvent(tx.amount, events);
|
|
@@ -20,7 +21,7 @@ function validateTransactionData(tx: Transaction, events: string[]) {
|
|
|
20
21
|
}
|
|
21
22
|
}
|
|
22
23
|
|
|
23
|
-
async function
|
|
24
|
+
async function sendEvmTouchDevices(tx: Transaction) {
|
|
24
25
|
const events = await pressUntilTextFound(DeviceLabels.HOLD_TO_SIGN);
|
|
25
26
|
validateTransactionData(tx, events);
|
|
26
27
|
await longPressAndRelease(DeviceLabels.HOLD_TO_SIGN, 3);
|
|
@@ -40,8 +41,8 @@ async function sendEvmNanoS(tx: Transaction) {
|
|
|
40
41
|
|
|
41
42
|
export async function sendEVM(tx: Transaction) {
|
|
42
43
|
const speculosModel = getSpeculosModel();
|
|
43
|
-
if (
|
|
44
|
-
return
|
|
44
|
+
if (isTouchDevice()) {
|
|
45
|
+
return sendEvmTouchDevices(tx);
|
|
45
46
|
}
|
|
46
47
|
if (speculosModel === DeviceModelId.nanoS) {
|
|
47
48
|
return sendEvmNanoS(tx);
|
|
@@ -22,10 +22,7 @@ export async function sendSolana(tx: Transaction) {
|
|
|
22
22
|
const isAmountCorrect = containsSubstringInEvent(tx.amount, events);
|
|
23
23
|
expect(isAmountCorrect).toBeTruthy();
|
|
24
24
|
if (process.env.SPECULOS_DEVICE !== Device.LNS.name) {
|
|
25
|
-
const isAddressCorrect = containsSubstringInEvent(
|
|
26
|
-
tx.accountToCredit.parentAccount?.address ?? tx.accountToCredit.address,
|
|
27
|
-
events,
|
|
28
|
-
);
|
|
25
|
+
const isAddressCorrect = containsSubstringInEvent(tx.accountToCredit.address, events);
|
|
29
26
|
expect(isAddressCorrect).toBeTruthy();
|
|
30
27
|
}
|
|
31
28
|
|
package/src/e2e/speculos.ts
CHANGED
|
@@ -69,6 +69,8 @@ export type Dependency = { name: string; appVersion?: string };
|
|
|
69
69
|
export type SpeculosDevice = {
|
|
70
70
|
id: string;
|
|
71
71
|
port: number;
|
|
72
|
+
appName?: string;
|
|
73
|
+
appVersion?: string;
|
|
72
74
|
};
|
|
73
75
|
|
|
74
76
|
export function setExchangeDependencies(dependencies: Dependency[]) {
|
|
@@ -418,7 +420,12 @@ export async function startSpeculos(
|
|
|
418
420
|
? await createSpeculosDeviceCI(deviceParams)
|
|
419
421
|
: await createSpeculosDevice(deviceParams).then(device => {
|
|
420
422
|
invariant(device.ports.apiPort, "[E2E] Speculos apiPort is not defined");
|
|
421
|
-
return {
|
|
423
|
+
return {
|
|
424
|
+
id: device.id,
|
|
425
|
+
port: device.ports.apiPort,
|
|
426
|
+
appName: appCandidate.appName,
|
|
427
|
+
appVersion: appCandidate.appVersion,
|
|
428
|
+
};
|
|
422
429
|
});
|
|
423
430
|
} catch (e: unknown) {
|
|
424
431
|
console.error(e);
|
|
@@ -654,7 +661,12 @@ export async function activateLedgerSync() {
|
|
|
654
661
|
export async function activateExpertMode() {
|
|
655
662
|
if (isTouchDevice()) {
|
|
656
663
|
await goToSettings();
|
|
657
|
-
|
|
664
|
+
const SettingsToggle1Coordinates = { x: 344, y: 136 };
|
|
665
|
+
await pressAndRelease(
|
|
666
|
+
DeviceLabels.SETTINGS_TOGGLE_1,
|
|
667
|
+
SettingsToggle1Coordinates.x,
|
|
668
|
+
SettingsToggle1Coordinates.y,
|
|
669
|
+
);
|
|
658
670
|
} else {
|
|
659
671
|
await pressUntilTextFound(DeviceLabels.EXPERT_MODE);
|
|
660
672
|
await pressBoth();
|
|
@@ -670,7 +682,12 @@ export async function activateContractData() {
|
|
|
670
682
|
|
|
671
683
|
export async function goToSettings() {
|
|
672
684
|
if (isTouchDevice()) {
|
|
673
|
-
|
|
685
|
+
const SettingsCogwheelCoordinates = { x: 400, y: 75 };
|
|
686
|
+
await pressAndRelease(
|
|
687
|
+
DeviceLabels.SETTINGS,
|
|
688
|
+
SettingsCogwheelCoordinates.x,
|
|
689
|
+
SettingsCogwheelCoordinates.y,
|
|
690
|
+
);
|
|
674
691
|
} else {
|
|
675
692
|
await pressUntilTextFound(DeviceLabels.SETTINGS);
|
|
676
693
|
await pressBoth();
|
|
@@ -723,26 +740,23 @@ export function getDeviceLabels(appInfo: AppInfos): DeviceLabelsReturn {
|
|
|
723
740
|
export async function expectValidAddressDevice(account: Account, addressDisplayed: string) {
|
|
724
741
|
if (account.currency === Currency.SUI_USDC) {
|
|
725
742
|
providePublicKey();
|
|
743
|
+
}
|
|
744
|
+
const { receiveVerifyLabel, receiveConfirmLabel } = getDeviceLabels(account.currency.speculosApp);
|
|
745
|
+
await waitFor(receiveVerifyLabel);
|
|
746
|
+
if (isTouchDevice()) {
|
|
747
|
+
const events = await pressUntilTextFound(receiveConfirmLabel);
|
|
748
|
+
const isAddressCorrect = containsSubstringInEvent(addressDisplayed, events);
|
|
749
|
+
expect(isAddressCorrect).toBeTruthy();
|
|
750
|
+
await pressAndRelease(DeviceLabels.CONFIRM);
|
|
726
751
|
} else {
|
|
727
752
|
const { receiveVerifyLabel, receiveConfirmLabel } = getDeviceLabels(
|
|
728
753
|
account.currency.speculosApp,
|
|
729
754
|
);
|
|
730
755
|
await waitFor(receiveVerifyLabel);
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
await pressAndRelease(DeviceLabels.CONFIRM);
|
|
736
|
-
} else {
|
|
737
|
-
const { receiveVerifyLabel, receiveConfirmLabel } = getDeviceLabels(
|
|
738
|
-
account.currency.speculosApp,
|
|
739
|
-
);
|
|
740
|
-
await waitFor(receiveVerifyLabel);
|
|
741
|
-
const events = await pressUntilTextFound(receiveConfirmLabel);
|
|
742
|
-
const isAddressCorrect = containsSubstringInEvent(addressDisplayed, events);
|
|
743
|
-
expect(isAddressCorrect).toBeTruthy();
|
|
744
|
-
await pressBoth();
|
|
745
|
-
}
|
|
756
|
+
const events = await pressUntilTextFound(receiveConfirmLabel);
|
|
757
|
+
const isAddressCorrect = containsSubstringInEvent(addressDisplayed, events);
|
|
758
|
+
expect(isAddressCorrect).toBeTruthy();
|
|
759
|
+
await pressBoth();
|
|
746
760
|
}
|
|
747
761
|
}
|
|
748
762
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { HttpManagerApiRepository, ApplicationV2Entity } from "@ledgerhq/device-core";
|
|
2
|
-
import { version } from "
|
|
2
|
+
import { version } from "../../package.json";
|
|
3
3
|
import { getEnv } from "@ledgerhq/live-env";
|
|
4
4
|
import { DeviceModelId } from "@ledgerhq/devices";
|
|
5
5
|
import { Device as CryptoWallet } from "./enum/Device";
|
|
@@ -15,6 +15,8 @@ export function getSpeculosModel(): DeviceModelId {
|
|
|
15
15
|
return DeviceModelId.nanoX;
|
|
16
16
|
case CryptoWallet.STAX.name:
|
|
17
17
|
return DeviceModelId.stax;
|
|
18
|
+
case CryptoWallet.FLEX.name:
|
|
19
|
+
return DeviceModelId.europa;
|
|
18
20
|
case CryptoWallet.LNSP.name:
|
|
19
21
|
default:
|
|
20
22
|
return DeviceModelId.nanoSP;
|
|
@@ -23,7 +25,7 @@ export function getSpeculosModel(): DeviceModelId {
|
|
|
23
25
|
|
|
24
26
|
export function isTouchDevice(): boolean {
|
|
25
27
|
const model = getSpeculosModel();
|
|
26
|
-
return model === DeviceModelId.stax;
|
|
28
|
+
return model === DeviceModelId.stax || model === DeviceModelId.europa;
|
|
27
29
|
}
|
|
28
30
|
|
|
29
31
|
function getDeviceTargetId(device: DeviceModelId): number {
|
|
@@ -32,6 +34,7 @@ function getDeviceTargetId(device: DeviceModelId): number {
|
|
|
32
34
|
[DeviceModelId.nanoX]: CryptoWallet.LNX.targetId,
|
|
33
35
|
[DeviceModelId.nanoSP]: CryptoWallet.LNSP.targetId,
|
|
34
36
|
[DeviceModelId.stax]: CryptoWallet.STAX.targetId,
|
|
37
|
+
[DeviceModelId.europa]: CryptoWallet.FLEX.targetId,
|
|
35
38
|
};
|
|
36
39
|
return modelToTargetIdMap[device];
|
|
37
40
|
}
|
package/src/e2e/speculosCI.ts
CHANGED
|
@@ -171,6 +171,8 @@ export async function createSpeculosDeviceCI(
|
|
|
171
171
|
return {
|
|
172
172
|
id: runId,
|
|
173
173
|
port: speculosPort,
|
|
174
|
+
appName: deviceParams.appName,
|
|
175
|
+
appVersion: deviceParams.appVersion,
|
|
174
176
|
};
|
|
175
177
|
} catch (e: unknown) {
|
|
176
178
|
console.warn(
|
|
@@ -179,6 +181,8 @@ export async function createSpeculosDeviceCI(
|
|
|
179
181
|
return {
|
|
180
182
|
id: runId,
|
|
181
183
|
port: 0,
|
|
184
|
+
appName: deviceParams.appName,
|
|
185
|
+
appVersion: deviceParams.appVersion,
|
|
182
186
|
};
|
|
183
187
|
}
|
|
184
188
|
}
|
|
@@ -33,6 +33,7 @@ import { AddressesSanctionedError } from "@ledgerhq/coin-framework/sanction/erro
|
|
|
33
33
|
import { getCryptoCurrencyById } from "../../currencies";
|
|
34
34
|
|
|
35
35
|
const COMPLETE_EXCHANGE_LOG = "SWAP-CompleteExchange";
|
|
36
|
+
const LIFI_GAS_LIMIT_BUFFER_MULTIPLIER = 1.3;
|
|
36
37
|
|
|
37
38
|
const completeExchange = (
|
|
38
39
|
input: CompleteExchangeInputSwap,
|
|
@@ -79,6 +80,8 @@ const completeExchange = (
|
|
|
79
80
|
const refundCurrency = getAccountCurrency(fromAccount);
|
|
80
81
|
const mainRefundCurrency = getAccountCurrency(refundAccount);
|
|
81
82
|
|
|
83
|
+
const isLifi = provider.toLocaleLowerCase() === "lifi";
|
|
84
|
+
|
|
82
85
|
const sanctionedAddresses: string[] = [];
|
|
83
86
|
for (const acc of [refundAccount, payoutAccount]) {
|
|
84
87
|
const isSanctioned = await isAddressSanctioned(acc.currency, acc.freshAddress);
|
|
@@ -130,6 +133,20 @@ const completeExchange = (
|
|
|
130
133
|
|
|
131
134
|
if (unsubscribed) return;
|
|
132
135
|
|
|
136
|
+
/**
|
|
137
|
+
* LiFi swap transactions are frequently failing on-chain.
|
|
138
|
+
* The failures are due to "out of gas" errors. This indicates the gas limit estimated for the transaction is too low.
|
|
139
|
+
* Manually resubmitting a failed transaction with a higher gasLimit allows it to succeed.
|
|
140
|
+
* The root cause is that our explorers are somehow under-estimating the transaction,
|
|
141
|
+
* or the gasLimit changes and gets increased in the next few blocks.
|
|
142
|
+
* Solution: Manually override the gas limit only for LiFi transactions and create a 30% safety buffer.
|
|
143
|
+
*/
|
|
144
|
+
if (isLifi && transaction.family === "evm") {
|
|
145
|
+
transaction.gasLimit = BigNumber(transaction.gasLimit).times(
|
|
146
|
+
LIFI_GAS_LIMIT_BUFFER_MULTIPLIER,
|
|
147
|
+
);
|
|
148
|
+
}
|
|
149
|
+
|
|
133
150
|
const { errors, estimatedFees } = await accountBridge.getTransactionStatus(
|
|
134
151
|
refundAccount,
|
|
135
152
|
transaction,
|
|
@@ -79,6 +79,10 @@ const INCOMPATIBLE_NANO_S_CURRENCY_KEYS: Keys = {
|
|
|
79
79
|
title: "swap.incompatibility.kaspa_title",
|
|
80
80
|
description: "swap.incompatibility.kaspa_description",
|
|
81
81
|
},
|
|
82
|
+
celo: {
|
|
83
|
+
title: "swap.incompatibility.celo_title",
|
|
84
|
+
description: "swap.incompatibility.celo_description",
|
|
85
|
+
},
|
|
82
86
|
};
|
|
83
87
|
|
|
84
88
|
export const getIncompatibleCurrencyKeys = (exchange: ExchangeSwap) => {
|
|
@@ -237,6 +237,21 @@ export function cosmosTransaction({
|
|
|
237
237
|
};
|
|
238
238
|
}
|
|
239
239
|
|
|
240
|
+
export function hederaTransaction({
|
|
241
|
+
amount,
|
|
242
|
+
recipient,
|
|
243
|
+
customFeeConfig,
|
|
244
|
+
payinExtraId,
|
|
245
|
+
}: TransactionWithCustomFee): Partial<Extract<Transaction, { family: "hedera" }>> {
|
|
246
|
+
return {
|
|
247
|
+
family: "hedera",
|
|
248
|
+
amount,
|
|
249
|
+
recipient,
|
|
250
|
+
...customFeeConfig,
|
|
251
|
+
memo: payinExtraId ?? undefined,
|
|
252
|
+
};
|
|
253
|
+
}
|
|
254
|
+
|
|
240
255
|
export type TransactionWithCustomFee = TransactionCommon & {
|
|
241
256
|
customFeeConfig: {
|
|
242
257
|
[key: string]: BigNumber;
|
|
@@ -266,7 +281,7 @@ export const transactionStrategy: {
|
|
|
266
281
|
cosmos: cosmosTransaction,
|
|
267
282
|
evm: evmTransaction,
|
|
268
283
|
filecoin: defaultTransaction,
|
|
269
|
-
hedera:
|
|
284
|
+
hedera: hederaTransaction,
|
|
270
285
|
icon: defaultTransaction,
|
|
271
286
|
internet_computer: defaultTransaction,
|
|
272
287
|
mina: defaultTransaction,
|
|
@@ -236,6 +236,7 @@ describe("editSatStackConfig", () => {
|
|
|
236
236
|
setCryptoAssetsStoreForCoinFramework({
|
|
237
237
|
findTokenById: (_: string) => undefined,
|
|
238
238
|
findTokenByAddressInCurrency: (_: string, __: string) => undefined,
|
|
239
|
+
getTokensSyncHash: (_: string) => Promise.resolve("0"),
|
|
239
240
|
} as CryptoAssetsStore);
|
|
240
241
|
const config = {
|
|
241
242
|
node: { ...mockConfig, tls: false },
|