@ledgerhq/live-common 34.53.0-nightly.20251115023630 → 34.53.0-nightly.20251119023741
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/bridge.d.ts.map +1 -1
- package/lib/__tests__/test-helpers/bridge.js +0 -4
- package/lib/__tests__/test-helpers/bridge.js.map +1 -1
- package/lib/bridge/generic-alpaca/getAccountShape.d.ts.map +1 -1
- package/lib/bridge/generic-alpaca/getAccountShape.js +12 -10
- package/lib/bridge/generic-alpaca/getAccountShape.js.map +1 -1
- package/lib/currencies/helpers.d.ts +1 -3
- package/lib/currencies/helpers.d.ts.map +1 -1
- package/lib/currencies/helpers.js +1 -27
- package/lib/currencies/helpers.js.map +1 -1
- package/lib/dada-client/hooks/useAssetsData.d.ts +1 -0
- package/lib/dada-client/hooks/useAssetsData.d.ts.map +1 -1
- package/lib/dada-client/hooks/useAssetsData.js +1 -0
- package/lib/dada-client/hooks/useAssetsData.js.map +1 -1
- package/lib/deposit/type.d.ts +0 -17
- package/lib/deposit/type.d.ts.map +1 -1
- package/lib/deposit/type.js.map +1 -1
- package/lib/deviceSDK/actions/getBatteryStatuses.d.ts +2 -1
- package/lib/deviceSDK/actions/getBatteryStatuses.d.ts.map +1 -1
- package/lib/deviceSDK/actions/getBatteryStatuses.js +2 -2
- package/lib/deviceSDK/actions/getBatteryStatuses.js.map +1 -1
- package/lib/deviceSDK/actions/getDeviceInfo.d.ts +2 -1
- package/lib/deviceSDK/actions/getDeviceInfo.d.ts.map +1 -1
- package/lib/deviceSDK/actions/getDeviceInfo.js +2 -2
- package/lib/deviceSDK/actions/getDeviceInfo.js.map +1 -1
- package/lib/deviceSDK/actions/getLatestAvailableFirmware.d.ts +2 -1
- package/lib/deviceSDK/actions/getLatestAvailableFirmware.d.ts.map +1 -1
- package/lib/deviceSDK/actions/getLatestAvailableFirmware.js +6 -3
- package/lib/deviceSDK/actions/getLatestAvailableFirmware.js.map +1 -1
- package/lib/deviceSDK/actions/toggleOnboardingEarlyCheck.d.ts +2 -1
- package/lib/deviceSDK/actions/toggleOnboardingEarlyCheck.d.ts.map +1 -1
- package/lib/deviceSDK/actions/toggleOnboardingEarlyCheck.js +2 -2
- package/lib/deviceSDK/actions/toggleOnboardingEarlyCheck.js.map +1 -1
- package/lib/deviceSDK/actions/updateFirmware.d.ts +2 -1
- package/lib/deviceSDK/actions/updateFirmware.d.ts.map +1 -1
- package/lib/deviceSDK/actions/updateFirmware.js +4 -3
- package/lib/deviceSDK/actions/updateFirmware.js.map +1 -1
- package/lib/deviceSDK/hooks/useBatteryStatuses.d.ts +2 -1
- package/lib/deviceSDK/hooks/useBatteryStatuses.d.ts.map +1 -1
- package/lib/deviceSDK/hooks/useBatteryStatuses.js +3 -2
- package/lib/deviceSDK/hooks/useBatteryStatuses.js.map +1 -1
- package/lib/deviceSDK/hooks/useGetDeviceInfo.d.ts +2 -1
- package/lib/deviceSDK/hooks/useGetDeviceInfo.d.ts.map +1 -1
- package/lib/deviceSDK/hooks/useGetDeviceInfo.js +3 -3
- package/lib/deviceSDK/hooks/useGetDeviceInfo.js.map +1 -1
- package/lib/deviceSDK/hooks/useGetLatestAvailableFirmware.d.ts +2 -1
- package/lib/deviceSDK/hooks/useGetLatestAvailableFirmware.d.ts.map +1 -1
- package/lib/deviceSDK/hooks/useGetLatestAvailableFirmware.js +2 -1
- package/lib/deviceSDK/hooks/useGetLatestAvailableFirmware.js.map +1 -1
- package/lib/deviceSDK/hooks/useToggleOnboardingEarlyChecks.d.ts +2 -1
- package/lib/deviceSDK/hooks/useToggleOnboardingEarlyChecks.d.ts.map +1 -1
- package/lib/deviceSDK/hooks/useToggleOnboardingEarlyChecks.js +3 -2
- package/lib/deviceSDK/hooks/useToggleOnboardingEarlyChecks.js.map +1 -1
- package/lib/deviceSDK/hooks/useUpdateFirmware.d.ts +2 -1
- package/lib/deviceSDK/hooks/useUpdateFirmware.d.ts.map +1 -1
- package/lib/deviceSDK/hooks/useUpdateFirmware.js +3 -2
- package/lib/deviceSDK/hooks/useUpdateFirmware.js.map +1 -1
- package/lib/deviceSDK/tasks/core.d.ts +1 -1
- package/lib/deviceSDK/tasks/core.d.ts.map +1 -1
- package/lib/deviceSDK/tasks/core.js +1 -1
- package/lib/deviceSDK/tasks/core.js.map +1 -1
- package/lib/deviceSDK/tasks/getBatteryStatuses.d.ts +1 -0
- package/lib/deviceSDK/tasks/getBatteryStatuses.d.ts.map +1 -1
- package/lib/deviceSDK/tasks/getBatteryStatuses.js +2 -2
- package/lib/deviceSDK/tasks/getBatteryStatuses.js.map +1 -1
- package/lib/deviceSDK/tasks/getDeviceInfo.d.ts +2 -1
- package/lib/deviceSDK/tasks/getDeviceInfo.d.ts.map +1 -1
- package/lib/deviceSDK/tasks/getDeviceInfo.js +2 -2
- package/lib/deviceSDK/tasks/getDeviceInfo.js.map +1 -1
- package/lib/deviceSDK/tasks/getLatestFirmware.d.ts +1 -0
- package/lib/deviceSDK/tasks/getLatestFirmware.d.ts.map +1 -1
- package/lib/deviceSDK/tasks/getLatestFirmware.js +2 -2
- package/lib/deviceSDK/tasks/getLatestFirmware.js.map +1 -1
- package/lib/deviceSDK/tasks/toggleOnboardingEarlyCheck.d.ts +1 -0
- package/lib/deviceSDK/tasks/toggleOnboardingEarlyCheck.d.ts.map +1 -1
- package/lib/deviceSDK/tasks/toggleOnboardingEarlyCheck.js +2 -2
- package/lib/deviceSDK/tasks/toggleOnboardingEarlyCheck.js.map +1 -1
- package/lib/deviceSDK/tasks/updateFirmware.d.ts +1 -0
- package/lib/deviceSDK/tasks/updateFirmware.d.ts.map +1 -1
- package/lib/deviceSDK/tasks/updateFirmware.js +2 -2
- package/lib/deviceSDK/tasks/updateFirmware.js.map +1 -1
- package/lib/deviceSDK/transports/core.d.ts +1 -0
- package/lib/deviceSDK/transports/core.d.ts.map +1 -1
- package/lib/deviceSDK/transports/core.js +2 -2
- package/lib/deviceSDK/transports/core.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 +1 -5
- package/lib/e2e/enum/Currency.js.map +1 -1
- package/lib/e2e/enum/ReceiveFundsOptions.d.ts +6 -0
- package/lib/e2e/enum/ReceiveFundsOptions.d.ts.map +1 -0
- package/lib/e2e/enum/ReceiveFundsOptions.js +8 -0
- package/lib/e2e/enum/ReceiveFundsOptions.js.map +1 -0
- package/lib/exchange/providers/swap.d.ts +1 -0
- package/lib/exchange/providers/swap.d.ts.map +1 -1
- package/lib/exchange/providers/swap.js +5 -1
- package/lib/exchange/providers/swap.js.map +1 -1
- package/lib/exchange/swap/hooks/v5/useFetchCurrencyAll.d.ts.map +1 -1
- package/lib/exchange/swap/hooks/v5/useFetchCurrencyAll.js +2 -3
- package/lib/exchange/swap/hooks/v5/useFetchCurrencyAll.js.map +1 -1
- package/lib/exchange/swap/hooks/v5/useFilteredProviders.d.ts.map +1 -1
- package/lib/exchange/swap/hooks/v5/useFilteredProviders.js +15 -10
- package/lib/exchange/swap/hooks/v5/useFilteredProviders.js.map +1 -1
- package/lib/hw/actions/app.d.ts.map +1 -1
- package/lib/hw/actions/app.js +2 -1
- package/lib/hw/actions/app.js.map +1 -1
- package/lib/hw/actions/customLockScreenLoad.d.ts +1 -1
- package/lib/hw/actions/customLockScreenLoad.d.ts.map +1 -1
- package/lib/hw/actions/customLockScreenLoad.js +2 -0
- package/lib/hw/actions/customLockScreenLoad.js.map +1 -1
- package/lib/hw/actions/implementations.d.ts +1 -0
- package/lib/hw/actions/implementations.d.ts.map +1 -1
- package/lib/hw/actions/implementations.js +12 -2
- package/lib/hw/actions/implementations.js.map +1 -1
- package/lib/hw/connectApp.d.ts +2 -1
- package/lib/hw/connectApp.d.ts.map +1 -1
- package/lib/hw/connectApp.js +4 -4
- package/lib/hw/connectApp.js.map +1 -1
- package/lib/hw/connectManager.d.ts +2 -1
- package/lib/hw/connectManager.d.ts.map +1 -1
- package/lib/hw/connectManager.js +4 -4
- package/lib/hw/connectManager.js.map +1 -1
- package/lib/hw/customLockScreenFetch.d.ts +2 -1
- package/lib/hw/customLockScreenFetch.d.ts.map +1 -1
- package/lib/hw/customLockScreenFetch.js +2 -2
- package/lib/hw/customLockScreenFetch.js.map +1 -1
- package/lib/hw/customLockScreenLoad.d.ts +2 -1
- package/lib/hw/customLockScreenLoad.d.ts.map +1 -1
- package/lib/hw/customLockScreenLoad.js +2 -2
- package/lib/hw/customLockScreenLoad.js.map +1 -1
- package/lib/hw/deviceAccess.d.ts +3 -3
- package/lib/hw/deviceAccess.d.ts.map +1 -1
- package/lib/hw/deviceAccess.js +2 -1
- package/lib/hw/deviceAccess.js.map +1 -1
- package/lib/hw/getGenuineCheckFromDeviceId.d.ts +2 -1
- package/lib/hw/getGenuineCheckFromDeviceId.d.ts.map +1 -1
- package/lib/hw/getGenuineCheckFromDeviceId.js +2 -2
- package/lib/hw/getGenuineCheckFromDeviceId.js.map +1 -1
- package/lib/hw/getOnboardingStatePolling.d.ts +2 -1
- package/lib/hw/getOnboardingStatePolling.d.ts.map +1 -1
- package/lib/hw/getOnboardingStatePolling.js +5 -2
- package/lib/hw/getOnboardingStatePolling.js.map +1 -1
- package/lib/hw/hooks/useGenuineCheck.d.ts +2 -1
- package/lib/hw/hooks/useGenuineCheck.d.ts.map +1 -1
- package/lib/hw/hooks/useGenuineCheck.js +3 -1
- package/lib/hw/hooks/useGenuineCheck.js.map +1 -1
- package/lib/hw/index.d.ts +6 -2
- package/lib/hw/index.d.ts.map +1 -1
- package/lib/hw/index.js +6 -6
- package/lib/hw/index.js.map +1 -1
- package/lib/hw/installLanguage.d.ts +2 -1
- package/lib/hw/installLanguage.d.ts.map +1 -1
- package/lib/hw/installLanguage.js +2 -2
- package/lib/hw/installLanguage.js.map +1 -1
- package/lib/market/hooks/useMarketDataProvider.js +1 -0
- package/lib/market/hooks/useMarketDataProvider.js.map +1 -1
- package/lib/market/utils/types.d.ts +1 -0
- package/lib/market/utils/types.d.ts.map +1 -1
- package/lib/market/utils/types.js.map +1 -1
- package/lib/modularDrawer/hooks/useCurrenciesUnderFeatureFlag.d.ts.map +1 -1
- package/lib/modularDrawer/hooks/useCurrenciesUnderFeatureFlag.js +2 -0
- package/lib/modularDrawer/hooks/useCurrenciesUnderFeatureFlag.js.map +1 -1
- package/lib/modularDrawer/hooks/useNetworkAccountCounts.d.ts +1 -5
- package/lib/modularDrawer/hooks/useNetworkAccountCounts.d.ts.map +1 -1
- package/lib/modularDrawer/hooks/useNetworkAccountCounts.js +2 -2
- package/lib/modularDrawer/hooks/useNetworkAccountCounts.js.map +1 -1
- package/lib/modularDrawer/modules/createNetworkConfiguration.d.ts +1 -1
- package/lib/modularDrawer/modules/createNetworkConfiguration.d.ts.map +1 -1
- package/lib/modularDrawer/modules/createNetworkConfiguration.js +1 -2
- package/lib/modularDrawer/modules/createNetworkConfiguration.js.map +1 -1
- package/lib/modularDrawer/utils/{groupCurrenciesByProvider.d.ts → groupCurrenciesByAsset.d.ts} +2 -2
- package/lib/modularDrawer/utils/groupCurrenciesByAsset.d.ts.map +1 -0
- package/lib/modularDrawer/utils/{groupCurrenciesByProvider.js → groupCurrenciesByAsset.js} +7 -7
- package/lib/modularDrawer/utils/groupCurrenciesByAsset.js.map +1 -0
- package/lib/modularDrawer/utils/index.d.ts +1 -1
- package/lib/modularDrawer/utils/index.d.ts.map +1 -1
- package/lib/modularDrawer/utils/index.js +3 -3
- package/lib/modularDrawer/utils/index.js.map +1 -1
- package/lib/modularDrawer/utils/type.d.ts +0 -5
- package/lib/modularDrawer/utils/type.d.ts.map +1 -1
- package/lib/onboarding/hooks/useOnboardingStatePolling.d.ts.map +1 -1
- package/lib/onboarding/hooks/useOnboardingStatePolling.js +1 -0
- package/lib/onboarding/hooks/useOnboardingStatePolling.js.map +1 -1
- package/lib/platform/filters.d.ts +1 -2
- package/lib/platform/filters.d.ts.map +1 -1
- package/lib/platform/filters.js +1 -17
- package/lib/platform/filters.js.map +1 -1
- package/lib/platform/helpers.d.ts +1 -5
- package/lib/platform/helpers.d.ts.map +1 -1
- package/lib/platform/helpers.js +1 -33
- package/lib/platform/helpers.js.map +1 -1
- package/lib/platform/react.d.ts +2 -3
- package/lib/platform/react.d.ts.map +1 -1
- package/lib/platform/react.js +66 -16
- package/lib/platform/react.js.map +1 -1
- package/lib/platform/types.d.ts +3 -3
- package/lib/platform/types.d.ts.map +1 -1
- package/lib/utils/getAccountTuplesForCurrency.d.ts +1 -1
- package/lib/utils/getAccountTuplesForCurrency.d.ts.map +1 -1
- package/lib/utils/getAccountTuplesForCurrency.js +2 -3
- package/lib/utils/getAccountTuplesForCurrency.js.map +1 -1
- package/lib/wallet-api/Exchange/server.d.ts.map +1 -1
- package/lib/wallet-api/Exchange/server.js +5 -4
- package/lib/wallet-api/Exchange/server.js.map +1 -1
- package/lib/wallet-api/converters.d.ts +1 -0
- package/lib/wallet-api/converters.d.ts.map +1 -1
- package/lib/wallet-api/converters.js +7 -2
- package/lib/wallet-api/converters.js.map +1 -1
- package/lib/wallet-api/react.d.ts +6 -11
- package/lib/wallet-api/react.d.ts.map +1 -1
- package/lib/wallet-api/react.js +291 -135
- package/lib/wallet-api/react.js.map +1 -1
- package/lib/wallet-api/tracking.d.ts +6 -0
- package/lib/wallet-api/tracking.d.ts.map +1 -1
- package/lib/wallet-api/tracking.js +20 -0
- package/lib/wallet-api/tracking.js.map +1 -1
- package/lib/wallet-api/types.d.ts +3 -0
- package/lib/wallet-api/types.d.ts.map +1 -1
- package/lib/wallet-api/useDappLogic.d.ts.map +1 -1
- package/lib/wallet-api/useDappLogic.js +65 -80
- package/lib/wallet-api/useDappLogic.js.map +1 -1
- package/lib/wallet-api/utils/deriveAccountIdForManifest.d.ts +6 -0
- package/lib/wallet-api/utils/deriveAccountIdForManifest.d.ts.map +1 -1
- package/lib/wallet-api/utils/deriveAccountIdForManifest.js +13 -3
- package/lib/wallet-api/utils/deriveAccountIdForManifest.js.map +1 -1
- package/lib-es/__tests__/test-helpers/bridge.d.ts.map +1 -1
- package/lib-es/__tests__/test-helpers/bridge.js +0 -4
- package/lib-es/__tests__/test-helpers/bridge.js.map +1 -1
- package/lib-es/bridge/generic-alpaca/getAccountShape.d.ts.map +1 -1
- package/lib-es/bridge/generic-alpaca/getAccountShape.js +13 -11
- package/lib-es/bridge/generic-alpaca/getAccountShape.js.map +1 -1
- package/lib-es/currencies/helpers.d.ts +1 -3
- package/lib-es/currencies/helpers.d.ts.map +1 -1
- package/lib-es/currencies/helpers.js +0 -24
- package/lib-es/currencies/helpers.js.map +1 -1
- package/lib-es/dada-client/hooks/useAssetsData.d.ts +1 -0
- package/lib-es/dada-client/hooks/useAssetsData.d.ts.map +1 -1
- package/lib-es/dada-client/hooks/useAssetsData.js +1 -0
- package/lib-es/dada-client/hooks/useAssetsData.js.map +1 -1
- package/lib-es/deposit/type.d.ts +0 -17
- package/lib-es/deposit/type.d.ts.map +1 -1
- package/lib-es/deposit/type.js.map +1 -1
- package/lib-es/deviceSDK/actions/getBatteryStatuses.d.ts +2 -1
- package/lib-es/deviceSDK/actions/getBatteryStatuses.d.ts.map +1 -1
- package/lib-es/deviceSDK/actions/getBatteryStatuses.js +2 -2
- package/lib-es/deviceSDK/actions/getBatteryStatuses.js.map +1 -1
- package/lib-es/deviceSDK/actions/getDeviceInfo.d.ts +2 -1
- package/lib-es/deviceSDK/actions/getDeviceInfo.d.ts.map +1 -1
- package/lib-es/deviceSDK/actions/getDeviceInfo.js +2 -2
- package/lib-es/deviceSDK/actions/getDeviceInfo.js.map +1 -1
- package/lib-es/deviceSDK/actions/getLatestAvailableFirmware.d.ts +2 -1
- package/lib-es/deviceSDK/actions/getLatestAvailableFirmware.d.ts.map +1 -1
- package/lib-es/deviceSDK/actions/getLatestAvailableFirmware.js +6 -3
- package/lib-es/deviceSDK/actions/getLatestAvailableFirmware.js.map +1 -1
- package/lib-es/deviceSDK/actions/toggleOnboardingEarlyCheck.d.ts +2 -1
- package/lib-es/deviceSDK/actions/toggleOnboardingEarlyCheck.d.ts.map +1 -1
- package/lib-es/deviceSDK/actions/toggleOnboardingEarlyCheck.js +2 -2
- package/lib-es/deviceSDK/actions/toggleOnboardingEarlyCheck.js.map +1 -1
- package/lib-es/deviceSDK/actions/updateFirmware.d.ts +2 -1
- package/lib-es/deviceSDK/actions/updateFirmware.d.ts.map +1 -1
- package/lib-es/deviceSDK/actions/updateFirmware.js +4 -3
- package/lib-es/deviceSDK/actions/updateFirmware.js.map +1 -1
- package/lib-es/deviceSDK/hooks/useBatteryStatuses.d.ts +2 -1
- package/lib-es/deviceSDK/hooks/useBatteryStatuses.d.ts.map +1 -1
- package/lib-es/deviceSDK/hooks/useBatteryStatuses.js +3 -2
- package/lib-es/deviceSDK/hooks/useBatteryStatuses.js.map +1 -1
- package/lib-es/deviceSDK/hooks/useGetDeviceInfo.d.ts +2 -1
- package/lib-es/deviceSDK/hooks/useGetDeviceInfo.d.ts.map +1 -1
- package/lib-es/deviceSDK/hooks/useGetDeviceInfo.js +3 -3
- package/lib-es/deviceSDK/hooks/useGetDeviceInfo.js.map +1 -1
- package/lib-es/deviceSDK/hooks/useGetLatestAvailableFirmware.d.ts +2 -1
- package/lib-es/deviceSDK/hooks/useGetLatestAvailableFirmware.d.ts.map +1 -1
- package/lib-es/deviceSDK/hooks/useGetLatestAvailableFirmware.js +2 -1
- package/lib-es/deviceSDK/hooks/useGetLatestAvailableFirmware.js.map +1 -1
- package/lib-es/deviceSDK/hooks/useToggleOnboardingEarlyChecks.d.ts +2 -1
- package/lib-es/deviceSDK/hooks/useToggleOnboardingEarlyChecks.d.ts.map +1 -1
- package/lib-es/deviceSDK/hooks/useToggleOnboardingEarlyChecks.js +3 -2
- package/lib-es/deviceSDK/hooks/useToggleOnboardingEarlyChecks.js.map +1 -1
- package/lib-es/deviceSDK/hooks/useUpdateFirmware.d.ts +2 -1
- package/lib-es/deviceSDK/hooks/useUpdateFirmware.d.ts.map +1 -1
- package/lib-es/deviceSDK/hooks/useUpdateFirmware.js +3 -2
- package/lib-es/deviceSDK/hooks/useUpdateFirmware.js.map +1 -1
- package/lib-es/deviceSDK/tasks/core.d.ts +1 -1
- package/lib-es/deviceSDK/tasks/core.d.ts.map +1 -1
- package/lib-es/deviceSDK/tasks/core.js +1 -1
- package/lib-es/deviceSDK/tasks/core.js.map +1 -1
- package/lib-es/deviceSDK/tasks/getBatteryStatuses.d.ts +1 -0
- package/lib-es/deviceSDK/tasks/getBatteryStatuses.d.ts.map +1 -1
- package/lib-es/deviceSDK/tasks/getBatteryStatuses.js +2 -2
- package/lib-es/deviceSDK/tasks/getBatteryStatuses.js.map +1 -1
- package/lib-es/deviceSDK/tasks/getDeviceInfo.d.ts +2 -1
- package/lib-es/deviceSDK/tasks/getDeviceInfo.d.ts.map +1 -1
- package/lib-es/deviceSDK/tasks/getDeviceInfo.js +2 -2
- package/lib-es/deviceSDK/tasks/getDeviceInfo.js.map +1 -1
- package/lib-es/deviceSDK/tasks/getLatestFirmware.d.ts +1 -0
- package/lib-es/deviceSDK/tasks/getLatestFirmware.d.ts.map +1 -1
- package/lib-es/deviceSDK/tasks/getLatestFirmware.js +2 -2
- package/lib-es/deviceSDK/tasks/getLatestFirmware.js.map +1 -1
- package/lib-es/deviceSDK/tasks/toggleOnboardingEarlyCheck.d.ts +1 -0
- package/lib-es/deviceSDK/tasks/toggleOnboardingEarlyCheck.d.ts.map +1 -1
- package/lib-es/deviceSDK/tasks/toggleOnboardingEarlyCheck.js +2 -2
- package/lib-es/deviceSDK/tasks/toggleOnboardingEarlyCheck.js.map +1 -1
- package/lib-es/deviceSDK/tasks/updateFirmware.d.ts +1 -0
- package/lib-es/deviceSDK/tasks/updateFirmware.d.ts.map +1 -1
- package/lib-es/deviceSDK/tasks/updateFirmware.js +2 -2
- package/lib-es/deviceSDK/tasks/updateFirmware.js.map +1 -1
- package/lib-es/deviceSDK/transports/core.d.ts +1 -0
- package/lib-es/deviceSDK/transports/core.d.ts.map +1 -1
- package/lib-es/deviceSDK/transports/core.js +2 -2
- package/lib-es/deviceSDK/transports/core.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 +1 -5
- package/lib-es/e2e/enum/Currency.js.map +1 -1
- package/lib-es/e2e/enum/ReceiveFundsOptions.d.ts +6 -0
- package/lib-es/e2e/enum/ReceiveFundsOptions.d.ts.map +1 -0
- package/lib-es/e2e/enum/ReceiveFundsOptions.js +5 -0
- package/lib-es/e2e/enum/ReceiveFundsOptions.js.map +1 -0
- package/lib-es/exchange/providers/swap.d.ts +1 -0
- package/lib-es/exchange/providers/swap.d.ts.map +1 -1
- package/lib-es/exchange/providers/swap.js +3 -0
- package/lib-es/exchange/providers/swap.js.map +1 -1
- package/lib-es/exchange/swap/hooks/v5/useFetchCurrencyAll.d.ts.map +1 -1
- package/lib-es/exchange/swap/hooks/v5/useFetchCurrencyAll.js +2 -3
- package/lib-es/exchange/swap/hooks/v5/useFetchCurrencyAll.js.map +1 -1
- package/lib-es/exchange/swap/hooks/v5/useFilteredProviders.d.ts.map +1 -1
- package/lib-es/exchange/swap/hooks/v5/useFilteredProviders.js +17 -12
- package/lib-es/exchange/swap/hooks/v5/useFilteredProviders.js.map +1 -1
- package/lib-es/hw/actions/app.d.ts.map +1 -1
- package/lib-es/hw/actions/app.js +2 -1
- package/lib-es/hw/actions/app.js.map +1 -1
- package/lib-es/hw/actions/customLockScreenLoad.d.ts +1 -1
- package/lib-es/hw/actions/customLockScreenLoad.d.ts.map +1 -1
- package/lib-es/hw/actions/customLockScreenLoad.js +2 -0
- package/lib-es/hw/actions/customLockScreenLoad.js.map +1 -1
- package/lib-es/hw/actions/implementations.d.ts +1 -0
- package/lib-es/hw/actions/implementations.d.ts.map +1 -1
- package/lib-es/hw/actions/implementations.js +12 -2
- package/lib-es/hw/actions/implementations.js.map +1 -1
- package/lib-es/hw/connectApp.d.ts +2 -1
- package/lib-es/hw/connectApp.d.ts.map +1 -1
- package/lib-es/hw/connectApp.js +4 -4
- package/lib-es/hw/connectApp.js.map +1 -1
- package/lib-es/hw/connectManager.d.ts +2 -1
- package/lib-es/hw/connectManager.d.ts.map +1 -1
- package/lib-es/hw/connectManager.js +4 -4
- package/lib-es/hw/connectManager.js.map +1 -1
- package/lib-es/hw/customLockScreenFetch.d.ts +2 -1
- package/lib-es/hw/customLockScreenFetch.d.ts.map +1 -1
- package/lib-es/hw/customLockScreenFetch.js +2 -2
- package/lib-es/hw/customLockScreenFetch.js.map +1 -1
- package/lib-es/hw/customLockScreenLoad.d.ts +2 -1
- package/lib-es/hw/customLockScreenLoad.d.ts.map +1 -1
- package/lib-es/hw/customLockScreenLoad.js +2 -2
- package/lib-es/hw/customLockScreenLoad.js.map +1 -1
- package/lib-es/hw/deviceAccess.d.ts +3 -3
- package/lib-es/hw/deviceAccess.d.ts.map +1 -1
- package/lib-es/hw/deviceAccess.js +2 -1
- package/lib-es/hw/deviceAccess.js.map +1 -1
- package/lib-es/hw/getGenuineCheckFromDeviceId.d.ts +2 -1
- package/lib-es/hw/getGenuineCheckFromDeviceId.d.ts.map +1 -1
- package/lib-es/hw/getGenuineCheckFromDeviceId.js +2 -2
- package/lib-es/hw/getGenuineCheckFromDeviceId.js.map +1 -1
- package/lib-es/hw/getOnboardingStatePolling.d.ts +2 -1
- package/lib-es/hw/getOnboardingStatePolling.d.ts.map +1 -1
- package/lib-es/hw/getOnboardingStatePolling.js +5 -2
- package/lib-es/hw/getOnboardingStatePolling.js.map +1 -1
- package/lib-es/hw/hooks/useGenuineCheck.d.ts +2 -1
- package/lib-es/hw/hooks/useGenuineCheck.d.ts.map +1 -1
- package/lib-es/hw/hooks/useGenuineCheck.js +3 -1
- package/lib-es/hw/hooks/useGenuineCheck.js.map +1 -1
- package/lib-es/hw/index.d.ts +6 -2
- package/lib-es/hw/index.d.ts.map +1 -1
- package/lib-es/hw/index.js +6 -6
- package/lib-es/hw/index.js.map +1 -1
- package/lib-es/hw/installLanguage.d.ts +2 -1
- package/lib-es/hw/installLanguage.d.ts.map +1 -1
- package/lib-es/hw/installLanguage.js +2 -2
- package/lib-es/hw/installLanguage.js.map +1 -1
- package/lib-es/market/hooks/useMarketDataProvider.js +1 -0
- package/lib-es/market/hooks/useMarketDataProvider.js.map +1 -1
- package/lib-es/market/utils/types.d.ts +1 -0
- package/lib-es/market/utils/types.d.ts.map +1 -1
- package/lib-es/market/utils/types.js.map +1 -1
- package/lib-es/modularDrawer/hooks/useCurrenciesUnderFeatureFlag.d.ts.map +1 -1
- package/lib-es/modularDrawer/hooks/useCurrenciesUnderFeatureFlag.js +2 -0
- package/lib-es/modularDrawer/hooks/useCurrenciesUnderFeatureFlag.js.map +1 -1
- package/lib-es/modularDrawer/hooks/useNetworkAccountCounts.d.ts +1 -5
- package/lib-es/modularDrawer/hooks/useNetworkAccountCounts.d.ts.map +1 -1
- package/lib-es/modularDrawer/hooks/useNetworkAccountCounts.js +2 -2
- package/lib-es/modularDrawer/hooks/useNetworkAccountCounts.js.map +1 -1
- package/lib-es/modularDrawer/modules/createNetworkConfiguration.d.ts +1 -1
- package/lib-es/modularDrawer/modules/createNetworkConfiguration.d.ts.map +1 -1
- package/lib-es/modularDrawer/modules/createNetworkConfiguration.js +1 -2
- package/lib-es/modularDrawer/modules/createNetworkConfiguration.js.map +1 -1
- package/lib-es/modularDrawer/utils/{groupCurrenciesByProvider.d.ts → groupCurrenciesByAsset.d.ts} +2 -2
- package/lib-es/modularDrawer/utils/groupCurrenciesByAsset.d.ts.map +1 -0
- package/lib-es/modularDrawer/utils/{groupCurrenciesByProvider.js → groupCurrenciesByAsset.js} +5 -5
- package/lib-es/modularDrawer/utils/groupCurrenciesByAsset.js.map +1 -0
- package/lib-es/modularDrawer/utils/index.d.ts +1 -1
- package/lib-es/modularDrawer/utils/index.d.ts.map +1 -1
- package/lib-es/modularDrawer/utils/index.js +1 -1
- package/lib-es/modularDrawer/utils/index.js.map +1 -1
- package/lib-es/modularDrawer/utils/type.d.ts +0 -5
- package/lib-es/modularDrawer/utils/type.d.ts.map +1 -1
- package/lib-es/onboarding/hooks/useOnboardingStatePolling.d.ts.map +1 -1
- package/lib-es/onboarding/hooks/useOnboardingStatePolling.js +1 -0
- package/lib-es/onboarding/hooks/useOnboardingStatePolling.js.map +1 -1
- package/lib-es/platform/filters.d.ts +1 -2
- package/lib-es/platform/filters.d.ts.map +1 -1
- package/lib-es/platform/filters.js +0 -15
- package/lib-es/platform/filters.js.map +1 -1
- package/lib-es/platform/helpers.d.ts +1 -5
- package/lib-es/platform/helpers.d.ts.map +1 -1
- package/lib-es/platform/helpers.js +1 -30
- package/lib-es/platform/helpers.js.map +1 -1
- package/lib-es/platform/react.d.ts +2 -3
- package/lib-es/platform/react.d.ts.map +1 -1
- package/lib-es/platform/react.js +67 -16
- package/lib-es/platform/react.js.map +1 -1
- package/lib-es/platform/types.d.ts +3 -3
- package/lib-es/platform/types.d.ts.map +1 -1
- package/lib-es/utils/getAccountTuplesForCurrency.d.ts +1 -1
- package/lib-es/utils/getAccountTuplesForCurrency.d.ts.map +1 -1
- package/lib-es/utils/getAccountTuplesForCurrency.js +2 -3
- package/lib-es/utils/getAccountTuplesForCurrency.js.map +1 -1
- package/lib-es/wallet-api/Exchange/server.d.ts.map +1 -1
- package/lib-es/wallet-api/Exchange/server.js +5 -4
- package/lib-es/wallet-api/Exchange/server.js.map +1 -1
- package/lib-es/wallet-api/converters.d.ts +1 -0
- package/lib-es/wallet-api/converters.d.ts.map +1 -1
- package/lib-es/wallet-api/converters.js +5 -1
- package/lib-es/wallet-api/converters.js.map +1 -1
- package/lib-es/wallet-api/react.d.ts +6 -11
- package/lib-es/wallet-api/react.d.ts.map +1 -1
- package/lib-es/wallet-api/react.js +289 -131
- package/lib-es/wallet-api/react.js.map +1 -1
- package/lib-es/wallet-api/tracking.d.ts +6 -0
- package/lib-es/wallet-api/tracking.d.ts.map +1 -1
- package/lib-es/wallet-api/tracking.js +20 -0
- package/lib-es/wallet-api/tracking.js.map +1 -1
- package/lib-es/wallet-api/types.d.ts +3 -0
- package/lib-es/wallet-api/types.d.ts.map +1 -1
- package/lib-es/wallet-api/useDappLogic.d.ts.map +1 -1
- package/lib-es/wallet-api/useDappLogic.js +62 -77
- package/lib-es/wallet-api/useDappLogic.js.map +1 -1
- package/lib-es/wallet-api/utils/deriveAccountIdForManifest.d.ts +6 -0
- package/lib-es/wallet-api/utils/deriveAccountIdForManifest.d.ts.map +1 -1
- package/lib-es/wallet-api/utils/deriveAccountIdForManifest.js +11 -2
- package/lib-es/wallet-api/utils/deriveAccountIdForManifest.js.map +1 -1
- package/package.json +56 -56
- package/src/__tests__/test-helpers/bridge.ts +0 -2
- package/src/bridge/generic-alpaca/getAccountShape.ts +15 -12
- package/src/bridge/generic-alpaca/tests/getAccountShape.test.ts +142 -101
- package/src/currencies/helpers.ts +1 -42
- package/src/dada-client/hooks/useAssetsData.ts +1 -0
- package/src/deposit/type.ts +0 -21
- package/src/deviceSDK/actions/getBatteryStatuses.ts +3 -1
- package/src/deviceSDK/actions/getDeviceInfo.ts +3 -2
- package/src/deviceSDK/actions/getLatestAvailableFirmware.test.ts +31 -0
- package/src/deviceSDK/actions/getLatestAvailableFirmware.ts +7 -2
- package/src/deviceSDK/actions/toggleOnboardingEarlyCheck.ts +3 -1
- package/src/deviceSDK/actions/updateFirmware.ts +5 -2
- package/src/deviceSDK/hooks/useBatteryStatuses.test.ts +3 -1
- package/src/deviceSDK/hooks/useBatteryStatuses.ts +4 -1
- package/src/deviceSDK/hooks/useGetDeviceInfo.ts +4 -2
- package/src/deviceSDK/hooks/useGetLatestAvailableFirmware.ts +3 -0
- package/src/deviceSDK/hooks/useToggleOnboardingEarlyChecks.test.ts +2 -0
- package/src/deviceSDK/hooks/useToggleOnboardingEarlyChecks.ts +4 -1
- package/src/deviceSDK/hooks/useUpdateFirmware.ts +4 -1
- package/src/deviceSDK/tasks/core.test.ts +20 -0
- package/src/deviceSDK/tasks/core.ts +2 -1
- package/src/deviceSDK/tasks/getBatteryStatuses.ts +6 -1
- package/src/deviceSDK/tasks/getDeviceInfo.ts +6 -2
- package/src/deviceSDK/tasks/getLatestFirmware.ts +6 -1
- package/src/deviceSDK/tasks/toggleOnboardingEarlyCheck.test.ts +3 -0
- package/src/deviceSDK/tasks/toggleOnboardingEarlyCheck.ts +6 -1
- package/src/deviceSDK/tasks/updateFirmware.ts +6 -1
- package/src/deviceSDK/transports/core.ts +6 -3
- package/src/e2e/enum/Account.ts +0 -6
- package/src/e2e/enum/Currency.ts +1 -5
- package/src/e2e/enum/ReceiveFundsOptions.ts +7 -0
- package/src/exchange/providers/swap.ts +4 -0
- package/src/exchange/swap/hooks/v5/useFetchCurrencyAll.ts +2 -3
- package/src/exchange/swap/hooks/v5/useFilteredProviders.ts +37 -12
- package/src/families/stellar/__snapshots__/bridge.integration.test.ts.snap +84 -12
- package/src/hw/actions/app.ts +2 -1
- package/src/hw/actions/customLockScreenLoad.ts +6 -2
- package/src/hw/actions/implementations.ts +17 -3
- package/src/hw/connectApp.ts +12 -5
- package/src/hw/connectManager.ts +13 -6
- package/src/hw/customLockScreenFetch.ts +10 -2
- package/src/hw/customLockScreenLoad.test.ts +28 -3
- package/src/hw/customLockScreenLoad.ts +10 -2
- package/src/hw/deviceAccess.ts +4 -3
- package/src/hw/getGenuineCheckFromDeviceId.test.ts +4 -0
- package/src/hw/getGenuineCheckFromDeviceId.ts +6 -1
- package/src/hw/getOnboardingStatePolling.test.ts +34 -0
- package/src/hw/getOnboardingStatePolling.ts +6 -3
- package/src/hw/hooks/useGenuineCheck.test.ts +37 -0
- package/src/hw/hooks/useGenuineCheck.ts +4 -0
- package/src/hw/index.test.ts +27 -6
- package/src/hw/index.ts +15 -8
- package/src/hw/installLanguage.ts +6 -1
- package/src/market/hooks/useMarketDataProvider.ts +1 -0
- package/src/market/utils/types.ts +1 -0
- package/src/modularDrawer/hooks/__test__/useAssetAccountCounts.test.ts +0 -5
- package/src/modularDrawer/hooks/useCurrenciesUnderFeatureFlag.ts +2 -0
- package/src/modularDrawer/hooks/useNetworkAccountCounts.tsx +1 -6
- package/src/modularDrawer/modules/__test__/createAssetConfiguration.test.tsx +2 -2
- package/src/modularDrawer/modules/createNetworkConfiguration.ts +1 -2
- package/src/modularDrawer/utils/__tests__/{groupCurrenciesByProvider.test.ts → groupCurrenciesByAsset.test.ts} +6 -6
- package/src/modularDrawer/utils/{groupCurrenciesByProvider.ts → groupCurrenciesByAsset.ts} +4 -4
- package/src/modularDrawer/utils/index.ts +1 -1
- package/src/modularDrawer/utils/type.ts +0 -5
- package/src/onboarding/hooks/useOnboardingStatePolling.ts +1 -0
- package/src/platform/filters.ts +1 -23
- package/src/platform/helpers.ts +2 -49
- package/src/platform/react.ts +86 -22
- package/src/platform/types.ts +1 -1
- package/src/utils/__tests__/getAccountTuplesForCurrency.test.ts +0 -30
- package/src/utils/getAccountTuplesForCurrency.ts +1 -6
- package/src/wallet-api/Exchange/server.test.ts +0 -5
- package/src/wallet-api/Exchange/server.ts +7 -6
- package/src/wallet-api/converters.ts +6 -1
- package/src/wallet-api/react.ts +310 -137
- package/src/wallet-api/tracking.ts +22 -0
- package/src/wallet-api/types.ts +5 -0
- package/src/wallet-api/useDappLogic.ts +91 -106
- package/src/wallet-api/utils/deriveAccountIdForManifest.ts +14 -2
- package/lib/deposit/helper.d.ts +0 -8
- package/lib/deposit/helper.d.ts.map +0 -1
- package/lib/deposit/helper.js +0 -125
- package/lib/deposit/helper.js.map +0 -1
- package/lib/deposit/index.d.ts +0 -3
- package/lib/deposit/index.d.ts.map +0 -1
- package/lib/deposit/index.js +0 -6
- package/lib/deposit/index.js.map +0 -1
- package/lib/deposit/mock.d.ts +0 -75
- package/lib/deposit/mock.d.ts.map +0 -1
- package/lib/deposit/mock.js +0 -15111
- package/lib/deposit/mock.js.map +0 -1
- package/lib/deposit/useGroupedCurrenciesByProvider.hook.d.ts +0 -3
- package/lib/deposit/useGroupedCurrenciesByProvider.hook.d.ts.map +0 -1
- package/lib/deposit/useGroupedCurrenciesByProvider.hook.js +0 -40
- package/lib/deposit/useGroupedCurrenciesByProvider.hook.js.map +0 -1
- package/lib/modularDrawer/__mocks__/useGroupedCurrenciesByProvider.mock.d.ts +0 -22
- package/lib/modularDrawer/__mocks__/useGroupedCurrenciesByProvider.mock.d.ts.map +0 -1
- package/lib/modularDrawer/__mocks__/useGroupedCurrenciesByProvider.mock.js +0 -41
- package/lib/modularDrawer/__mocks__/useGroupedCurrenciesByProvider.mock.js.map +0 -1
- package/lib/modularDrawer/utils/currencyUtils.d.ts +0 -10
- package/lib/modularDrawer/utils/currencyUtils.d.ts.map +0 -1
- package/lib/modularDrawer/utils/currencyUtils.js +0 -74
- package/lib/modularDrawer/utils/currencyUtils.js.map +0 -1
- package/lib/modularDrawer/utils/groupCurrenciesByProvider.d.ts.map +0 -1
- package/lib/modularDrawer/utils/groupCurrenciesByProvider.js.map +0 -1
- package/lib-es/deposit/helper.d.ts +0 -8
- package/lib-es/deposit/helper.d.ts.map +0 -1
- package/lib-es/deposit/helper.js +0 -117
- package/lib-es/deposit/helper.js.map +0 -1
- package/lib-es/deposit/index.d.ts +0 -3
- package/lib-es/deposit/index.d.ts.map +0 -1
- package/lib-es/deposit/index.js +0 -3
- package/lib-es/deposit/index.js.map +0 -1
- package/lib-es/deposit/mock.d.ts +0 -75
- package/lib-es/deposit/mock.d.ts.map +0 -1
- package/lib-es/deposit/mock.js +0 -15108
- package/lib-es/deposit/mock.js.map +0 -1
- package/lib-es/deposit/useGroupedCurrenciesByProvider.hook.d.ts +0 -3
- package/lib-es/deposit/useGroupedCurrenciesByProvider.hook.d.ts.map +0 -1
- package/lib-es/deposit/useGroupedCurrenciesByProvider.hook.js +0 -36
- package/lib-es/deposit/useGroupedCurrenciesByProvider.hook.js.map +0 -1
- package/lib-es/modularDrawer/__mocks__/useGroupedCurrenciesByProvider.mock.d.ts +0 -22
- package/lib-es/modularDrawer/__mocks__/useGroupedCurrenciesByProvider.mock.d.ts.map +0 -1
- package/lib-es/modularDrawer/__mocks__/useGroupedCurrenciesByProvider.mock.js +0 -38
- package/lib-es/modularDrawer/__mocks__/useGroupedCurrenciesByProvider.mock.js.map +0 -1
- package/lib-es/modularDrawer/utils/currencyUtils.d.ts +0 -10
- package/lib-es/modularDrawer/utils/currencyUtils.d.ts.map +0 -1
- package/lib-es/modularDrawer/utils/currencyUtils.js +0 -65
- package/lib-es/modularDrawer/utils/currencyUtils.js.map +0 -1
- package/lib-es/modularDrawer/utils/groupCurrenciesByProvider.d.ts.map +0 -1
- package/lib-es/modularDrawer/utils/groupCurrenciesByProvider.js.map +0 -1
- package/src/currencies/helpers.test.ts +0 -20
- package/src/deposit/deposit.integration.test.ts +0 -88
- package/src/deposit/deposit.test.ts +0 -684
- package/src/deposit/helper.ts +0 -143
- package/src/deposit/index.ts +0 -3
- package/src/deposit/mock.ts +0 -15112
- package/src/deposit/useGroupedCurrenciesByProvider.hook.ts +0 -46
- package/src/modularDrawer/__mocks__/useGroupedCurrenciesByProvider.mock.ts +0 -49
- package/src/modularDrawer/modules/__test__/createNetworkConfiguration.test.ts +0 -342
- package/src/modularDrawer/utils/__tests__/currencyUtils.test.ts +0 -126
- package/src/modularDrawer/utils/currencyUtils.ts +0 -95
|
@@ -1,27 +1,52 @@
|
|
|
1
1
|
import { getEnv } from "@ledgerhq/live-env";
|
|
2
|
-
import { useCallback, useEffect, useState } from "react";
|
|
3
|
-
import { fetchAndMergeProviderData } from "../../../providers/swap";
|
|
2
|
+
import { useCallback, useEffect, useState, useMemo } from "react";
|
|
3
|
+
import { fetchAndMergeProviderData, getDefaultSwapProviderKeys } from "../../../providers/swap";
|
|
4
4
|
import { useFeature } from "../../../../featureFlags";
|
|
5
5
|
|
|
6
|
+
const filterProvidersByFeatureFlags = (
|
|
7
|
+
providers: string[],
|
|
8
|
+
ptxSwapMoonpayProviderFlag?: { enabled?: boolean },
|
|
9
|
+
ptxSwapExodusProviderFlag?: { enabled?: boolean },
|
|
10
|
+
): string[] => {
|
|
11
|
+
let filtered = providers;
|
|
12
|
+
if (!ptxSwapMoonpayProviderFlag?.enabled) {
|
|
13
|
+
filtered = filtered.filter(provider => provider !== "moonpay");
|
|
14
|
+
}
|
|
15
|
+
if (!ptxSwapExodusProviderFlag?.enabled) {
|
|
16
|
+
filtered = filtered.filter(provider => provider !== "exodus");
|
|
17
|
+
}
|
|
18
|
+
return filtered;
|
|
19
|
+
};
|
|
20
|
+
|
|
6
21
|
export const useFilteredProviders = () => {
|
|
7
|
-
const [providers, setProviders] = useState<string[]>([]);
|
|
8
|
-
const [loading, setLoading] = useState(true);
|
|
9
|
-
const [error, setError] = useState<unknown>(null);
|
|
10
22
|
const ptxSwapMoonpayProviderFlag = useFeature("ptxSwapMoonpayProvider");
|
|
11
23
|
const ptxSwapExodusProviderFlag = useFeature("ptxSwapExodusProvider");
|
|
24
|
+
|
|
25
|
+
const defaultProviders = useMemo(
|
|
26
|
+
() =>
|
|
27
|
+
filterProvidersByFeatureFlags(
|
|
28
|
+
getDefaultSwapProviderKeys(),
|
|
29
|
+
ptxSwapMoonpayProviderFlag ?? undefined,
|
|
30
|
+
ptxSwapExodusProviderFlag ?? undefined,
|
|
31
|
+
),
|
|
32
|
+
[ptxSwapMoonpayProviderFlag, ptxSwapExodusProviderFlag],
|
|
33
|
+
);
|
|
34
|
+
|
|
35
|
+
const [providers, setProviders] = useState<string[]>(defaultProviders);
|
|
36
|
+
const [loading, setLoading] = useState(true);
|
|
37
|
+
const [error, setError] = useState<unknown>(null);
|
|
38
|
+
|
|
12
39
|
const fetchProviders = useCallback(async () => {
|
|
13
40
|
try {
|
|
14
41
|
const ledgerSignatureEnv = getEnv("MOCK_EXCHANGE_TEST_CONFIG") ? "test" : "prod";
|
|
15
42
|
const partnerSignatureEnv = getEnv("MOCK_EXCHANGE_TEST_PARTNER") ? "test" : "prod";
|
|
16
43
|
|
|
17
44
|
const data = await fetchAndMergeProviderData({ ledgerSignatureEnv, partnerSignatureEnv });
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
filteredProviders = filteredProviders.filter(provider => provider !== "exodus");
|
|
24
|
-
}
|
|
45
|
+
const filteredProviders = filterProvidersByFeatureFlags(
|
|
46
|
+
Object.keys(data),
|
|
47
|
+
ptxSwapMoonpayProviderFlag ?? undefined,
|
|
48
|
+
ptxSwapExodusProviderFlag ?? undefined,
|
|
49
|
+
);
|
|
25
50
|
|
|
26
51
|
setProviders(filteredProviders);
|
|
27
52
|
} catch (error) {
|
|
@@ -3,20 +3,20 @@
|
|
|
3
3
|
exports[`stellar currency bridge scanAccounts stellar seed 1 1`] = `
|
|
4
4
|
[
|
|
5
5
|
{
|
|
6
|
-
"balance": "
|
|
6
|
+
"balance": "341065024",
|
|
7
7
|
"currencyId": "stellar",
|
|
8
8
|
"derivationMode": "sep5",
|
|
9
9
|
"freshAddress": "GAT4LBXYJGJJJRSNK74NPFLO55CDDXSYVMQODSEAAH3M6EY4S7LPH5GV",
|
|
10
10
|
"freshAddressPath": "44'/148'/0'",
|
|
11
11
|
"id": "js:2:stellar:GAT4LBXYJGJJJRSNK74NPFLO55CDDXSYVMQODSEAAH3M6EY4S7LPH5GV:sep5",
|
|
12
12
|
"index": 0,
|
|
13
|
-
"operationsCount":
|
|
13
|
+
"operationsCount": 145,
|
|
14
14
|
"pendingOperations": [],
|
|
15
15
|
"seedIdentifier": "27c586f8499294c64d57f8d7956eef4431de58ab20e1c88001f6cf131c97d6f3",
|
|
16
|
-
"spendableBalance": "
|
|
16
|
+
"spendableBalance": "311064924",
|
|
17
17
|
"subAccounts": [],
|
|
18
18
|
"swapHistory": [],
|
|
19
|
-
"syncHash":
|
|
19
|
+
"syncHash": "0x1431ef5f",
|
|
20
20
|
"used": true,
|
|
21
21
|
"xpub": "GAT4LBXYJGJJJRSNK74NPFLO55CDDXSYVMQODSEAAH3M6EY4S7LPH5GV",
|
|
22
22
|
},
|
|
@@ -34,7 +34,7 @@ exports[`stellar currency bridge scanAccounts stellar seed 1 1`] = `
|
|
|
34
34
|
"spendableBalance": "79999760",
|
|
35
35
|
"subAccounts": [],
|
|
36
36
|
"swapHistory": [],
|
|
37
|
-
"syncHash":
|
|
37
|
+
"syncHash": "0x1431ef5f",
|
|
38
38
|
"used": true,
|
|
39
39
|
"xpub": "GAIXIJBMYPTSF2CDVQ35WOTULCLZIE4W2SDEK3RQGAA3A22BPWY7R53Z",
|
|
40
40
|
},
|
|
@@ -52,7 +52,7 @@ exports[`stellar currency bridge scanAccounts stellar seed 1 1`] = `
|
|
|
52
52
|
"spendableBalance": "44999262",
|
|
53
53
|
"subAccounts": [],
|
|
54
54
|
"swapHistory": [],
|
|
55
|
-
"syncHash":
|
|
55
|
+
"syncHash": "0x1431ef5f",
|
|
56
56
|
"used": true,
|
|
57
57
|
"xpub": "GCDDN6T2LJN3T7SPWJQV6BCCL5KNY5GBN7X4CMSZLDEXDHXAH32TOAHS",
|
|
58
58
|
},
|
|
@@ -70,7 +70,7 @@ exports[`stellar currency bridge scanAccounts stellar seed 1 1`] = `
|
|
|
70
70
|
"spendableBalance": "10145721",
|
|
71
71
|
"subAccounts": [],
|
|
72
72
|
"swapHistory": [],
|
|
73
|
-
"syncHash":
|
|
73
|
+
"syncHash": "0x1431ef5f",
|
|
74
74
|
"used": true,
|
|
75
75
|
"xpub": "GAHQKL7UW5DSNJXWNA4ASJ6D2I7JYFWVHDFWYJZK3WDR4BUTG27K2PWC",
|
|
76
76
|
},
|
|
@@ -88,7 +88,7 @@ exports[`stellar currency bridge scanAccounts stellar seed 1 1`] = `
|
|
|
88
88
|
"spendableBalance": "0",
|
|
89
89
|
"subAccounts": [],
|
|
90
90
|
"swapHistory": [],
|
|
91
|
-
"syncHash":
|
|
91
|
+
"syncHash": "0x1431ef5f",
|
|
92
92
|
"used": true,
|
|
93
93
|
"xpub": "GBQMOU2WYJUP6AKY53FFKZJGQMDWCMTWSOUTZ5DVIAQPVW7AJUHSX2M5",
|
|
94
94
|
},
|
|
@@ -106,7 +106,7 @@ exports[`stellar currency bridge scanAccounts stellar seed 1 1`] = `
|
|
|
106
106
|
"spendableBalance": "0",
|
|
107
107
|
"subAccounts": [],
|
|
108
108
|
"swapHistory": [],
|
|
109
|
-
"syncHash":
|
|
109
|
+
"syncHash": "0x1431ef5f",
|
|
110
110
|
"used": false,
|
|
111
111
|
"xpub": "GAJEKFXY76YWDSKJESDOKS2EGKRMCHSIC5AU32SU7OF54E5VVREUHXLH",
|
|
112
112
|
},
|
|
@@ -690,7 +690,7 @@ exports[`stellar currency bridge scanAccounts stellar seed 1 2`] = `
|
|
|
690
690
|
],
|
|
691
691
|
"transactionSequenceNumber": "251606365385008908",
|
|
692
692
|
"type": "IN",
|
|
693
|
-
"value": "
|
|
693
|
+
"value": "10000",
|
|
694
694
|
},
|
|
695
695
|
{
|
|
696
696
|
"accountId": "js:2:stellar:GAT4LBXYJGJJJRSNK74NPFLO55CDDXSYVMQODSEAAH3M6EY4S7LPH5GV:sep5",
|
|
@@ -764,6 +764,30 @@ exports[`stellar currency bridge scanAccounts stellar seed 1 2`] = `
|
|
|
764
764
|
"type": "IN",
|
|
765
765
|
"value": "1",
|
|
766
766
|
},
|
|
767
|
+
{
|
|
768
|
+
"accountId": "js:2:stellar:GAT4LBXYJGJJJRSNK74NPFLO55CDDXSYVMQODSEAAH3M6EY4S7LPH5GV:sep5",
|
|
769
|
+
"blockHash": "0d4b1748aeb13c64f001d9b486054744d5e8521081ce6d21dc9acbb2a1c0a171",
|
|
770
|
+
"blockHeight": 59792876,
|
|
771
|
+
"extra": {
|
|
772
|
+
"memo": {
|
|
773
|
+
"type": "MEMO_TEXT",
|
|
774
|
+
"value": "Own VTX & Start Earning XLM!",
|
|
775
|
+
},
|
|
776
|
+
},
|
|
777
|
+
"fee": "10000",
|
|
778
|
+
"hasFailed": false,
|
|
779
|
+
"hash": "277aa9d93c6674951b4cc198a25ee1d5726d686f459d957a9bf4b40b0b66ffb6",
|
|
780
|
+
"id": "js:2:stellar:GAT4LBXYJGJJJRSNK74NPFLO55CDDXSYVMQODSEAAH3M6EY4S7LPH5GV:sep5-277aa9d93c6674951b4cc198a25ee1d5726d686f459d957a9bf4b40b0b66ffb6-IN",
|
|
781
|
+
"recipients": [
|
|
782
|
+
"GAT4LBXYJGJJJRSNK74NPFLO55CDDXSYVMQODSEAAH3M6EY4S7LPH5GV",
|
|
783
|
+
],
|
|
784
|
+
"senders": [
|
|
785
|
+
"GDM2UBYCTDJ7LBBNLWU5XTNNIR6GIQW7KXJTPBWOTMFECHF5YJAE3JTH",
|
|
786
|
+
],
|
|
787
|
+
"transactionSequenceNumber": "256741054621943059",
|
|
788
|
+
"type": "IN",
|
|
789
|
+
"value": "1",
|
|
790
|
+
},
|
|
767
791
|
{
|
|
768
792
|
"accountId": "js:2:stellar:GAT4LBXYJGJJJRSNK74NPFLO55CDDXSYVMQODSEAAH3M6EY4S7LPH5GV:sep5",
|
|
769
793
|
"blockHash": "d43eb458fb93eb861373fbe61743bdc51800bf41eaeff2fd2b6a2b001254044b",
|
|
@@ -1676,6 +1700,30 @@ exports[`stellar currency bridge scanAccounts stellar seed 1 2`] = `
|
|
|
1676
1700
|
"type": "IN",
|
|
1677
1701
|
"value": "1",
|
|
1678
1702
|
},
|
|
1703
|
+
{
|
|
1704
|
+
"accountId": "js:2:stellar:GAT4LBXYJGJJJRSNK74NPFLO55CDDXSYVMQODSEAAH3M6EY4S7LPH5GV:sep5",
|
|
1705
|
+
"blockHash": "70caf48d48b190098064b972f0142dfa3549adbc4893021d5d002df3c7a6c9b0",
|
|
1706
|
+
"blockHeight": 59745989,
|
|
1707
|
+
"extra": {
|
|
1708
|
+
"memo": {
|
|
1709
|
+
"type": "MEMO_TEXT",
|
|
1710
|
+
"value": "Buy XRVT Earn fchain.io XRP!",
|
|
1711
|
+
},
|
|
1712
|
+
},
|
|
1713
|
+
"fee": "10000",
|
|
1714
|
+
"hasFailed": false,
|
|
1715
|
+
"hash": "6db88bc812940527d1387217bd4574cdac5bf3857efe72e0c1aec661b5c4a90f",
|
|
1716
|
+
"id": "js:2:stellar:GAT4LBXYJGJJJRSNK74NPFLO55CDDXSYVMQODSEAAH3M6EY4S7LPH5GV:sep5-6db88bc812940527d1387217bd4574cdac5bf3857efe72e0c1aec661b5c4a90f-IN",
|
|
1717
|
+
"recipients": [
|
|
1718
|
+
"GAT4LBXYJGJJJRSNK74NPFLO55CDDXSYVMQODSEAAH3M6EY4S7LPH5GV",
|
|
1719
|
+
],
|
|
1720
|
+
"senders": [
|
|
1721
|
+
"GD7NZ4LUIJPEIWM3UY4IW5HMV3WV3PRVM5CPSILLBUIG5YFNNCCTZXJL",
|
|
1722
|
+
],
|
|
1723
|
+
"transactionSequenceNumber": "256247545699769514",
|
|
1724
|
+
"type": "IN",
|
|
1725
|
+
"value": "1",
|
|
1726
|
+
},
|
|
1679
1727
|
{
|
|
1680
1728
|
"accountId": "js:2:stellar:GAT4LBXYJGJJJRSNK74NPFLO55CDDXSYVMQODSEAAH3M6EY4S7LPH5GV:sep5",
|
|
1681
1729
|
"blockHash": "d36bfe52924033397bdb89574feb1d4bdf2f063420d204c54d3cf7b829bd571f",
|
|
@@ -3068,6 +3116,30 @@ exports[`stellar currency bridge scanAccounts stellar seed 1 2`] = `
|
|
|
3068
3116
|
"type": "IN",
|
|
3069
3117
|
"value": "1",
|
|
3070
3118
|
},
|
|
3119
|
+
{
|
|
3120
|
+
"accountId": "js:2:stellar:GAT4LBXYJGJJJRSNK74NPFLO55CDDXSYVMQODSEAAH3M6EY4S7LPH5GV:sep5",
|
|
3121
|
+
"blockHash": "e70f311ceddcb90dd9853589896e4dedfe9d57dcdc130cf62a1c5e8564b24b7b",
|
|
3122
|
+
"blockHeight": 59761051,
|
|
3123
|
+
"extra": {
|
|
3124
|
+
"memo": {
|
|
3125
|
+
"type": "MEMO_TEXT",
|
|
3126
|
+
"value": "Buy XRVT Earn fchain.io XRP!",
|
|
3127
|
+
},
|
|
3128
|
+
},
|
|
3129
|
+
"fee": "10000",
|
|
3130
|
+
"hasFailed": false,
|
|
3131
|
+
"hash": "c911e6f578b4d869a71ea7e8cd139c5a885d996d2f15e63c63b31db10e42f415",
|
|
3132
|
+
"id": "js:2:stellar:GAT4LBXYJGJJJRSNK74NPFLO55CDDXSYVMQODSEAAH3M6EY4S7LPH5GV:sep5-c911e6f578b4d869a71ea7e8cd139c5a885d996d2f15e63c63b31db10e42f415-IN",
|
|
3133
|
+
"recipients": [
|
|
3134
|
+
"GAT4LBXYJGJJJRSNK74NPFLO55CDDXSYVMQODSEAAH3M6EY4S7LPH5GV",
|
|
3135
|
+
],
|
|
3136
|
+
"senders": [
|
|
3137
|
+
"GD7NZ4LUIJPEIWM3UY4IW5HMV3WV3PRVM5CPSILLBUIG5YFNNCCTZXJL",
|
|
3138
|
+
],
|
|
3139
|
+
"transactionSequenceNumber": "256247545699771532",
|
|
3140
|
+
"type": "IN",
|
|
3141
|
+
"value": "1",
|
|
3142
|
+
},
|
|
3071
3143
|
{
|
|
3072
3144
|
"accountId": "js:2:stellar:GAT4LBXYJGJJJRSNK74NPFLO55CDDXSYVMQODSEAAH3M6EY4S7LPH5GV:sep5",
|
|
3073
3145
|
"blockHash": "6eb78e902ecc290b25216c0afae3a354b9b3bf723510c8aa3162f801635b0f35",
|
|
@@ -5283,7 +5355,7 @@ exports[`stellar currency bridge scanAccounts stellar seed 1 2`] = `
|
|
|
5283
5355
|
],
|
|
5284
5356
|
"transactionSequenceNumber": "119784086674866178",
|
|
5285
5357
|
"type": "OUT",
|
|
5286
|
-
"value": "
|
|
5358
|
+
"value": "100",
|
|
5287
5359
|
},
|
|
5288
5360
|
{
|
|
5289
5361
|
"accountId": "js:2:stellar:GCDDN6T2LJN3T7SPWJQV6BCCL5KNY5GBN7X4CMSZLDEXDHXAH32TOAHS:sep5",
|
|
@@ -5798,7 +5870,7 @@ exports[`stellar currency bridge scanAccounts stellar seed 1 2`] = `
|
|
|
5798
5870
|
],
|
|
5799
5871
|
"transactionSequenceNumber": "119784086674866178",
|
|
5800
5872
|
"type": "IN",
|
|
5801
|
-
"value": "
|
|
5873
|
+
"value": "100",
|
|
5802
5874
|
},
|
|
5803
5875
|
{
|
|
5804
5876
|
"accountId": "js:2:stellar:GAHQKL7UW5DSNJXWNA4ASJ6D2I7JYFWVHDFWYJZK3WDR4BUTG27K2PWC:sep5",
|
package/src/hw/actions/app.ts
CHANGED
|
@@ -468,12 +468,13 @@ export const createAction = (
|
|
|
468
468
|
);
|
|
469
469
|
|
|
470
470
|
const task: (arg0: ConnectAppInput) => Observable<ConnectAppEvent> = useCallback(
|
|
471
|
-
({ deviceId, request }: ConnectAppInput) => {
|
|
471
|
+
({ deviceId, deviceName, request }: ConnectAppInput) => {
|
|
472
472
|
//To avoid redundant checks, we remove passed checks from the request.
|
|
473
473
|
const { dependencies, requireLatestFirmware } = request;
|
|
474
474
|
|
|
475
475
|
return connectAppExec({
|
|
476
476
|
deviceId,
|
|
477
|
+
deviceName,
|
|
477
478
|
request: {
|
|
478
479
|
...request,
|
|
479
480
|
dependencies: dependenciesResolvedRef.current ? undefined : dependencies,
|
|
@@ -37,7 +37,7 @@ type ActionState = State & {
|
|
|
37
37
|
onRetry: () => void;
|
|
38
38
|
};
|
|
39
39
|
|
|
40
|
-
type LoadImageAction = Action<LoadImageRequest, ActionState, LoadimageResult>;
|
|
40
|
+
type LoadImageAction = Action<LoadImageRequest | undefined, ActionState, LoadimageResult>;
|
|
41
41
|
|
|
42
42
|
const mapResult = ({ imageHash, imageSize }: State) => ({
|
|
43
43
|
imageHash,
|
|
@@ -131,12 +131,16 @@ export const reducer = (state: State, e: Event): State => {
|
|
|
131
131
|
export const createAction = (
|
|
132
132
|
task: (arg0: LoadImageInput) => Observable<LoadImageEvent>,
|
|
133
133
|
): LoadImageAction => {
|
|
134
|
-
const useHook = (
|
|
134
|
+
const useHook = (
|
|
135
|
+
device: Device | null | undefined,
|
|
136
|
+
request: LoadImageRequest | undefined,
|
|
137
|
+
): ActionState => {
|
|
135
138
|
const [state, setState] = useState(() => getInitialState(device));
|
|
136
139
|
const [resetIndex, setResetIndex] = useState(0);
|
|
137
140
|
const deviceSubject = useReplaySubject(device);
|
|
138
141
|
|
|
139
142
|
useEffect(() => {
|
|
143
|
+
if (!request) return;
|
|
140
144
|
if (state.imageLoaded) return;
|
|
141
145
|
|
|
142
146
|
const impl = getImplementation(currentMode)<LoadImageEvent, LoadImageRequest>({
|
|
@@ -50,7 +50,11 @@ type PollingImplementationConfig = {
|
|
|
50
50
|
|
|
51
51
|
type PollingImplementationParams<Request, EmittedEvents> = {
|
|
52
52
|
deviceSubject: ReplaySubject<Device | null | undefined>;
|
|
53
|
-
task: (params: {
|
|
53
|
+
task: (params: {
|
|
54
|
+
deviceId: string;
|
|
55
|
+
deviceName: string | null;
|
|
56
|
+
request: Request;
|
|
57
|
+
}) => Observable<EmittedEvents>;
|
|
54
58
|
request: Request;
|
|
55
59
|
config?: PollingImplementationConfig;
|
|
56
60
|
// retryableWithDelayDisconnectedErrors has default value of [DisconnectedDevice, DisconnectedDeviceDuringOperation]
|
|
@@ -137,7 +141,11 @@ const pollingImplementation: Implementation = <SpecificType, GenericRequestType>
|
|
|
137
141
|
device: currentDevice,
|
|
138
142
|
replaceable: !firstRound,
|
|
139
143
|
}),
|
|
140
|
-
task({
|
|
144
|
+
task({
|
|
145
|
+
deviceId: currentDevice.deviceId,
|
|
146
|
+
deviceName: currentDevice.deviceName ?? null,
|
|
147
|
+
request,
|
|
148
|
+
}),
|
|
141
149
|
)
|
|
142
150
|
.pipe(
|
|
143
151
|
// Any event should clear the initialTimeout.
|
|
@@ -241,7 +249,13 @@ const eventImplementation: Implementation = <SpecificType, GenericRequestType>(
|
|
|
241
249
|
|
|
242
250
|
return concat(
|
|
243
251
|
initialEvent,
|
|
244
|
-
|
|
252
|
+
device
|
|
253
|
+
? task({
|
|
254
|
+
deviceId: device.deviceId,
|
|
255
|
+
deviceName: device.deviceName ?? null,
|
|
256
|
+
request,
|
|
257
|
+
})
|
|
258
|
+
: EMPTY,
|
|
245
259
|
);
|
|
246
260
|
}),
|
|
247
261
|
catchError((error: Error) =>
|
package/src/hw/connectApp.ts
CHANGED
|
@@ -48,6 +48,7 @@ export type RequiresDerivation = {
|
|
|
48
48
|
};
|
|
49
49
|
export type Input = {
|
|
50
50
|
deviceId: string;
|
|
51
|
+
deviceName: string | null;
|
|
51
52
|
request: ConnectAppRequest;
|
|
52
53
|
};
|
|
53
54
|
export type ConnectAppRequest = {
|
|
@@ -524,10 +525,13 @@ export default function connectAppFactory(
|
|
|
524
525
|
} = { isLdmkConnectAppEnabled: false },
|
|
525
526
|
) {
|
|
526
527
|
if (!isLdmkConnectAppEnabled) {
|
|
527
|
-
return ({ deviceId, request }: Input): Observable<ConnectAppEvent> =>
|
|
528
|
-
withDevice(
|
|
528
|
+
return ({ deviceId, deviceName, request }: Input): Observable<ConnectAppEvent> =>
|
|
529
|
+
withDevice(
|
|
530
|
+
deviceId,
|
|
531
|
+
deviceName ? { matchDeviceByName: deviceName } : undefined,
|
|
532
|
+
)(transport => cmd(transport, { deviceId, deviceName, request }));
|
|
529
533
|
}
|
|
530
|
-
return ({ deviceId, request }: Input): Observable<ConnectAppEvent> => {
|
|
534
|
+
return ({ deviceId, deviceName, request }: Input): Observable<ConnectAppEvent> => {
|
|
531
535
|
const {
|
|
532
536
|
appName,
|
|
533
537
|
requiresDerivation,
|
|
@@ -535,9 +539,12 @@ export default function connectAppFactory(
|
|
|
535
539
|
requireLatestFirmware,
|
|
536
540
|
allowPartialDependencies = false,
|
|
537
541
|
} = request;
|
|
538
|
-
return withDevice(
|
|
542
|
+
return withDevice(
|
|
543
|
+
deviceId,
|
|
544
|
+
deviceName ? { matchDeviceByName: deviceName } : undefined,
|
|
545
|
+
)(transport => {
|
|
539
546
|
if (!isDmkTransport(transport)) {
|
|
540
|
-
return cmd(transport, { deviceId, request });
|
|
547
|
+
return cmd(transport, { deviceId, deviceName, request });
|
|
541
548
|
}
|
|
542
549
|
const { dmk, sessionId } = transport;
|
|
543
550
|
const deviceAction = new ConnectAppDeviceAction({
|
package/src/hw/connectManager.ts
CHANGED
|
@@ -27,6 +27,7 @@ import { extractOnboardingState, OnboardingStep } from "./extractOnboardingState
|
|
|
27
27
|
|
|
28
28
|
export type Input = {
|
|
29
29
|
deviceId: string;
|
|
30
|
+
deviceName: string | null;
|
|
30
31
|
request: ManagerRequest | null | undefined;
|
|
31
32
|
};
|
|
32
33
|
|
|
@@ -159,13 +160,19 @@ export default function connectManagerFactory(
|
|
|
159
160
|
} = { isLdmkConnectAppEnabled: false },
|
|
160
161
|
) {
|
|
161
162
|
if (!isLdmkConnectAppEnabled) {
|
|
162
|
-
return ({ deviceId, request }: Input): Observable<ConnectManagerEvent> =>
|
|
163
|
-
withDevice(
|
|
163
|
+
return ({ deviceId, deviceName, request }: Input): Observable<ConnectManagerEvent> =>
|
|
164
|
+
withDevice(
|
|
165
|
+
deviceId,
|
|
166
|
+
deviceName ? { matchDeviceByName: deviceName } : undefined,
|
|
167
|
+
)(transport => cmd(transport, { deviceId, deviceName, request }));
|
|
164
168
|
}
|
|
165
|
-
return ({ deviceId, request }: Input): Observable<ConnectManagerEvent> =>
|
|
166
|
-
withDevice(
|
|
169
|
+
return ({ deviceId, deviceName, request }: Input): Observable<ConnectManagerEvent> =>
|
|
170
|
+
withDevice(
|
|
171
|
+
deviceId,
|
|
172
|
+
deviceName ? { matchDeviceByName: deviceName } : undefined,
|
|
173
|
+
)(transport => {
|
|
167
174
|
if (!isDmkTransport(transport)) {
|
|
168
|
-
return cmd(transport, { deviceId, request });
|
|
175
|
+
return cmd(transport, { deviceId, deviceName, request });
|
|
169
176
|
}
|
|
170
177
|
const { dmk, sessionId } = transport;
|
|
171
178
|
const deviceAction = new PrepareConnectManagerDeviceAction({
|
|
@@ -179,6 +186,6 @@ export default function connectManagerFactory(
|
|
|
179
186
|
});
|
|
180
187
|
return new PrepareConnectManagerEventMapper(observable)
|
|
181
188
|
.map()
|
|
182
|
-
.pipe(concatWith(cmd(transport, { deviceId, request })));
|
|
189
|
+
.pipe(concatWith(cmd(transport, { deviceId, deviceName, request })));
|
|
183
190
|
});
|
|
184
191
|
}
|
|
@@ -47,13 +47,21 @@ export type FetchImageRequest = {
|
|
|
47
47
|
|
|
48
48
|
export type Input = {
|
|
49
49
|
deviceId: string;
|
|
50
|
+
deviceName: string | null;
|
|
50
51
|
request: FetchImageRequest;
|
|
51
52
|
};
|
|
52
53
|
|
|
53
|
-
export default function fetchImage({
|
|
54
|
+
export default function fetchImage({
|
|
55
|
+
deviceId,
|
|
56
|
+
deviceName,
|
|
57
|
+
request,
|
|
58
|
+
}: Input): Observable<FetchImageEvent> {
|
|
54
59
|
const { backupHash, allowedEmpty = false, deviceModelId } = request;
|
|
55
60
|
|
|
56
|
-
const sub = withDevice(
|
|
61
|
+
const sub = withDevice(
|
|
62
|
+
deviceId,
|
|
63
|
+
deviceName ? { matchDeviceByName: deviceName } : undefined,
|
|
64
|
+
)(
|
|
57
65
|
transport =>
|
|
58
66
|
new Observable(subscriber => {
|
|
59
67
|
const timeoutSub = of<FetchImageEvent>({
|
|
@@ -9,8 +9,12 @@ const mockTransport = {
|
|
|
9
9
|
send: jest.fn(),
|
|
10
10
|
getTraceContext: jest.fn(),
|
|
11
11
|
};
|
|
12
|
+
const mockWithTransport = jest.fn(
|
|
13
|
+
(_deviceId: string, _options?: any) => callback =>
|
|
14
|
+
callback({ transportRef: { current: mockTransport } }),
|
|
15
|
+
);
|
|
12
16
|
jest.mock("../deviceSDK/transports/core", () => ({
|
|
13
|
-
withTransport: (
|
|
17
|
+
withTransport: (deviceId: string, options?: any) => mockWithTransport(deviceId, options),
|
|
14
18
|
}));
|
|
15
19
|
jest.mock("./getDeviceInfo", () => jest.fn(() => of([])));
|
|
16
20
|
|
|
@@ -24,7 +28,9 @@ describe("customLockScreenLoad", () => {
|
|
|
24
28
|
mockTransport.send.mockResolvedValue(Buffer.from([0x42, 0x42, 0x43, 0x90, 0x00]));
|
|
25
29
|
|
|
26
30
|
// when
|
|
27
|
-
const ret = await lastValueFrom(
|
|
31
|
+
const ret = await lastValueFrom(
|
|
32
|
+
await customLockScreenLoad({ deviceId: "deviceId", deviceName: null, request }),
|
|
33
|
+
);
|
|
28
34
|
|
|
29
35
|
// then
|
|
30
36
|
expect(mockTransport.send).toHaveBeenNthCalledWith(
|
|
@@ -78,9 +84,28 @@ describe("customLockScreenLoad", () => {
|
|
|
78
84
|
|
|
79
85
|
// when
|
|
80
86
|
try {
|
|
81
|
-
await lastValueFrom(
|
|
87
|
+
await lastValueFrom(
|
|
88
|
+
await customLockScreenLoad({ deviceId: "nanoX", deviceName: null, request }),
|
|
89
|
+
);
|
|
82
90
|
} catch (err) {
|
|
83
91
|
expect(err).toStrictEqual(error);
|
|
84
92
|
}
|
|
85
93
|
});
|
|
94
|
+
|
|
95
|
+
it("should pass deviceName to withTransport", async () => {
|
|
96
|
+
const request = {
|
|
97
|
+
deviceModelId: DeviceModelId.stax as CLSSupportedDeviceModelId,
|
|
98
|
+
hexImage: "hello_world",
|
|
99
|
+
};
|
|
100
|
+
mockTransport.send.mockResolvedValue(Buffer.from([0x42, 0x42, 0x43, 0x90, 0x00]));
|
|
101
|
+
|
|
102
|
+
await lastValueFrom(
|
|
103
|
+
await customLockScreenLoad({ deviceId: "deviceId", deviceName: "My Device", request }),
|
|
104
|
+
);
|
|
105
|
+
|
|
106
|
+
expect(mockWithTransport).toHaveBeenCalledWith(
|
|
107
|
+
"deviceId",
|
|
108
|
+
expect.objectContaining({ matchDeviceByName: "My Device" }),
|
|
109
|
+
);
|
|
110
|
+
});
|
|
86
111
|
});
|
|
@@ -68,14 +68,22 @@ export type LoadImageRequest = {
|
|
|
68
68
|
|
|
69
69
|
export type Input = {
|
|
70
70
|
deviceId: string;
|
|
71
|
+
deviceName: string | null;
|
|
71
72
|
request: LoadImageRequest;
|
|
72
73
|
};
|
|
73
74
|
|
|
74
|
-
export default function loadImage({
|
|
75
|
+
export default function loadImage({
|
|
76
|
+
deviceId,
|
|
77
|
+
deviceName,
|
|
78
|
+
request,
|
|
79
|
+
}: Input): Observable<LoadImageEvent> {
|
|
75
80
|
const { hexImage, padImage = true, deviceModelId } = request;
|
|
76
81
|
const screenSpecs = getScreenSpecs(deviceModelId);
|
|
77
82
|
|
|
78
|
-
const sub = withTransport(
|
|
83
|
+
const sub = withTransport(
|
|
84
|
+
deviceId,
|
|
85
|
+
deviceName ? { matchDeviceByName: deviceName } : undefined,
|
|
86
|
+
)(
|
|
79
87
|
({ transportRef }) =>
|
|
80
88
|
new Observable(subscriber => {
|
|
81
89
|
const timeoutSub = of<LoadImageEvent>({ type: "unresponsiveDevice" })
|
package/src/hw/deviceAccess.ts
CHANGED
|
@@ -17,7 +17,7 @@ import {
|
|
|
17
17
|
} from "@ledgerhq/errors";
|
|
18
18
|
import { LocalTracer, TraceContext, trace } from "@ledgerhq/logs";
|
|
19
19
|
import { getEnv } from "@ledgerhq/live-env";
|
|
20
|
-
import { open, close } from ".";
|
|
20
|
+
import { open, close, OpenOptions } from ".";
|
|
21
21
|
|
|
22
22
|
const LOG_TYPE = "hw";
|
|
23
23
|
|
|
@@ -172,9 +172,10 @@ export class DeviceQueuedJobsManager {
|
|
|
172
172
|
* @param deviceId
|
|
173
173
|
* @param options contains optional configuration
|
|
174
174
|
* - openTimeoutMs: optional timeout that limits in time the open attempt of the matching registered transport.
|
|
175
|
+
* - matchDeviceByName: optional name of the device to match.
|
|
175
176
|
*/
|
|
176
177
|
export const withDevice =
|
|
177
|
-
(deviceId: string, options?:
|
|
178
|
+
(deviceId: string, options?: OpenOptions) =>
|
|
178
179
|
<T>(job: (t: Transport) => Observable<T>): Observable<T> =>
|
|
179
180
|
new Observable(o => {
|
|
180
181
|
const queuedJobManager = DeviceQueuedJobsManager.getInstance();
|
|
@@ -221,7 +222,7 @@ export const withDevice =
|
|
|
221
222
|
previousJobId: previousQueuedJob.id,
|
|
222
223
|
currentJobId: jobId,
|
|
223
224
|
});
|
|
224
|
-
return open(deviceId, options
|
|
225
|
+
return open(deviceId, options, tracer.getContext());
|
|
225
226
|
}) // open the transport
|
|
226
227
|
.then(async transport => {
|
|
227
228
|
tracer.trace("Got a Transport instance from open");
|
|
@@ -85,6 +85,7 @@ describe("getGenuineCheckFromDeviceId", () => {
|
|
|
85
85
|
let step = 1;
|
|
86
86
|
getGenuineCheckFromDeviceId({
|
|
87
87
|
deviceId: "A_DEVICE_ID",
|
|
88
|
+
deviceName: null,
|
|
88
89
|
lockedDeviceTimeoutMs: 1000,
|
|
89
90
|
}).subscribe({
|
|
90
91
|
next: ({ socketEvent, lockedDevice }: GetGenuineCheckFromDeviceIdResult) => {
|
|
@@ -147,6 +148,7 @@ describe("getGenuineCheckFromDeviceId", () => {
|
|
|
147
148
|
let step = 1;
|
|
148
149
|
getGenuineCheckFromDeviceId({
|
|
149
150
|
deviceId: "A_DEVICE_ID",
|
|
151
|
+
deviceName: null,
|
|
150
152
|
lockedDeviceTimeoutMs: 1000,
|
|
151
153
|
}).subscribe({
|
|
152
154
|
next: ({ socketEvent, lockedDevice }: GetGenuineCheckFromDeviceIdResult) => {
|
|
@@ -227,6 +229,7 @@ describe("getGenuineCheckFromDeviceId", () => {
|
|
|
227
229
|
let step = 1;
|
|
228
230
|
const subscriber = getGenuineCheckFromDeviceId({
|
|
229
231
|
deviceId: "A_DEVICE_ID",
|
|
232
|
+
deviceName: null,
|
|
230
233
|
lockedDeviceTimeoutMs: 1000,
|
|
231
234
|
}).subscribe({
|
|
232
235
|
next: ({ socketEvent, lockedDevice }: GetGenuineCheckFromDeviceIdResult) => {
|
|
@@ -286,6 +289,7 @@ describe("getGenuineCheckFromDeviceId", () => {
|
|
|
286
289
|
let step = 1;
|
|
287
290
|
getGenuineCheckFromDeviceId({
|
|
288
291
|
deviceId: "A_DEVICE_ID",
|
|
292
|
+
deviceName: null,
|
|
289
293
|
lockedDeviceTimeoutMs: 1000,
|
|
290
294
|
}).subscribe({
|
|
291
295
|
next: ({ socketEvent, lockedDevice }: GetGenuineCheckFromDeviceIdResult) => {
|
|
@@ -8,6 +8,7 @@ import genuineCheck from "./genuineCheck";
|
|
|
8
8
|
|
|
9
9
|
export type GetGenuineCheckFromDeviceIdArgs = {
|
|
10
10
|
deviceId: string;
|
|
11
|
+
deviceName: string | null;
|
|
11
12
|
lockedDeviceTimeoutMs?: number;
|
|
12
13
|
};
|
|
13
14
|
|
|
@@ -29,6 +30,7 @@ export type GetGenuineCheckFromDeviceIdOutput = Observable<GetGenuineCheckFromDe
|
|
|
29
30
|
*/
|
|
30
31
|
export const getGenuineCheckFromDeviceId = ({
|
|
31
32
|
deviceId,
|
|
33
|
+
deviceName,
|
|
32
34
|
lockedDeviceTimeoutMs = 1000,
|
|
33
35
|
}: GetGenuineCheckFromDeviceIdArgs): GetGenuineCheckFromDeviceIdOutput => {
|
|
34
36
|
return new Observable(subscriber => {
|
|
@@ -42,7 +44,10 @@ export const getGenuineCheckFromDeviceId = ({
|
|
|
42
44
|
|
|
43
45
|
// Returns a Subscription that can be unsubscribed/cleaned
|
|
44
46
|
return (
|
|
45
|
-
withDevice(
|
|
47
|
+
withDevice(
|
|
48
|
+
deviceId,
|
|
49
|
+
deviceName ? { matchDeviceByName: deviceName } : undefined,
|
|
50
|
+
)(t =>
|
|
46
51
|
from(getDeviceInfo(t)).pipe(
|
|
47
52
|
mergeMap(deviceInfo => {
|
|
48
53
|
clearTimeout(lockedDeviceTimeout);
|