@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
|
@@ -4,7 +4,7 @@ import { scan } from "rxjs/operators";
|
|
|
4
4
|
import { FullActionState, initialSharedActionState, sharedReducer } from "./core";
|
|
5
5
|
import { getDeviceInfoTask, GetDeviceInfoTaskError } from "../tasks/getDeviceInfo";
|
|
6
6
|
|
|
7
|
-
export type GetDeviceInfoActionArgs = { deviceId: DeviceId };
|
|
7
|
+
export type GetDeviceInfoActionArgs = { deviceId: DeviceId; deviceName: string | null };
|
|
8
8
|
|
|
9
9
|
// Union of all the tasks specific errors
|
|
10
10
|
export type GetDeviceInfoActionErrorType = GetDeviceInfoTaskError;
|
|
@@ -21,10 +21,11 @@ export const initialState: GetDeviceInfoActionState = {
|
|
|
21
21
|
|
|
22
22
|
export function getDeviceInfoAction({
|
|
23
23
|
deviceId,
|
|
24
|
+
deviceName,
|
|
24
25
|
}: GetDeviceInfoActionArgs): Observable<GetDeviceInfoActionState> {
|
|
25
26
|
// TODO: to decide: should we push an event if the state is not changing?
|
|
26
27
|
// For ex: when the device is locked with 0x5515: an event with lockedDevice: true is pushed for each retry
|
|
27
|
-
return getDeviceInfoTask({ deviceId }).pipe(
|
|
28
|
+
return getDeviceInfoTask({ deviceId, deviceName }).pipe(
|
|
28
29
|
scan((currentState, event) => {
|
|
29
30
|
switch (event.type) {
|
|
30
31
|
case "taskError":
|
|
@@ -70,6 +70,7 @@ describe("getLatestAvailableFirmwareAction", () => {
|
|
|
70
70
|
|
|
71
71
|
getLatestAvailableFirmwareAction({
|
|
72
72
|
deviceId: "A_DEVICE_ID",
|
|
73
|
+
deviceName: null,
|
|
73
74
|
}).subscribe({
|
|
74
75
|
next: ({
|
|
75
76
|
firmwareUpdateContext,
|
|
@@ -124,6 +125,7 @@ describe("getLatestAvailableFirmwareAction", () => {
|
|
|
124
125
|
|
|
125
126
|
getLatestAvailableFirmwareAction({
|
|
126
127
|
deviceId: "A_DEVICE_ID",
|
|
128
|
+
deviceName: null,
|
|
127
129
|
}).subscribe({
|
|
128
130
|
next: ({
|
|
129
131
|
firmwareUpdateContext,
|
|
@@ -188,6 +190,7 @@ describe("getLatestAvailableFirmwareAction", () => {
|
|
|
188
190
|
let step = 1;
|
|
189
191
|
getLatestAvailableFirmwareAction({
|
|
190
192
|
deviceId: "A_DEVICE_ID",
|
|
193
|
+
deviceName: null,
|
|
191
194
|
}).subscribe({
|
|
192
195
|
next: ({
|
|
193
196
|
firmwareUpdateContext,
|
|
@@ -265,6 +268,7 @@ describe("getLatestAvailableFirmwareAction", () => {
|
|
|
265
268
|
let step = 1;
|
|
266
269
|
getLatestAvailableFirmwareAction({
|
|
267
270
|
deviceId: "A_DEVICE_ID",
|
|
271
|
+
deviceName: null,
|
|
268
272
|
}).subscribe({
|
|
269
273
|
next: ({
|
|
270
274
|
firmwareUpdateContext,
|
|
@@ -322,4 +326,31 @@ describe("getLatestAvailableFirmwareAction", () => {
|
|
|
322
326
|
});
|
|
323
327
|
});
|
|
324
328
|
});
|
|
329
|
+
|
|
330
|
+
describe("When deviceName is provided", () => {
|
|
331
|
+
it("should pass deviceName to the underlying tasks", done => {
|
|
332
|
+
mockedInternalGetDeviceInfoTask.mockReturnValue(
|
|
333
|
+
of({ type: "data", deviceInfo: aDeviceInfo }),
|
|
334
|
+
);
|
|
335
|
+
|
|
336
|
+
mockedGetLatestFirmwareTask.mockReturnValue(
|
|
337
|
+
of({ type: "data", firmwareUpdateContext: aLatestFirmwareContext }),
|
|
338
|
+
);
|
|
339
|
+
|
|
340
|
+
getLatestAvailableFirmwareAction({
|
|
341
|
+
deviceId: "A_DEVICE_ID",
|
|
342
|
+
deviceName: "My Device",
|
|
343
|
+
}).subscribe({
|
|
344
|
+
complete: () => {
|
|
345
|
+
expect(mockedInternalGetDeviceInfoTask).toHaveBeenCalledWith(
|
|
346
|
+
expect.objectContaining({ deviceName: "My Device" }),
|
|
347
|
+
);
|
|
348
|
+
expect(mockedGetLatestFirmwareTask).toHaveBeenCalledWith(
|
|
349
|
+
expect.objectContaining({ deviceName: "My Device" }),
|
|
350
|
+
);
|
|
351
|
+
done();
|
|
352
|
+
},
|
|
353
|
+
});
|
|
354
|
+
});
|
|
355
|
+
});
|
|
325
356
|
});
|
|
@@ -17,6 +17,7 @@ import { SharedTaskEvent } from "../tasks/core";
|
|
|
17
17
|
|
|
18
18
|
export type GetLatestAvailableFirmwareActionArgs = {
|
|
19
19
|
deviceId: DeviceId;
|
|
20
|
+
deviceName: string | null;
|
|
20
21
|
};
|
|
21
22
|
|
|
22
23
|
// Union of all the tasks specific errors
|
|
@@ -65,6 +66,7 @@ export const initialState: GetLatestAvailableFirmwareActionState = {
|
|
|
65
66
|
*/
|
|
66
67
|
export function getLatestAvailableFirmwareAction({
|
|
67
68
|
deviceId,
|
|
69
|
+
deviceName,
|
|
68
70
|
}: GetLatestAvailableFirmwareActionArgs): Observable<GetLatestAvailableFirmwareActionState> {
|
|
69
71
|
const observable = new Observable<
|
|
70
72
|
| (GetLatestFirmwareTaskEvent & {
|
|
@@ -81,7 +83,7 @@ export function getLatestAvailableFirmwareAction({
|
|
|
81
83
|
status: "ongoing",
|
|
82
84
|
});
|
|
83
85
|
|
|
84
|
-
getDeviceInfoTask({ deviceId })
|
|
86
|
+
getDeviceInfoTask({ deviceId, deviceName })
|
|
85
87
|
.pipe(
|
|
86
88
|
switchMap(event => {
|
|
87
89
|
if (event.type !== "data") {
|
|
@@ -99,7 +101,10 @@ export function getLatestAvailableFirmwareAction({
|
|
|
99
101
|
});
|
|
100
102
|
|
|
101
103
|
// Keeps `deviceInfo` in the next event
|
|
102
|
-
return forkJoin([
|
|
104
|
+
return forkJoin([
|
|
105
|
+
getLatestFirmwareTask({ deviceId, deviceName, deviceInfo }),
|
|
106
|
+
of(deviceInfo),
|
|
107
|
+
]).pipe(
|
|
103
108
|
// Creating a new "event"-like object, extending it with `deviceInfo`
|
|
104
109
|
switchMap(([event, deviceInfo]) => {
|
|
105
110
|
return of({
|
|
@@ -10,6 +10,7 @@ import { scan } from "rxjs/operators";
|
|
|
10
10
|
|
|
11
11
|
export type ToggleOnboardingEarlyCheckActionArgs = {
|
|
12
12
|
deviceId: DeviceId;
|
|
13
|
+
deviceName: string | null;
|
|
13
14
|
toggleType: "enter" | "exit";
|
|
14
15
|
};
|
|
15
16
|
|
|
@@ -44,9 +45,10 @@ export const initialState: ToggleOnboardingEarlyCheckActionState = {
|
|
|
44
45
|
*/
|
|
45
46
|
export function toggleOnboardingEarlyCheckAction({
|
|
46
47
|
deviceId,
|
|
48
|
+
deviceName,
|
|
47
49
|
toggleType,
|
|
48
50
|
}: ToggleOnboardingEarlyCheckActionArgs): Observable<ToggleOnboardingEarlyCheckActionState> {
|
|
49
|
-
return toggleOnboardingEarlyCheckTask({ deviceId, toggleType }).pipe(
|
|
51
|
+
return toggleOnboardingEarlyCheckTask({ deviceId, deviceName, toggleType }).pipe(
|
|
50
52
|
scan<ToggleOnboardingEarlyCheckTaskEvent, ToggleOnboardingEarlyCheckActionState>(
|
|
51
53
|
(currentState, event) => {
|
|
52
54
|
switch (event.type) {
|
|
@@ -8,6 +8,7 @@ import { getLatestFirmwareTask, GetLatestFirmwareTaskErrorEvent } from "../tasks
|
|
|
8
8
|
|
|
9
9
|
export type updateFirmwareActionArgs = {
|
|
10
10
|
deviceId: DeviceId;
|
|
11
|
+
deviceName: string | null;
|
|
11
12
|
};
|
|
12
13
|
|
|
13
14
|
export type UpdateFirmwareActionState = FullActionState<{
|
|
@@ -51,16 +52,17 @@ export const initialState: UpdateFirmwareActionState = {
|
|
|
51
52
|
*/
|
|
52
53
|
export function updateFirmwareAction({
|
|
53
54
|
deviceId,
|
|
55
|
+
deviceName,
|
|
54
56
|
}: updateFirmwareActionArgs): Observable<UpdateFirmwareActionState> {
|
|
55
57
|
return concat(
|
|
56
58
|
of(initialState),
|
|
57
|
-
getDeviceInfoTask({ deviceId }).pipe(
|
|
59
|
+
getDeviceInfoTask({ deviceId, deviceName }).pipe(
|
|
58
60
|
switchMap(event => {
|
|
59
61
|
if (event.type !== "data") {
|
|
60
62
|
return of(event);
|
|
61
63
|
}
|
|
62
64
|
const { deviceInfo } = event;
|
|
63
|
-
return getLatestFirmwareTask({ deviceId, deviceInfo });
|
|
65
|
+
return getLatestFirmwareTask({ deviceId, deviceName, deviceInfo });
|
|
64
66
|
}),
|
|
65
67
|
switchMap(event => {
|
|
66
68
|
if (event.type !== "data") {
|
|
@@ -68,6 +70,7 @@ export function updateFirmwareAction({
|
|
|
68
70
|
} else {
|
|
69
71
|
return updateFirmwareTask({
|
|
70
72
|
deviceId,
|
|
73
|
+
deviceName,
|
|
71
74
|
updateContext: event.firmwareUpdateContext,
|
|
72
75
|
});
|
|
73
76
|
}
|
|
@@ -6,7 +6,9 @@ import { useBatteryStatuses } from "./useBatteryStatuses";
|
|
|
6
6
|
|
|
7
7
|
describe("useBatteryStatuses", () => {
|
|
8
8
|
it("should return an initial cancelRequest method that is callable", async () => {
|
|
9
|
-
const { result } = renderHook(() =>
|
|
9
|
+
const { result } = renderHook(() =>
|
|
10
|
+
useBatteryStatuses({ deviceName: null, statuses: [], enabled: true }),
|
|
11
|
+
);
|
|
10
12
|
expect(() => result.current.cancelRequest()).not.toThrow();
|
|
11
13
|
});
|
|
12
14
|
});
|
|
@@ -11,6 +11,7 @@ import { useEnv } from "../../env.react";
|
|
|
11
11
|
|
|
12
12
|
export type UseBatteryStatusesArgs = {
|
|
13
13
|
deviceId?: string;
|
|
14
|
+
deviceName: string | null;
|
|
14
15
|
statuses: BatteryStatusTypes[];
|
|
15
16
|
enabled: boolean;
|
|
16
17
|
};
|
|
@@ -29,6 +30,7 @@ export type UseBatteryStatusesArgs = {
|
|
|
29
30
|
*/
|
|
30
31
|
export const useBatteryStatuses = ({
|
|
31
32
|
deviceId,
|
|
33
|
+
deviceName,
|
|
32
34
|
statuses,
|
|
33
35
|
enabled,
|
|
34
36
|
}: UseBatteryStatusesArgs): {
|
|
@@ -56,6 +58,7 @@ export const useBatteryStatuses = ({
|
|
|
56
58
|
if (nonce > 0 && deviceId) {
|
|
57
59
|
const sub = getBatteryStatusesAction({
|
|
58
60
|
deviceId,
|
|
61
|
+
deviceName,
|
|
59
62
|
statuses,
|
|
60
63
|
}).subscribe({
|
|
61
64
|
next: state => {
|
|
@@ -90,7 +93,7 @@ export const useBatteryStatuses = ({
|
|
|
90
93
|
sub.unsubscribe();
|
|
91
94
|
};
|
|
92
95
|
}
|
|
93
|
-
}, [deviceId, lowBatteryPercentage, statuses, nonce, enabled]);
|
|
96
|
+
}, [deviceId, deviceName, lowBatteryPercentage, statuses, nonce, enabled]);
|
|
94
97
|
|
|
95
98
|
const triggerRequest = useCallback(() => {
|
|
96
99
|
setRequestCompleted(false);
|
|
@@ -8,19 +8,21 @@ import {
|
|
|
8
8
|
export type UseGetDeviceInfoArgs = {
|
|
9
9
|
getDeviceInfoAction?: typeof defaultGetDeviceInfoAction;
|
|
10
10
|
deviceId: string;
|
|
11
|
+
deviceName: string | null;
|
|
11
12
|
};
|
|
12
13
|
|
|
13
14
|
export const useGetDeviceInfo = ({
|
|
14
15
|
getDeviceInfoAction = defaultGetDeviceInfoAction,
|
|
15
16
|
deviceId,
|
|
17
|
+
deviceName,
|
|
16
18
|
}: UseGetDeviceInfoArgs): GetDeviceInfoActionState => {
|
|
17
19
|
const [state, setState] = useState<GetDeviceInfoActionState>(initialState);
|
|
18
20
|
|
|
19
21
|
useEffect(() => {
|
|
20
|
-
const sub = getDeviceInfoAction({ deviceId }).subscribe(setState);
|
|
22
|
+
const sub = getDeviceInfoAction({ deviceId, deviceName }).subscribe(setState);
|
|
21
23
|
|
|
22
24
|
return () => sub.unsubscribe();
|
|
23
|
-
}, [deviceId, getDeviceInfoAction]);
|
|
25
|
+
}, [deviceId, getDeviceInfoAction, deviceName]);
|
|
24
26
|
|
|
25
27
|
return state;
|
|
26
28
|
};
|
|
@@ -11,6 +11,7 @@ import type { IgnoredOSUpdates } from "@ledgerhq/types-live";
|
|
|
11
11
|
export type UseGetLatestAvailableFirmwareArgs = {
|
|
12
12
|
getLatestAvailableFirmwareAction?: typeof defaultGetLatestAvailableFirmwareAction;
|
|
13
13
|
deviceId: string;
|
|
14
|
+
deviceName: string | null;
|
|
14
15
|
isHookEnabled?: boolean;
|
|
15
16
|
ignoredOSUpdates?: IgnoredOSUpdates;
|
|
16
17
|
};
|
|
@@ -32,6 +33,7 @@ export type UseGetLatestAvailableFirmwareArgs = {
|
|
|
32
33
|
export const useGetLatestAvailableFirmware = ({
|
|
33
34
|
getLatestAvailableFirmwareAction = defaultGetLatestAvailableFirmwareAction,
|
|
34
35
|
deviceId,
|
|
36
|
+
deviceName,
|
|
35
37
|
isHookEnabled = true,
|
|
36
38
|
ignoredOSUpdates,
|
|
37
39
|
}: UseGetLatestAvailableFirmwareArgs): {
|
|
@@ -50,6 +52,7 @@ export const useGetLatestAvailableFirmware = ({
|
|
|
50
52
|
|
|
51
53
|
const subscription = getLatestAvailableFirmwareAction({
|
|
52
54
|
deviceId,
|
|
55
|
+
deviceName,
|
|
53
56
|
}).subscribe({
|
|
54
57
|
next: newValue => {
|
|
55
58
|
const filteredValue = filterIgnoredFirmwareUpdates(newValue, ignoredOSUpdates);
|
|
@@ -24,6 +24,7 @@ describe("useToggleOnboardingEarlyCheck", () => {
|
|
|
24
24
|
useToggleOnboardingEarlyCheck({
|
|
25
25
|
toggleOnboardingEarlyCheckAction: mockedToggleOnboardingEarlyCheckAction,
|
|
26
26
|
deviceId: "",
|
|
27
|
+
deviceName: null,
|
|
27
28
|
toggleType: "enter",
|
|
28
29
|
}),
|
|
29
30
|
);
|
|
@@ -50,6 +51,7 @@ describe("useToggleOnboardingEarlyCheck", () => {
|
|
|
50
51
|
useToggleOnboardingEarlyCheck({
|
|
51
52
|
toggleOnboardingEarlyCheckAction: mockedToggleOnboardingEarlyCheckAction,
|
|
52
53
|
deviceId: "",
|
|
54
|
+
deviceName: null,
|
|
53
55
|
toggleType,
|
|
54
56
|
}),
|
|
55
57
|
);
|
|
@@ -10,6 +10,7 @@ import {
|
|
|
10
10
|
export type UseToggleOnboardingEarlyCheckArgs = {
|
|
11
11
|
toggleOnboardingEarlyCheckAction?: typeof defaultToggleOnboardingEarlyCheckAction;
|
|
12
12
|
deviceId: string;
|
|
13
|
+
deviceName: string | null;
|
|
13
14
|
toggleType: ToggleOnboardingEarlyCheckActionArgs["toggleType"] | null;
|
|
14
15
|
};
|
|
15
16
|
|
|
@@ -39,6 +40,7 @@ export type UseToggleOnboardingEarlyCheckArgs = {
|
|
|
39
40
|
export const useToggleOnboardingEarlyCheck = ({
|
|
40
41
|
toggleOnboardingEarlyCheckAction = defaultToggleOnboardingEarlyCheckAction,
|
|
41
42
|
deviceId,
|
|
43
|
+
deviceName,
|
|
42
44
|
toggleType,
|
|
43
45
|
}: UseToggleOnboardingEarlyCheckArgs): {
|
|
44
46
|
state: ToggleOnboardingEarlyCheckActionState;
|
|
@@ -50,6 +52,7 @@ export const useToggleOnboardingEarlyCheck = ({
|
|
|
50
52
|
|
|
51
53
|
const subscription = toggleOnboardingEarlyCheckAction({
|
|
52
54
|
deviceId,
|
|
55
|
+
deviceName,
|
|
53
56
|
toggleType,
|
|
54
57
|
}).subscribe({
|
|
55
58
|
next: setState,
|
|
@@ -64,7 +67,7 @@ export const useToggleOnboardingEarlyCheck = ({
|
|
|
64
67
|
|
|
65
68
|
subscription.unsubscribe();
|
|
66
69
|
};
|
|
67
|
-
}, [deviceId, toggleOnboardingEarlyCheckAction, toggleType]);
|
|
70
|
+
}, [deviceId, deviceName, toggleOnboardingEarlyCheckAction, toggleType]);
|
|
68
71
|
|
|
69
72
|
return { state };
|
|
70
73
|
};
|
|
@@ -10,6 +10,7 @@ const STATE_UPDATE_THROTTLE = 500;
|
|
|
10
10
|
|
|
11
11
|
export type UseUpdateFirmwareArgs = {
|
|
12
12
|
deviceId: string;
|
|
13
|
+
deviceName: string | null;
|
|
13
14
|
updateFirmwareAction?: typeof defaultUpdateFirmwareAction;
|
|
14
15
|
};
|
|
15
16
|
|
|
@@ -22,6 +23,7 @@ export type UseUpdateFirmwareArgs = {
|
|
|
22
23
|
*/
|
|
23
24
|
export function useUpdateFirmware({
|
|
24
25
|
deviceId,
|
|
26
|
+
deviceName,
|
|
25
27
|
updateFirmwareAction = defaultUpdateFirmwareAction,
|
|
26
28
|
}: UseUpdateFirmwareArgs): {
|
|
27
29
|
updateState: UpdateFirmwareActionState;
|
|
@@ -34,6 +36,7 @@ export function useUpdateFirmware({
|
|
|
34
36
|
if (nonce > 0) {
|
|
35
37
|
const sub = updateFirmwareAction({
|
|
36
38
|
deviceId,
|
|
39
|
+
deviceName,
|
|
37
40
|
})
|
|
38
41
|
.pipe(
|
|
39
42
|
// in order to correctly throttle the events without losing any important events
|
|
@@ -52,7 +55,7 @@ export function useUpdateFirmware({
|
|
|
52
55
|
sub.unsubscribe();
|
|
53
56
|
};
|
|
54
57
|
}
|
|
55
|
-
}, [deviceId, updateFirmwareAction, nonce]);
|
|
58
|
+
}, [deviceId, updateFirmwareAction, nonce, deviceName]);
|
|
56
59
|
|
|
57
60
|
const triggerUpdate = useCallback(() => {
|
|
58
61
|
setUpdateState(initialState);
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { of, throwError } from "rxjs";
|
|
2
2
|
import { retryOnErrorsCommandWrapper, sharedLogicTaskWrapper } from "./core";
|
|
3
3
|
import { DisconnectedDevice, LockedDeviceError } from "@ledgerhq/errors";
|
|
4
|
+
import { DeviceBusyError } from "@ledgerhq/device-management-kit";
|
|
4
5
|
import { concatMap } from "rxjs/operators";
|
|
5
6
|
import { TransportRef } from "../transports/core";
|
|
6
7
|
import { aTransportRefBuilder } from "../mocks/aTransportRef";
|
|
8
|
+
import { isDmkError } from "./core";
|
|
7
9
|
|
|
8
10
|
// Needs to mock the timer from rxjs used in the retry mechanism
|
|
9
11
|
jest.mock("rxjs", () => {
|
|
@@ -330,4 +332,22 @@ describe("retryOnErrorsCommandWrapper", () => {
|
|
|
330
332
|
});
|
|
331
333
|
});
|
|
332
334
|
});
|
|
335
|
+
|
|
336
|
+
describe("isDmkError (deviceSDK/tasks/core)", () => {
|
|
337
|
+
it("returns true for a DMK error instance", () => {
|
|
338
|
+
expect(isDmkError(new DeviceBusyError())).toBe(true);
|
|
339
|
+
});
|
|
340
|
+
|
|
341
|
+
it("returns false for a regular Error instance", () => {
|
|
342
|
+
expect(isDmkError(new Error("error"))).toBe(false);
|
|
343
|
+
});
|
|
344
|
+
|
|
345
|
+
it("returns false for a string error (e.g. 'Invalid extension provided')", () => {
|
|
346
|
+
expect(isDmkError("Invalid extension provided")).toBe(false);
|
|
347
|
+
});
|
|
348
|
+
|
|
349
|
+
it("returns false for undefined", () => {
|
|
350
|
+
expect(isDmkError(undefined)).toBe(false);
|
|
351
|
+
});
|
|
352
|
+
});
|
|
333
353
|
});
|
|
@@ -79,7 +79,8 @@ type ErrorClass = CustomErrorClassType | TransportStatusErrorClassType;
|
|
|
79
79
|
// To be able to retry a command, the command needs to take an object containing a transport as its argument
|
|
80
80
|
type CommandTransportArgs = { transport: Transport };
|
|
81
81
|
|
|
82
|
-
export const isDmkError = (error:
|
|
82
|
+
export const isDmkError = (error: unknown): error is DmkError =>
|
|
83
|
+
!!error && typeof error === "object" && error !== null && "_tag" in error;
|
|
83
84
|
|
|
84
85
|
/**
|
|
85
86
|
* Calls a command and retries it on given errors. The transport is refreshed before each retry.
|
|
@@ -12,6 +12,7 @@ import getBatteryStatus from "../commands/getBatteryStatus";
|
|
|
12
12
|
|
|
13
13
|
export type GetBatteryStatusesTaskArgs = {
|
|
14
14
|
deviceId: DeviceId;
|
|
15
|
+
deviceName: string | null;
|
|
15
16
|
statuses: BatteryStatusTypes[];
|
|
16
17
|
};
|
|
17
18
|
|
|
@@ -30,10 +31,14 @@ export type GetBatteryStatusesTaskEvent =
|
|
|
30
31
|
|
|
31
32
|
function internalGetBatteryStatusesTask({
|
|
32
33
|
deviceId,
|
|
34
|
+
deviceName,
|
|
33
35
|
statuses,
|
|
34
36
|
}: GetBatteryStatusesTaskArgs): Observable<GetBatteryStatusesTaskEvent> {
|
|
35
37
|
return new Observable(subscriber => {
|
|
36
|
-
return withTransport(
|
|
38
|
+
return withTransport(
|
|
39
|
+
deviceId,
|
|
40
|
+
deviceName ? { matchDeviceByName: deviceName } : undefined,
|
|
41
|
+
)(({ transportRef }) =>
|
|
37
42
|
quitApp(transportRef.current).pipe(
|
|
38
43
|
switchMap(() => {
|
|
39
44
|
const statusesObservable = statuses.map(statusType =>
|
|
@@ -16,7 +16,7 @@ import { SendApduEmptyResponseError } from "@ledgerhq/device-management-kit";
|
|
|
16
16
|
const ManagerAllowedFlag = 0x08;
|
|
17
17
|
const PinValidatedFlag = 0x80;
|
|
18
18
|
|
|
19
|
-
export type GetDeviceInfoTaskArgs = { deviceId: DeviceId };
|
|
19
|
+
export type GetDeviceInfoTaskArgs = { deviceId: DeviceId; deviceName: string | null };
|
|
20
20
|
|
|
21
21
|
// No taskError for getDeviceInfoTask. Kept for consistency with other tasks.
|
|
22
22
|
export type GetDeviceInfoTaskError = "None";
|
|
@@ -34,10 +34,14 @@ export type GetDeviceInfoTaskEvent =
|
|
|
34
34
|
// Exported for tests
|
|
35
35
|
export function internalGetDeviceInfoTask({
|
|
36
36
|
deviceId,
|
|
37
|
+
deviceName,
|
|
37
38
|
}: GetDeviceInfoTaskArgs): Observable<GetDeviceInfoTaskEvent> {
|
|
38
39
|
return new Observable(subscriber => {
|
|
39
40
|
return (
|
|
40
|
-
withTransport(
|
|
41
|
+
withTransport(
|
|
42
|
+
deviceId,
|
|
43
|
+
deviceName ? { matchDeviceByName: deviceName } : undefined,
|
|
44
|
+
)(({ transportRef }) =>
|
|
41
45
|
quitApp(transportRef.current).pipe(
|
|
42
46
|
switchMap(() => {
|
|
43
47
|
return retryOnErrorsCommandWrapper({
|
|
@@ -10,6 +10,7 @@ import { withTransport } from "../transports/core";
|
|
|
10
10
|
|
|
11
11
|
export type GetLatestFirmwareTaskArgs = {
|
|
12
12
|
deviceId: DeviceId;
|
|
13
|
+
deviceName: string | null;
|
|
13
14
|
deviceInfo: DeviceInfo;
|
|
14
15
|
};
|
|
15
16
|
|
|
@@ -27,10 +28,14 @@ export type GetLatestFirmwareTaskEvent =
|
|
|
27
28
|
|
|
28
29
|
function internalGetLatestFirmwareTask({
|
|
29
30
|
deviceId,
|
|
31
|
+
deviceName,
|
|
30
32
|
deviceInfo,
|
|
31
33
|
}: GetLatestFirmwareTaskArgs): Observable<GetLatestFirmwareTaskEvent> {
|
|
32
34
|
return new Observable(subscriber => {
|
|
33
|
-
return withTransport(
|
|
35
|
+
return withTransport(
|
|
36
|
+
deviceId,
|
|
37
|
+
deviceName ? { matchDeviceByName: deviceName } : undefined,
|
|
38
|
+
)(({ transportRef }) =>
|
|
34
39
|
quitApp(transportRef.current).pipe(
|
|
35
40
|
switchMap(() => {
|
|
36
41
|
return from(getLatestFirmwareForDeviceUseCase(deviceInfo));
|
|
@@ -26,6 +26,7 @@ describe("@deviceSDK/tasks/toggleOnboardingEarlyCheckTask", () => {
|
|
|
26
26
|
// `enter` and `exit` have the same behavior
|
|
27
27
|
toggleOnboardingEarlyCheckTask({
|
|
28
28
|
deviceId: "",
|
|
29
|
+
deviceName: null,
|
|
29
30
|
toggleType: "exit",
|
|
30
31
|
}).subscribe({
|
|
31
32
|
next: event => {
|
|
@@ -47,6 +48,7 @@ describe("@deviceSDK/tasks/toggleOnboardingEarlyCheckTask", () => {
|
|
|
47
48
|
|
|
48
49
|
toggleOnboardingEarlyCheckTask({
|
|
49
50
|
deviceId: "",
|
|
51
|
+
deviceName: null,
|
|
50
52
|
toggleType: "enter",
|
|
51
53
|
}).subscribe({
|
|
52
54
|
next: event => {
|
|
@@ -78,6 +80,7 @@ describe("@deviceSDK/tasks/toggleOnboardingEarlyCheckTask", () => {
|
|
|
78
80
|
|
|
79
81
|
toggleOnboardingEarlyCheckTask({
|
|
80
82
|
deviceId: "",
|
|
83
|
+
deviceName: null,
|
|
81
84
|
toggleType: "enter",
|
|
82
85
|
}).subscribe({
|
|
83
86
|
next: event => {
|
|
@@ -26,11 +26,13 @@ export type ToggleOnboardingEarlyCheckTaskEvent =
|
|
|
26
26
|
|
|
27
27
|
export type ToggleOnboardingEarlyCheckTaskArgs = {
|
|
28
28
|
deviceId: DeviceId;
|
|
29
|
+
deviceName: string | null;
|
|
29
30
|
toggleType: "enter" | "exit";
|
|
30
31
|
};
|
|
31
32
|
|
|
32
33
|
function internalToggleOnboardingEarlyCheckTask({
|
|
33
34
|
deviceId,
|
|
35
|
+
deviceName,
|
|
34
36
|
toggleType,
|
|
35
37
|
}: ToggleOnboardingEarlyCheckTaskArgs): Observable<ToggleOnboardingEarlyCheckTaskEvent> {
|
|
36
38
|
const tracer = new LocalTracer(LOG_TYPE, {
|
|
@@ -42,7 +44,10 @@ function internalToggleOnboardingEarlyCheckTask({
|
|
|
42
44
|
const p2 = toggleType === "enter" ? ToggleTypeP2.EnterChecking : ToggleTypeP2.ExitChecking;
|
|
43
45
|
|
|
44
46
|
return new Observable(subscriber => {
|
|
45
|
-
withTransport(
|
|
47
|
+
withTransport(
|
|
48
|
+
deviceId,
|
|
49
|
+
deviceName ? { matchDeviceByName: deviceName } : undefined,
|
|
50
|
+
)(({ transportRef }) =>
|
|
46
51
|
toggleOnboardingEarlyCheckCmd({
|
|
47
52
|
transport: transportRef.current,
|
|
48
53
|
p2,
|
|
@@ -41,6 +41,7 @@ import {
|
|
|
41
41
|
|
|
42
42
|
export type UpdateFirmwareTaskArgs = {
|
|
43
43
|
deviceId: DeviceId;
|
|
44
|
+
deviceName: string | null;
|
|
44
45
|
updateContext: FirmwareUpdateContext;
|
|
45
46
|
};
|
|
46
47
|
|
|
@@ -85,6 +86,7 @@ const waitForGetVersion = retryOnErrorsCommandWrapper({
|
|
|
85
86
|
|
|
86
87
|
function internalUpdateFirmwareTask({
|
|
87
88
|
deviceId,
|
|
89
|
+
deviceName,
|
|
88
90
|
updateContext,
|
|
89
91
|
}: UpdateFirmwareTaskArgs): Observable<UpdateFirmwareTaskEvent> {
|
|
90
92
|
const tracer = new LocalTracer(LOG_TYPE, {
|
|
@@ -92,7 +94,10 @@ function internalUpdateFirmwareTask({
|
|
|
92
94
|
});
|
|
93
95
|
|
|
94
96
|
return new Observable(subscriber => {
|
|
95
|
-
const sub = withTransport(
|
|
97
|
+
const sub = withTransport(
|
|
98
|
+
deviceId,
|
|
99
|
+
deviceName ? { matchDeviceByName: deviceName } : undefined,
|
|
100
|
+
)(({ transportRef }) =>
|
|
96
101
|
concat(
|
|
97
102
|
quitApp(transportRef.current).pipe(
|
|
98
103
|
switchMap(() => {
|
|
@@ -63,7 +63,10 @@ export type JobArgs = {
|
|
|
63
63
|
* job: the job to execute with the transport. It takes:
|
|
64
64
|
* - transportRef: a reference to the transport that can be updated by calling a transportRef.refreshTransport()
|
|
65
65
|
*/
|
|
66
|
-
export const withTransport = (
|
|
66
|
+
export const withTransport = (
|
|
67
|
+
deviceId: string,
|
|
68
|
+
options?: { openTimeoutMs?: number; matchDeviceByName?: string },
|
|
69
|
+
) => {
|
|
67
70
|
return <T>(job: ({ transportRef }: JobArgs) => Observable<T>): Observable<T> =>
|
|
68
71
|
new Observable(subscriber => {
|
|
69
72
|
const queuedJobManager = DeviceQueuedJobsManager.getInstance();
|
|
@@ -149,7 +152,7 @@ export const withTransport = (deviceId: string, options?: { openTimeoutMs?: numb
|
|
|
149
152
|
close(transportRef.current, deviceId)
|
|
150
153
|
// Silently ignore errors on transport close
|
|
151
154
|
.catch(() => {})
|
|
152
|
-
.then(async () => open(deviceId, options
|
|
155
|
+
.then(async () => open(deviceId, options, tracer.getContext()))
|
|
153
156
|
.then(async newTransport => {
|
|
154
157
|
await setupTransport(transportRef.current);
|
|
155
158
|
|
|
@@ -176,7 +179,7 @@ export const withTransport = (deviceId: string, options?: { openTimeoutMs?: numb
|
|
|
176
179
|
currentJobId: jobId,
|
|
177
180
|
});
|
|
178
181
|
|
|
179
|
-
return open(deviceId, options
|
|
182
|
+
return open(deviceId, options, tracer.getContext());
|
|
180
183
|
})
|
|
181
184
|
.then(transport => {
|
|
182
185
|
return buildRefreshableTransport(transport);
|
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_SHIBA = new Account(
|
|
112
|
-
Currency.BSC_SHIBA,
|
|
113
|
-
"BNB Chain 1",
|
|
114
|
-
"0x4BE2E2B8872AA298D6d123b9211B53E41f611566",
|
|
115
|
-
0,
|
|
116
|
-
);
|
|
117
111
|
|
|
118
112
|
static readonly BTC_LEGACY_1 = new Account(
|
|
119
113
|
Currency.BTC,
|
package/src/e2e/enum/Currency.ts
CHANGED
|
@@ -156,10 +156,6 @@ export class Currency {
|
|
|
156
156
|
AppInfos.BNB_CHAIN,
|
|
157
157
|
[Network.BNB_CHAIN, Network.POLYGON],
|
|
158
158
|
);
|
|
159
|
-
static readonly BSC_SHIBA = new Currency("Shiba Inu", "SHIB", "bsc", AppInfos.BNB_CHAIN, [
|
|
160
|
-
Network.BNB_CHAIN,
|
|
161
|
-
Network.ETHEREUM,
|
|
162
|
-
]);
|
|
163
159
|
static readonly POL_DAI = new Currency(
|
|
164
160
|
"(PoS) Dai Stablecoin",
|
|
165
161
|
"DAI",
|
|
@@ -204,7 +200,7 @@ export class Currency {
|
|
|
204
200
|
static readonly SUI = new Currency("Sui", "SUI", "sui", AppInfos.SUI, [Network.SUI]);
|
|
205
201
|
|
|
206
202
|
static readonly SUI_USDC = new Currency(
|
|
207
|
-
"
|
|
203
|
+
"USD Coin",
|
|
208
204
|
"USDC",
|
|
209
205
|
"sui/coin/usdc_0xdba34672e30cb065b1f93e3ab55318768fd6fef66c15942c9f7cb846e2f900e7::usdc::usdc",
|
|
210
206
|
AppInfos.SUI,
|
|
@@ -328,3 +328,7 @@ export const getAvailableProviders = async (): Promise<string[]> => {
|
|
|
328
328
|
}
|
|
329
329
|
return Object.keys(await fetchAndMergeProviderData({ ledgerSignatureEnv, partnerSignatureEnv }));
|
|
330
330
|
};
|
|
331
|
+
|
|
332
|
+
export const getDefaultSwapProviderKeys = (): string[] => {
|
|
333
|
+
return Object.keys(DEFAULT_SWAP_PROVIDERS);
|
|
334
|
+
};
|
|
@@ -6,7 +6,7 @@ import { useFilteredProviders } from "./useFilteredProviders";
|
|
|
6
6
|
|
|
7
7
|
export function useFetchCurrencyAll() {
|
|
8
8
|
const fetchAdditionalCoins = useFeature("fetchAdditionalCoins");
|
|
9
|
-
const { providers,
|
|
9
|
+
const { providers, error } = useFilteredProviders();
|
|
10
10
|
|
|
11
11
|
const { data, ...rest } = useAPI({
|
|
12
12
|
queryFn: fetchCurrencyAll,
|
|
@@ -14,9 +14,8 @@ export function useFetchCurrencyAll() {
|
|
|
14
14
|
additionalCoinsFlag: fetchAdditionalCoins?.enabled,
|
|
15
15
|
providers,
|
|
16
16
|
},
|
|
17
|
-
// assume the all currency list for the given props won't change during a users session.
|
|
18
17
|
staleTimeout: FETCH_CURRENCIES_TIMEOUT_MS,
|
|
19
|
-
enabled: !
|
|
18
|
+
enabled: !error && providers.length > 0,
|
|
20
19
|
});
|
|
21
20
|
return {
|
|
22
21
|
...rest,
|