@ledgerhq/live-common 34.53.0-nightly.20251120023735 → 34.53.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/__tests__/test-helpers/bridge.d.ts.map +1 -1
- package/lib/__tests__/test-helpers/bridge.js +4 -0
- package/lib/__tests__/test-helpers/bridge.js.map +1 -1
- package/lib/__tests__/test-helpers/environment.js +0 -3
- package/lib/__tests__/test-helpers/environment.js.map +1 -1
- package/lib/bridge/generic-alpaca/getAccountShape.d.ts.map +1 -1
- package/lib/bridge/generic-alpaca/getAccountShape.js +10 -12
- package/lib/bridge/generic-alpaca/getAccountShape.js.map +1 -1
- package/lib/currencies/helpers.d.ts +3 -1
- package/lib/currencies/helpers.d.ts.map +1 -1
- package/lib/currencies/helpers.js +27 -1
- package/lib/currencies/helpers.js.map +1 -1
- package/lib/dada-client/hooks/useAssetsData.d.ts +0 -1
- package/lib/dada-client/hooks/useAssetsData.d.ts.map +1 -1
- package/lib/dada-client/hooks/useAssetsData.js +0 -1
- package/lib/dada-client/hooks/useAssetsData.js.map +1 -1
- package/lib/deposit/helper.d.ts +8 -0
- package/lib/deposit/helper.d.ts.map +1 -0
- package/lib/deposit/helper.js +125 -0
- package/lib/deposit/helper.js.map +1 -0
- package/lib/deposit/index.d.ts +3 -0
- package/lib/deposit/index.d.ts.map +1 -0
- package/lib/deposit/index.js +6 -0
- package/lib/deposit/index.js.map +1 -0
- package/lib/deposit/mock.d.ts +75 -0
- package/lib/deposit/mock.d.ts.map +1 -0
- package/lib/deposit/mock.js +15111 -0
- package/lib/deposit/mock.js.map +1 -0
- package/lib/deposit/type.d.ts +17 -0
- package/lib/deposit/type.d.ts.map +1 -1
- package/lib/deposit/type.js.map +1 -1
- package/lib/deposit/useGroupedCurrenciesByProvider.hook.d.ts +3 -0
- package/lib/deposit/useGroupedCurrenciesByProvider.hook.d.ts.map +1 -0
- package/lib/deposit/useGroupedCurrenciesByProvider.hook.js +40 -0
- package/lib/deposit/useGroupedCurrenciesByProvider.hook.js.map +1 -0
- package/lib/deviceSDK/hooks/useBatteryStatuses.d.ts +1 -2
- package/lib/deviceSDK/hooks/useBatteryStatuses.d.ts.map +1 -1
- package/lib/deviceSDK/hooks/useBatteryStatuses.js +2 -4
- package/lib/deviceSDK/hooks/useBatteryStatuses.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/getDeviceInfo.d.ts.map +1 -1
- package/lib/deviceSDK/tasks/getDeviceInfo.js +0 -2
- package/lib/deviceSDK/tasks/getDeviceInfo.js.map +1 -1
- 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/updateFirmware.d.ts.map +1 -1
- package/lib/deviceSDK/tasks/updateFirmware.js +0 -1
- package/lib/deviceSDK/tasks/updateFirmware.js.map +1 -1
- package/lib/e2e/deviceInteraction/ButtonDeviceSimulator.d.ts +3 -0
- package/lib/e2e/deviceInteraction/ButtonDeviceSimulator.d.ts.map +1 -0
- package/lib/e2e/deviceInteraction/ButtonDeviceSimulator.js +26 -0
- package/lib/e2e/deviceInteraction/ButtonDeviceSimulator.js.map +1 -0
- package/lib/e2e/enum/Account.d.ts +1 -0
- package/lib/e2e/enum/Account.d.ts.map +1 -1
- package/lib/e2e/enum/Account.js +1 -0
- package/lib/e2e/enum/Account.js.map +1 -1
- package/lib/e2e/enum/Currency.d.ts +1 -0
- package/lib/e2e/enum/Currency.d.ts.map +1 -1
- package/lib/e2e/enum/Currency.js +6 -2
- package/lib/e2e/enum/Currency.js.map +1 -1
- package/lib/e2e/families/algorand.d.ts +1 -1
- package/lib/e2e/families/algorand.d.ts.map +1 -1
- package/lib/e2e/families/algorand.js +5 -5
- package/lib/e2e/families/algorand.js.map +1 -1
- package/lib/e2e/families/aptos.d.ts +2 -2
- package/lib/e2e/families/aptos.d.ts.map +1 -1
- package/lib/e2e/families/aptos.js +9 -9
- package/lib/e2e/families/aptos.js.map +1 -1
- package/lib/e2e/families/bitcoin.d.ts +2 -2
- package/lib/e2e/families/bitcoin.d.ts.map +1 -1
- package/lib/e2e/families/bitcoin.js +11 -11
- package/lib/e2e/families/bitcoin.js.map +1 -1
- package/lib/e2e/families/cardano.d.ts +0 -6
- package/lib/e2e/families/cardano.d.ts.map +1 -1
- package/lib/e2e/families/cardano.js +26 -28
- package/lib/e2e/families/cardano.js.map +1 -1
- package/lib/e2e/families/celo.d.ts +1 -1
- package/lib/e2e/families/celo.d.ts.map +1 -1
- package/lib/e2e/families/celo.js +5 -5
- package/lib/e2e/families/celo.js.map +1 -1
- package/lib/e2e/families/cosmos.d.ts +2 -2
- package/lib/e2e/families/cosmos.d.ts.map +1 -1
- package/lib/e2e/families/cosmos.js +9 -9
- package/lib/e2e/families/cosmos.js.map +1 -1
- package/lib/e2e/families/evm.d.ts +0 -2
- package/lib/e2e/families/evm.d.ts.map +1 -1
- package/lib/e2e/families/evm.js +12 -13
- package/lib/e2e/families/evm.js.map +1 -1
- package/lib/e2e/families/hedera.d.ts +1 -1
- package/lib/e2e/families/hedera.d.ts.map +1 -1
- package/lib/e2e/families/hedera.js +5 -5
- package/lib/e2e/families/hedera.js.map +1 -1
- package/lib/e2e/families/kaspa.d.ts +2 -2
- package/lib/e2e/families/kaspa.d.ts.map +1 -1
- package/lib/e2e/families/kaspa.js +9 -9
- package/lib/e2e/families/kaspa.js.map +1 -1
- package/lib/e2e/families/multiversX.d.ts +1 -1
- package/lib/e2e/families/multiversX.d.ts.map +1 -1
- package/lib/e2e/families/multiversX.js +5 -5
- package/lib/e2e/families/multiversX.js.map +1 -1
- package/lib/e2e/families/near.d.ts +1 -1
- package/lib/e2e/families/near.d.ts.map +1 -1
- package/lib/e2e/families/near.js +6 -6
- package/lib/e2e/families/near.js.map +1 -1
- package/lib/e2e/families/osmosis.d.ts +1 -1
- package/lib/e2e/families/osmosis.d.ts.map +1 -1
- package/lib/e2e/families/osmosis.js +5 -5
- package/lib/e2e/families/osmosis.js.map +1 -1
- package/lib/e2e/families/polkadot.d.ts +1 -1
- package/lib/e2e/families/polkadot.d.ts.map +1 -1
- package/lib/e2e/families/polkadot.js +5 -5
- package/lib/e2e/families/polkadot.js.map +1 -1
- package/lib/e2e/families/solana.d.ts +2 -2
- package/lib/e2e/families/solana.d.ts.map +1 -1
- package/lib/e2e/families/solana.js +9 -9
- package/lib/e2e/families/solana.js.map +1 -1
- package/lib/e2e/families/stellar.d.ts +1 -1
- package/lib/e2e/families/stellar.d.ts.map +1 -1
- package/lib/e2e/families/stellar.js +5 -5
- package/lib/e2e/families/stellar.js.map +1 -1
- package/lib/e2e/families/sui.d.ts +1 -1
- package/lib/e2e/families/sui.d.ts.map +1 -1
- package/lib/e2e/families/sui.js +5 -5
- package/lib/e2e/families/sui.js.map +1 -1
- package/lib/e2e/families/tezos.d.ts +1 -1
- package/lib/e2e/families/tezos.d.ts.map +1 -1
- package/lib/e2e/families/tezos.js +8 -7
- package/lib/e2e/families/tezos.js.map +1 -1
- package/lib/e2e/families/tron.d.ts +1 -1
- package/lib/e2e/families/tron.d.ts.map +1 -1
- package/lib/e2e/families/tron.js +5 -5
- package/lib/e2e/families/tron.js.map +1 -1
- package/lib/e2e/families/xrp.d.ts +1 -1
- package/lib/e2e/families/xrp.d.ts.map +1 -1
- package/lib/e2e/families/xrp.js +5 -5
- package/lib/e2e/families/xrp.js.map +1 -1
- package/lib/e2e/index.d.ts +0 -15
- package/lib/e2e/index.d.ts.map +1 -1
- package/lib/e2e/speculos.d.ts +11 -11
- package/lib/e2e/speculos.d.ts.map +1 -1
- package/lib/e2e/speculos.js +78 -78
- package/lib/e2e/speculos.js.map +1 -1
- package/lib/exchange/providers/swap.d.ts +0 -1
- package/lib/exchange/providers/swap.d.ts.map +1 -1
- package/lib/exchange/providers/swap.js +1 -5
- 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 +3 -2
- 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 +10 -15
- package/lib/exchange/swap/hooks/v5/useFilteredProviders.js.map +1 -1
- package/lib/families/canton/bridge/mock.d.ts.map +1 -1
- package/lib/families/canton/bridge/mock.js +0 -1
- package/lib/families/canton/bridge/mock.js.map +1 -1
- package/lib/families/evm/config.d.ts.map +1 -1
- package/lib/families/evm/config.js +0 -49
- package/lib/families/evm/config.js.map +1 -1
- package/lib/featureFlags/defaultFeatures.d.ts +0 -3
- package/lib/featureFlags/defaultFeatures.d.ts.map +1 -1
- package/lib/featureFlags/defaultFeatures.js +0 -6
- package/lib/featureFlags/defaultFeatures.js.map +1 -1
- package/lib/featureFlags/useFeature.d.ts +1 -1
- package/lib/featureFlags/useFeature.d.ts.map +1 -1
- package/lib/market/hooks/useMarketDataProvider.js +0 -1
- package/lib/market/hooks/useMarketDataProvider.js.map +1 -1
- package/lib/market/utils/types.d.ts +0 -1
- package/lib/market/utils/types.d.ts.map +1 -1
- package/lib/market/utils/types.js.map +1 -1
- package/lib/modularDrawer/__mocks__/useGroupedCurrenciesByProvider.mock.d.ts +22 -0
- package/lib/modularDrawer/__mocks__/useGroupedCurrenciesByProvider.mock.d.ts.map +1 -0
- package/lib/modularDrawer/__mocks__/useGroupedCurrenciesByProvider.mock.js +41 -0
- package/lib/modularDrawer/__mocks__/useGroupedCurrenciesByProvider.mock.js.map +1 -0
- package/lib/modularDrawer/hooks/useCurrenciesUnderFeatureFlag.d.ts.map +1 -1
- package/lib/modularDrawer/hooks/useCurrenciesUnderFeatureFlag.js +0 -11
- package/lib/modularDrawer/hooks/useCurrenciesUnderFeatureFlag.js.map +1 -1
- package/lib/modularDrawer/hooks/useNetworkAccountCounts.d.ts +5 -1
- 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 +2 -1
- package/lib/modularDrawer/modules/createNetworkConfiguration.js.map +1 -1
- package/lib/modularDrawer/utils/currencyUtils.d.ts +10 -0
- package/lib/modularDrawer/utils/currencyUtils.d.ts.map +1 -0
- package/lib/modularDrawer/utils/currencyUtils.js +74 -0
- package/lib/modularDrawer/utils/currencyUtils.js.map +1 -0
- package/lib/modularDrawer/utils/{groupCurrenciesByAsset.d.ts → groupCurrenciesByProvider.d.ts} +2 -2
- package/lib/modularDrawer/utils/groupCurrenciesByProvider.d.ts.map +1 -0
- package/lib/modularDrawer/utils/groupCurrenciesByProvider.js +21 -0
- package/lib/modularDrawer/utils/groupCurrenciesByProvider.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 +5 -0
- package/lib/modularDrawer/utils/type.d.ts.map +1 -1
- package/lib/platform/filters.d.ts +2 -1
- package/lib/platform/filters.d.ts.map +1 -1
- package/lib/platform/filters.js +17 -1
- package/lib/platform/filters.js.map +1 -1
- package/lib/platform/helpers.d.ts +5 -1
- package/lib/platform/helpers.d.ts.map +1 -1
- package/lib/platform/helpers.js +33 -1
- package/lib/platform/helpers.js.map +1 -1
- package/lib/platform/react.d.ts +3 -2
- package/lib/platform/react.d.ts.map +1 -1
- package/lib/platform/react.js +16 -66
- 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/postOnboarding/reducer.d.ts +0 -2
- package/lib/postOnboarding/reducer.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 +3 -2
- 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 +4 -5
- package/lib/wallet-api/Exchange/server.js.map +1 -1
- package/lib/wallet-api/converters.d.ts +0 -1
- package/lib/wallet-api/converters.d.ts.map +1 -1
- package/lib/wallet-api/converters.js +2 -7
- package/lib/wallet-api/converters.js.map +1 -1
- package/lib/wallet-api/react.d.ts +11 -6
- package/lib/wallet-api/react.d.ts.map +1 -1
- package/lib/wallet-api/react.js +135 -293
- package/lib/wallet-api/react.js.map +1 -1
- package/lib/wallet-api/tracking.d.ts +0 -6
- package/lib/wallet-api/tracking.d.ts.map +1 -1
- package/lib/wallet-api/tracking.js +0 -20
- package/lib/wallet-api/tracking.js.map +1 -1
- package/lib/wallet-api/types.d.ts +0 -3
- 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 +80 -65
- package/lib/wallet-api/useDappLogic.js.map +1 -1
- package/lib/wallet-api/utils/deriveAccountIdForManifest.d.ts +0 -6
- package/lib/wallet-api/utils/deriveAccountIdForManifest.d.ts.map +1 -1
- package/lib/wallet-api/utils/deriveAccountIdForManifest.js +3 -13
- 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 +4 -0
- package/lib-es/__tests__/test-helpers/bridge.js.map +1 -1
- package/lib-es/__tests__/test-helpers/environment.js +0 -3
- package/lib-es/__tests__/test-helpers/environment.js.map +1 -1
- package/lib-es/bridge/generic-alpaca/getAccountShape.d.ts.map +1 -1
- package/lib-es/bridge/generic-alpaca/getAccountShape.js +11 -13
- package/lib-es/bridge/generic-alpaca/getAccountShape.js.map +1 -1
- package/lib-es/currencies/helpers.d.ts +3 -1
- package/lib-es/currencies/helpers.d.ts.map +1 -1
- package/lib-es/currencies/helpers.js +24 -0
- package/lib-es/currencies/helpers.js.map +1 -1
- package/lib-es/dada-client/hooks/useAssetsData.d.ts +0 -1
- package/lib-es/dada-client/hooks/useAssetsData.d.ts.map +1 -1
- package/lib-es/dada-client/hooks/useAssetsData.js +0 -1
- package/lib-es/dada-client/hooks/useAssetsData.js.map +1 -1
- package/lib-es/deposit/helper.d.ts +8 -0
- package/lib-es/deposit/helper.d.ts.map +1 -0
- package/lib-es/deposit/helper.js +117 -0
- package/lib-es/deposit/helper.js.map +1 -0
- package/lib-es/deposit/index.d.ts +3 -0
- package/lib-es/deposit/index.d.ts.map +1 -0
- package/lib-es/deposit/index.js +3 -0
- package/lib-es/deposit/index.js.map +1 -0
- package/lib-es/deposit/mock.d.ts +75 -0
- package/lib-es/deposit/mock.d.ts.map +1 -0
- package/lib-es/deposit/mock.js +15108 -0
- package/lib-es/deposit/mock.js.map +1 -0
- package/lib-es/deposit/type.d.ts +17 -0
- package/lib-es/deposit/type.d.ts.map +1 -1
- package/lib-es/deposit/type.js.map +1 -1
- package/lib-es/deposit/useGroupedCurrenciesByProvider.hook.d.ts +3 -0
- package/lib-es/deposit/useGroupedCurrenciesByProvider.hook.d.ts.map +1 -0
- package/lib-es/deposit/useGroupedCurrenciesByProvider.hook.js +36 -0
- package/lib-es/deposit/useGroupedCurrenciesByProvider.hook.js.map +1 -0
- package/lib-es/deviceSDK/hooks/useBatteryStatuses.d.ts +1 -2
- package/lib-es/deviceSDK/hooks/useBatteryStatuses.d.ts.map +1 -1
- package/lib-es/deviceSDK/hooks/useBatteryStatuses.js +2 -4
- package/lib-es/deviceSDK/hooks/useBatteryStatuses.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/getDeviceInfo.d.ts.map +1 -1
- package/lib-es/deviceSDK/tasks/getDeviceInfo.js +0 -2
- package/lib-es/deviceSDK/tasks/getDeviceInfo.js.map +1 -1
- 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/updateFirmware.d.ts.map +1 -1
- package/lib-es/deviceSDK/tasks/updateFirmware.js +1 -2
- package/lib-es/deviceSDK/tasks/updateFirmware.js.map +1 -1
- package/lib-es/e2e/deviceInteraction/ButtonDeviceSimulator.d.ts +3 -0
- package/lib-es/e2e/deviceInteraction/ButtonDeviceSimulator.d.ts.map +1 -0
- package/lib-es/e2e/deviceInteraction/ButtonDeviceSimulator.js +18 -0
- package/lib-es/e2e/deviceInteraction/ButtonDeviceSimulator.js.map +1 -0
- package/lib-es/e2e/enum/Account.d.ts +1 -0
- package/lib-es/e2e/enum/Account.d.ts.map +1 -1
- package/lib-es/e2e/enum/Account.js +1 -0
- package/lib-es/e2e/enum/Account.js.map +1 -1
- package/lib-es/e2e/enum/Currency.d.ts +1 -0
- package/lib-es/e2e/enum/Currency.d.ts.map +1 -1
- package/lib-es/e2e/enum/Currency.js +6 -2
- package/lib-es/e2e/enum/Currency.js.map +1 -1
- package/lib-es/e2e/families/algorand.d.ts +1 -1
- package/lib-es/e2e/families/algorand.d.ts.map +1 -1
- package/lib-es/e2e/families/algorand.js +4 -5
- package/lib-es/e2e/families/algorand.js.map +1 -1
- package/lib-es/e2e/families/aptos.d.ts +2 -2
- package/lib-es/e2e/families/aptos.d.ts.map +1 -1
- package/lib-es/e2e/families/aptos.js +7 -9
- package/lib-es/e2e/families/aptos.js.map +1 -1
- package/lib-es/e2e/families/bitcoin.d.ts +2 -2
- package/lib-es/e2e/families/bitcoin.d.ts.map +1 -1
- package/lib-es/e2e/families/bitcoin.js +9 -11
- package/lib-es/e2e/families/bitcoin.js.map +1 -1
- package/lib-es/e2e/families/cardano.d.ts +0 -6
- package/lib-es/e2e/families/cardano.d.ts.map +1 -1
- package/lib-es/e2e/families/cardano.js +21 -23
- package/lib-es/e2e/families/cardano.js.map +1 -1
- package/lib-es/e2e/families/celo.d.ts +1 -1
- package/lib-es/e2e/families/celo.d.ts.map +1 -1
- package/lib-es/e2e/families/celo.js +4 -5
- package/lib-es/e2e/families/celo.js.map +1 -1
- package/lib-es/e2e/families/cosmos.d.ts +2 -2
- package/lib-es/e2e/families/cosmos.d.ts.map +1 -1
- package/lib-es/e2e/families/cosmos.js +7 -9
- package/lib-es/e2e/families/cosmos.js.map +1 -1
- package/lib-es/e2e/families/evm.d.ts +0 -2
- package/lib-es/e2e/families/evm.d.ts.map +1 -1
- package/lib-es/e2e/families/evm.js +9 -10
- package/lib-es/e2e/families/evm.js.map +1 -1
- package/lib-es/e2e/families/hedera.d.ts +1 -1
- package/lib-es/e2e/families/hedera.d.ts.map +1 -1
- package/lib-es/e2e/families/hedera.js +4 -5
- package/lib-es/e2e/families/hedera.js.map +1 -1
- package/lib-es/e2e/families/kaspa.d.ts +2 -2
- package/lib-es/e2e/families/kaspa.d.ts.map +1 -1
- package/lib-es/e2e/families/kaspa.js +7 -9
- package/lib-es/e2e/families/kaspa.js.map +1 -1
- package/lib-es/e2e/families/multiversX.d.ts +1 -1
- package/lib-es/e2e/families/multiversX.d.ts.map +1 -1
- package/lib-es/e2e/families/multiversX.js +4 -5
- package/lib-es/e2e/families/multiversX.js.map +1 -1
- package/lib-es/e2e/families/near.d.ts +1 -1
- package/lib-es/e2e/families/near.d.ts.map +1 -1
- package/lib-es/e2e/families/near.js +5 -6
- package/lib-es/e2e/families/near.js.map +1 -1
- package/lib-es/e2e/families/osmosis.d.ts +1 -1
- package/lib-es/e2e/families/osmosis.d.ts.map +1 -1
- package/lib-es/e2e/families/osmosis.js +4 -5
- package/lib-es/e2e/families/osmosis.js.map +1 -1
- package/lib-es/e2e/families/polkadot.d.ts +1 -1
- package/lib-es/e2e/families/polkadot.d.ts.map +1 -1
- package/lib-es/e2e/families/polkadot.js +4 -5
- package/lib-es/e2e/families/polkadot.js.map +1 -1
- package/lib-es/e2e/families/solana.d.ts +2 -2
- package/lib-es/e2e/families/solana.d.ts.map +1 -1
- package/lib-es/e2e/families/solana.js +7 -9
- package/lib-es/e2e/families/solana.js.map +1 -1
- package/lib-es/e2e/families/stellar.d.ts +1 -1
- package/lib-es/e2e/families/stellar.d.ts.map +1 -1
- package/lib-es/e2e/families/stellar.js +4 -5
- package/lib-es/e2e/families/stellar.js.map +1 -1
- package/lib-es/e2e/families/sui.d.ts +1 -1
- package/lib-es/e2e/families/sui.d.ts.map +1 -1
- package/lib-es/e2e/families/sui.js +4 -5
- package/lib-es/e2e/families/sui.js.map +1 -1
- package/lib-es/e2e/families/tezos.d.ts +1 -1
- package/lib-es/e2e/families/tezos.d.ts.map +1 -1
- package/lib-es/e2e/families/tezos.js +8 -8
- package/lib-es/e2e/families/tezos.js.map +1 -1
- package/lib-es/e2e/families/tron.d.ts +1 -1
- package/lib-es/e2e/families/tron.d.ts.map +1 -1
- package/lib-es/e2e/families/tron.js +4 -5
- package/lib-es/e2e/families/tron.js.map +1 -1
- package/lib-es/e2e/families/xrp.d.ts +1 -1
- package/lib-es/e2e/families/xrp.d.ts.map +1 -1
- package/lib-es/e2e/families/xrp.js +4 -5
- package/lib-es/e2e/families/xrp.js.map +1 -1
- package/lib-es/e2e/index.d.ts +0 -15
- package/lib-es/e2e/index.d.ts.map +1 -1
- package/lib-es/e2e/speculos.d.ts +11 -11
- package/lib-es/e2e/speculos.d.ts.map +1 -1
- package/lib-es/e2e/speculos.js +43 -54
- package/lib-es/e2e/speculos.js.map +1 -1
- package/lib-es/exchange/providers/swap.d.ts +0 -1
- package/lib-es/exchange/providers/swap.d.ts.map +1 -1
- package/lib-es/exchange/providers/swap.js +0 -3
- 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 +3 -2
- 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 +12 -17
- package/lib-es/exchange/swap/hooks/v5/useFilteredProviders.js.map +1 -1
- package/lib-es/families/canton/bridge/mock.d.ts.map +1 -1
- package/lib-es/families/canton/bridge/mock.js +0 -1
- package/lib-es/families/canton/bridge/mock.js.map +1 -1
- package/lib-es/families/evm/config.d.ts.map +1 -1
- package/lib-es/families/evm/config.js +0 -49
- package/lib-es/families/evm/config.js.map +1 -1
- package/lib-es/featureFlags/defaultFeatures.d.ts +0 -3
- package/lib-es/featureFlags/defaultFeatures.d.ts.map +1 -1
- package/lib-es/featureFlags/defaultFeatures.js +0 -6
- package/lib-es/featureFlags/defaultFeatures.js.map +1 -1
- package/lib-es/featureFlags/useFeature.d.ts +1 -1
- package/lib-es/featureFlags/useFeature.d.ts.map +1 -1
- package/lib-es/market/hooks/useMarketDataProvider.js +0 -1
- package/lib-es/market/hooks/useMarketDataProvider.js.map +1 -1
- package/lib-es/market/utils/types.d.ts +0 -1
- 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/__mocks__/useGroupedCurrenciesByProvider.mock.d.ts +22 -0
- package/lib-es/modularDrawer/__mocks__/useGroupedCurrenciesByProvider.mock.d.ts.map +1 -0
- package/lib-es/modularDrawer/__mocks__/useGroupedCurrenciesByProvider.mock.js +38 -0
- package/lib-es/modularDrawer/__mocks__/useGroupedCurrenciesByProvider.mock.js.map +1 -0
- package/lib-es/modularDrawer/hooks/useCurrenciesUnderFeatureFlag.d.ts.map +1 -1
- package/lib-es/modularDrawer/hooks/useCurrenciesUnderFeatureFlag.js +0 -11
- package/lib-es/modularDrawer/hooks/useCurrenciesUnderFeatureFlag.js.map +1 -1
- package/lib-es/modularDrawer/hooks/useNetworkAccountCounts.d.ts +5 -1
- 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 +2 -1
- package/lib-es/modularDrawer/modules/createNetworkConfiguration.js.map +1 -1
- package/lib-es/modularDrawer/utils/currencyUtils.d.ts +10 -0
- package/lib-es/modularDrawer/utils/currencyUtils.d.ts.map +1 -0
- package/lib-es/modularDrawer/utils/currencyUtils.js +65 -0
- package/lib-es/modularDrawer/utils/currencyUtils.js.map +1 -0
- package/lib-es/modularDrawer/utils/{groupCurrenciesByAsset.d.ts → groupCurrenciesByProvider.d.ts} +2 -2
- package/lib-es/modularDrawer/utils/groupCurrenciesByProvider.d.ts.map +1 -0
- package/lib-es/modularDrawer/utils/{groupCurrenciesByAsset.js → groupCurrenciesByProvider.js} +6 -6
- package/lib-es/modularDrawer/utils/groupCurrenciesByProvider.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 +5 -0
- package/lib-es/modularDrawer/utils/type.d.ts.map +1 -1
- package/lib-es/platform/filters.d.ts +2 -1
- package/lib-es/platform/filters.d.ts.map +1 -1
- package/lib-es/platform/filters.js +15 -0
- package/lib-es/platform/filters.js.map +1 -1
- package/lib-es/platform/helpers.d.ts +5 -1
- package/lib-es/platform/helpers.d.ts.map +1 -1
- package/lib-es/platform/helpers.js +30 -1
- package/lib-es/platform/helpers.js.map +1 -1
- package/lib-es/platform/react.d.ts +3 -2
- package/lib-es/platform/react.d.ts.map +1 -1
- package/lib-es/platform/react.js +16 -67
- 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/postOnboarding/reducer.d.ts +0 -2
- package/lib-es/postOnboarding/reducer.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 +3 -2
- 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 +4 -5
- package/lib-es/wallet-api/Exchange/server.js.map +1 -1
- package/lib-es/wallet-api/converters.d.ts +0 -1
- package/lib-es/wallet-api/converters.d.ts.map +1 -1
- package/lib-es/wallet-api/converters.js +1 -5
- package/lib-es/wallet-api/converters.js.map +1 -1
- package/lib-es/wallet-api/react.d.ts +11 -6
- package/lib-es/wallet-api/react.d.ts.map +1 -1
- package/lib-es/wallet-api/react.js +131 -291
- package/lib-es/wallet-api/react.js.map +1 -1
- package/lib-es/wallet-api/tracking.d.ts +0 -6
- package/lib-es/wallet-api/tracking.d.ts.map +1 -1
- package/lib-es/wallet-api/tracking.js +0 -20
- package/lib-es/wallet-api/tracking.js.map +1 -1
- package/lib-es/wallet-api/types.d.ts +0 -3
- 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 +77 -62
- package/lib-es/wallet-api/useDappLogic.js.map +1 -1
- package/lib-es/wallet-api/utils/deriveAccountIdForManifest.d.ts +0 -6
- package/lib-es/wallet-api/utils/deriveAccountIdForManifest.d.ts.map +1 -1
- package/lib-es/wallet-api/utils/deriveAccountIdForManifest.js +2 -11
- package/lib-es/wallet-api/utils/deriveAccountIdForManifest.js.map +1 -1
- package/package.json +58 -59
- package/src/__tests__/migration/account-migration.ts +0 -3
- package/src/__tests__/test-helpers/bridge.ts +2 -0
- package/src/__tests__/test-helpers/environment.ts +0 -3
- package/src/bridge/generic-alpaca/getAccountShape.ts +12 -15
- package/src/bridge/generic-alpaca/tests/getAccountShape.test.ts +101 -142
- package/src/currencies/helpers.test.ts +20 -0
- package/src/currencies/helpers.ts +42 -1
- package/src/dada-client/hooks/useAssetsData.ts +0 -1
- package/src/deposit/deposit.integration.test.ts +88 -0
- package/src/deposit/deposit.test.ts +684 -0
- package/src/deposit/helper.ts +143 -0
- package/src/deposit/index.ts +3 -0
- package/src/deposit/mock.ts +15112 -0
- package/src/deposit/type.ts +21 -0
- package/src/deposit/useGroupedCurrenciesByProvider.hook.ts +46 -0
- package/src/deviceSDK/hooks/useBatteryStatuses.test.ts +1 -3
- package/src/deviceSDK/hooks/useBatteryStatuses.ts +1 -4
- package/src/deviceSDK/tasks/core.test.ts +0 -20
- package/src/deviceSDK/tasks/core.ts +1 -2
- package/src/deviceSDK/tasks/getDeviceInfo.ts +0 -2
- package/src/deviceSDK/tasks/getLatestFirmware.ts +4 -4
- package/src/deviceSDK/tasks/updateFirmware.ts +0 -2
- package/src/e2e/deviceInteraction/ButtonDeviceSimulator.ts +23 -0
- package/src/e2e/enum/Account.ts +6 -0
- package/src/e2e/enum/Currency.ts +6 -2
- package/src/e2e/families/algorand.ts +13 -20
- package/src/e2e/families/aptos.ts +16 -28
- package/src/e2e/families/bitcoin.ts +39 -53
- package/src/e2e/families/cardano.ts +36 -47
- package/src/e2e/families/celo.ts +12 -18
- package/src/e2e/families/cosmos.ts +23 -35
- package/src/e2e/families/evm.ts +13 -24
- package/src/e2e/families/hedera.ts +4 -6
- package/src/e2e/families/kaspa.ts +16 -28
- package/src/e2e/families/multiversX.ts +10 -16
- package/src/e2e/families/near.ts +17 -23
- package/src/e2e/families/osmosis.ts +13 -19
- package/src/e2e/families/polkadot.ts +13 -19
- package/src/e2e/families/solana.ts +23 -35
- package/src/e2e/families/stellar.ts +13 -18
- package/src/e2e/families/sui.ts +9 -15
- package/src/e2e/families/tezos.ts +18 -25
- package/src/e2e/families/tron.ts +13 -19
- package/src/e2e/families/xrp.ts +13 -19
- package/src/e2e/speculos.ts +140 -168
- package/src/exchange/providers/swap.ts +0 -4
- package/src/exchange/swap/hooks/v5/useFetchCurrencyAll.ts +3 -2
- package/src/exchange/swap/hooks/v5/useFilteredProviders.ts +12 -37
- package/src/families/canton/bridge/mock.ts +0 -1
- package/src/families/evm/config.ts +0 -49
- package/src/families/stellar/__snapshots__/bridge.integration.test.ts.snap +12 -84
- package/src/featureFlags/defaultFeatures.ts +0 -6
- package/src/market/hooks/useMarketDataProvider.ts +0 -1
- package/src/market/utils/types.ts +0 -1
- package/src/modularDrawer/__mocks__/useGroupedCurrenciesByProvider.mock.ts +49 -0
- package/src/modularDrawer/hooks/__test__/useAssetAccountCounts.test.ts +5 -0
- package/src/modularDrawer/hooks/useCurrenciesUnderFeatureFlag.ts +0 -11
- package/src/modularDrawer/hooks/useNetworkAccountCounts.tsx +6 -1
- package/src/modularDrawer/modules/__test__/createAssetConfiguration.test.tsx +2 -2
- package/src/modularDrawer/modules/__test__/createNetworkConfiguration.test.ts +342 -0
- package/src/modularDrawer/modules/createNetworkConfiguration.ts +2 -1
- package/src/modularDrawer/utils/__tests__/currencyUtils.test.ts +126 -0
- package/src/modularDrawer/utils/currencyUtils.ts +95 -0
- package/src/modularDrawer/utils/{groupCurrenciesByAsset.ts → groupCurrenciesByProvider.ts} +5 -5
- package/src/modularDrawer/utils/index.ts +1 -1
- package/src/modularDrawer/utils/type.ts +5 -0
- package/src/platform/filters.ts +23 -1
- package/src/platform/helpers.ts +49 -2
- package/src/platform/react.ts +22 -86
- package/src/platform/types.ts +1 -1
- package/src/utils/__tests__/getAccountTuplesForCurrency.test.ts +30 -0
- package/src/utils/getAccountTuplesForCurrency.ts +6 -1
- package/src/wallet-api/Exchange/server.test.ts +5 -0
- package/src/wallet-api/Exchange/server.ts +6 -7
- package/src/wallet-api/converters.ts +1 -6
- package/src/wallet-api/react.ts +137 -312
- package/src/wallet-api/tracking.ts +0 -22
- package/src/wallet-api/types.ts +0 -5
- package/src/wallet-api/useDappLogic.ts +106 -91
- package/src/wallet-api/utils/deriveAccountIdForManifest.ts +2 -14
- package/lib/device/use-cases/getDeviceHasBattery.d.ts +0 -2
- package/lib/device/use-cases/getDeviceHasBattery.d.ts.map +0 -1
- package/lib/device/use-cases/getDeviceHasBattery.js +0 -6
- package/lib/device/use-cases/getDeviceHasBattery.js.map +0 -1
- package/lib/e2e/deviceInteraction/DeviceController.d.ts +0 -41
- package/lib/e2e/deviceInteraction/DeviceController.d.ts.map +0 -1
- package/lib/e2e/deviceInteraction/DeviceController.js +0 -68
- package/lib/e2e/deviceInteraction/DeviceController.js.map +0 -1
- package/lib/e2e/enum/ReceiveFundsOptions.d.ts +0 -6
- package/lib/e2e/enum/ReceiveFundsOptions.d.ts.map +0 -1
- package/lib/e2e/enum/ReceiveFundsOptions.js +0 -8
- package/lib/e2e/enum/ReceiveFundsOptions.js.map +0 -1
- package/lib/families/canton/react.d.ts +0 -15
- package/lib/families/canton/react.d.ts.map +0 -1
- package/lib/families/canton/react.js +0 -14
- package/lib/families/canton/react.js.map +0 -1
- package/lib/modularDrawer/utils/groupCurrenciesByAsset.d.ts.map +0 -1
- package/lib/modularDrawer/utils/groupCurrenciesByAsset.js +0 -21
- package/lib/modularDrawer/utils/groupCurrenciesByAsset.js.map +0 -1
- package/lib-es/device/use-cases/getDeviceHasBattery.d.ts +0 -2
- package/lib-es/device/use-cases/getDeviceHasBattery.d.ts.map +0 -1
- package/lib-es/device/use-cases/getDeviceHasBattery.js +0 -2
- package/lib-es/device/use-cases/getDeviceHasBattery.js.map +0 -1
- package/lib-es/e2e/deviceInteraction/DeviceController.d.ts +0 -41
- package/lib-es/e2e/deviceInteraction/DeviceController.d.ts.map +0 -1
- package/lib-es/e2e/deviceInteraction/DeviceController.js +0 -63
- package/lib-es/e2e/deviceInteraction/DeviceController.js.map +0 -1
- package/lib-es/e2e/enum/ReceiveFundsOptions.d.ts +0 -6
- package/lib-es/e2e/enum/ReceiveFundsOptions.d.ts.map +0 -1
- package/lib-es/e2e/enum/ReceiveFundsOptions.js +0 -5
- package/lib-es/e2e/enum/ReceiveFundsOptions.js.map +0 -1
- package/lib-es/families/canton/react.d.ts +0 -15
- package/lib-es/families/canton/react.d.ts.map +0 -1
- package/lib-es/families/canton/react.js +0 -10
- package/lib-es/families/canton/react.js.map +0 -1
- package/lib-es/modularDrawer/utils/groupCurrenciesByAsset.d.ts.map +0 -1
- package/lib-es/modularDrawer/utils/groupCurrenciesByAsset.js.map +0 -1
- package/src/device/use-cases/getDeviceHasBattery.ts +0 -1
- package/src/e2e/deviceInteraction/DeviceController.ts +0 -85
- package/src/e2e/enum/ReceiveFundsOptions.ts +0 -7
- package/src/families/canton/react.ts +0 -50
- package/src/modularDrawer/utils/__tests__/groupCurrenciesByAsset.test.ts +0 -88
package/src/deposit/type.ts
CHANGED
|
@@ -17,9 +17,30 @@ export type MappedAsset = {
|
|
|
17
17
|
ledgerCurrency?: CryptoOrTokenCurrency;
|
|
18
18
|
};
|
|
19
19
|
|
|
20
|
+
export type GroupedCurrency = {
|
|
21
|
+
providerId: string;
|
|
22
|
+
currenciesByNetwork: MappedAsset[];
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
export type CurrenciesByProviderId = {
|
|
26
|
+
currenciesByNetwork: CryptoOrTokenCurrency[];
|
|
27
|
+
providerId: string;
|
|
28
|
+
metaCurrencyId?: string;
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
export type GroupedCurrencies = {
|
|
32
|
+
currenciesByProvider: CurrenciesByProviderId[];
|
|
33
|
+
sortedCryptoCurrencies: CryptoOrTokenCurrency[];
|
|
34
|
+
};
|
|
35
|
+
|
|
20
36
|
export enum LoadingStatus {
|
|
21
37
|
Idle = "idle",
|
|
22
38
|
Pending = "pending",
|
|
23
39
|
Success = "success",
|
|
24
40
|
Error = "error",
|
|
25
41
|
}
|
|
42
|
+
|
|
43
|
+
export type LoadingBasedGroupedCurrencies = {
|
|
44
|
+
result: GroupedCurrencies;
|
|
45
|
+
loadingStatus: LoadingStatus;
|
|
46
|
+
};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { GroupedCurrencies, LoadingBasedGroupedCurrencies, LoadingStatus } from "./type";
|
|
2
|
+
import { CryptoOrTokenCurrency } from "@ledgerhq/types-cryptoassets";
|
|
3
|
+
import { useEffect, useMemo, useState } from "react";
|
|
4
|
+
import { isCurrencySupported, listSupportedCurrencies, listTokens } from "../currencies";
|
|
5
|
+
import { loadCurrenciesByProvider } from "./helper";
|
|
6
|
+
import { useAcceptedCurrency } from "../modularDrawer/hooks/useAcceptedCurrency";
|
|
7
|
+
|
|
8
|
+
// FIXME(LIVE-10505): bad performane & shared utility to move to coin-framework
|
|
9
|
+
const listSupportedTokens = () => listTokens().filter(t => isCurrencySupported(t.parentCurrency));
|
|
10
|
+
|
|
11
|
+
const initialResult: GroupedCurrencies = {
|
|
12
|
+
sortedCryptoCurrencies: [],
|
|
13
|
+
currenciesByProvider: [],
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export const useGroupedCurrenciesByProvider = (
|
|
17
|
+
withLoading?: boolean,
|
|
18
|
+
): GroupedCurrencies | LoadingBasedGroupedCurrencies => {
|
|
19
|
+
const [result, setResult] = useState(initialResult);
|
|
20
|
+
const isAcceptedCurrency = useAcceptedCurrency();
|
|
21
|
+
|
|
22
|
+
const [loadingStatus, setLoadingStatus] = useState<LoadingStatus>(LoadingStatus.Idle);
|
|
23
|
+
const coinsAndTokensSupported = useMemo(
|
|
24
|
+
() =>
|
|
25
|
+
(listSupportedCurrencies() as CryptoOrTokenCurrency[])
|
|
26
|
+
.concat(listSupportedTokens())
|
|
27
|
+
.filter(isAcceptedCurrency),
|
|
28
|
+
[isAcceptedCurrency],
|
|
29
|
+
);
|
|
30
|
+
|
|
31
|
+
// Get mapped assets filtered by supported & sorted currencies, grouped by provider id
|
|
32
|
+
useEffect(() => {
|
|
33
|
+
if (withLoading) {
|
|
34
|
+
setLoadingStatus(LoadingStatus.Idle);
|
|
35
|
+
loadCurrenciesByProvider(coinsAndTokensSupported)
|
|
36
|
+
.then(data => {
|
|
37
|
+
setResult(data);
|
|
38
|
+
setLoadingStatus(LoadingStatus.Success);
|
|
39
|
+
})
|
|
40
|
+
.catch(() => setLoadingStatus(LoadingStatus.Error));
|
|
41
|
+
} else {
|
|
42
|
+
loadCurrenciesByProvider(coinsAndTokensSupported).then(setResult);
|
|
43
|
+
}
|
|
44
|
+
}, [coinsAndTokensSupported, withLoading]);
|
|
45
|
+
return withLoading ? { result, loadingStatus } : result;
|
|
46
|
+
};
|
|
@@ -6,9 +6,7 @@ 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(() =>
|
|
10
|
-
useBatteryStatuses({ deviceName: null, statuses: [], enabled: true }),
|
|
11
|
-
);
|
|
9
|
+
const { result } = renderHook(() => useBatteryStatuses({ deviceName: null, statuses: [] }));
|
|
12
10
|
expect(() => result.current.cancelRequest()).not.toThrow();
|
|
13
11
|
});
|
|
14
12
|
});
|
|
@@ -13,7 +13,6 @@ export type UseBatteryStatusesArgs = {
|
|
|
13
13
|
deviceId?: string;
|
|
14
14
|
deviceName: string | null;
|
|
15
15
|
statuses: BatteryStatusTypes[];
|
|
16
|
-
enabled: boolean;
|
|
17
16
|
};
|
|
18
17
|
|
|
19
18
|
/**
|
|
@@ -32,7 +31,6 @@ export const useBatteryStatuses = ({
|
|
|
32
31
|
deviceId,
|
|
33
32
|
deviceName,
|
|
34
33
|
statuses,
|
|
35
|
-
enabled,
|
|
36
34
|
}: UseBatteryStatusesArgs): {
|
|
37
35
|
batteryStatusesState: GetBatteryStatusesActionState;
|
|
38
36
|
requestCompleted: boolean;
|
|
@@ -54,7 +52,6 @@ export const useBatteryStatuses = ({
|
|
|
54
52
|
const lowBatteryPercentage = useEnv("LOW_BATTERY_PERCENTAGE");
|
|
55
53
|
|
|
56
54
|
useEffect(() => {
|
|
57
|
-
if (!enabled) return;
|
|
58
55
|
if (nonce > 0 && deviceId) {
|
|
59
56
|
const sub = getBatteryStatusesAction({
|
|
60
57
|
deviceId,
|
|
@@ -93,7 +90,7 @@ export const useBatteryStatuses = ({
|
|
|
93
90
|
sub.unsubscribe();
|
|
94
91
|
};
|
|
95
92
|
}
|
|
96
|
-
}, [deviceId, deviceName, lowBatteryPercentage, statuses, nonce
|
|
93
|
+
}, [deviceId, deviceName, lowBatteryPercentage, statuses, nonce]);
|
|
97
94
|
|
|
98
95
|
const triggerRequest = useCallback(() => {
|
|
99
96
|
setRequestCompleted(false);
|
|
@@ -1,11 +1,9 @@
|
|
|
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";
|
|
5
4
|
import { concatMap } from "rxjs/operators";
|
|
6
5
|
import { TransportRef } from "../transports/core";
|
|
7
6
|
import { aTransportRefBuilder } from "../mocks/aTransportRef";
|
|
8
|
-
import { isDmkError } from "./core";
|
|
9
7
|
|
|
10
8
|
// Needs to mock the timer from rxjs used in the retry mechanism
|
|
11
9
|
jest.mock("rxjs", () => {
|
|
@@ -332,22 +330,4 @@ describe("retryOnErrorsCommandWrapper", () => {
|
|
|
332
330
|
});
|
|
333
331
|
});
|
|
334
332
|
});
|
|
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
|
-
});
|
|
353
333
|
});
|
|
@@ -79,8 +79,7 @@ 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:
|
|
83
|
-
!!error && typeof error === "object" && error !== null && "_tag" in error;
|
|
82
|
+
export const isDmkError = (error: any): error is DmkError => error && "_tag" in error;
|
|
84
83
|
|
|
85
84
|
/**
|
|
86
85
|
* Calls a command and retries it on given errors. The transport is refreshed before each retry.
|
|
@@ -11,7 +11,6 @@ import { map, switchMap } from "rxjs/operators";
|
|
|
11
11
|
import { SharedTaskEvent, retryOnErrorsCommandWrapper, sharedLogicTaskWrapper } from "./core";
|
|
12
12
|
import { quitApp } from "../commands/quitApp";
|
|
13
13
|
import { withTransport } from "../transports/core";
|
|
14
|
-
import { SendApduEmptyResponseError } from "@ledgerhq/device-management-kit";
|
|
15
14
|
|
|
16
15
|
const ManagerAllowedFlag = 0x08;
|
|
17
16
|
const PinValidatedFlag = 0x80;
|
|
@@ -47,7 +46,6 @@ export function internalGetDeviceInfoTask({
|
|
|
47
46
|
return retryOnErrorsCommandWrapper({
|
|
48
47
|
command: getVersion,
|
|
49
48
|
allowedErrors: [{ maxRetries: 3, errorClass: DisconnectedDevice }],
|
|
50
|
-
allowedDmkErrors: [new SendApduEmptyResponseError()],
|
|
51
49
|
})(transportRef, {});
|
|
52
50
|
}),
|
|
53
51
|
map(value => {
|
|
@@ -2,11 +2,11 @@ import type { DeviceId, DeviceInfo, FirmwareUpdateContext } from "@ledgerhq/type
|
|
|
2
2
|
|
|
3
3
|
import { quitApp } from "../commands/quitApp";
|
|
4
4
|
|
|
5
|
+
import { withDevice } from "../../hw/deviceAccess";
|
|
5
6
|
import { from, Observable, of } from "rxjs";
|
|
6
7
|
import { switchMap, catchError } from "rxjs/operators";
|
|
7
8
|
import { SharedTaskEvent, sharedLogicTaskWrapper } from "./core";
|
|
8
9
|
import { getLatestFirmwareForDeviceUseCase } from "../../device/use-cases/getLatestFirmwareForDeviceUseCase";
|
|
9
|
-
import { withTransport } from "../transports/core";
|
|
10
10
|
|
|
11
11
|
export type GetLatestFirmwareTaskArgs = {
|
|
12
12
|
deviceId: DeviceId;
|
|
@@ -32,11 +32,11 @@ function internalGetLatestFirmwareTask({
|
|
|
32
32
|
deviceInfo,
|
|
33
33
|
}: GetLatestFirmwareTaskArgs): Observable<GetLatestFirmwareTaskEvent> {
|
|
34
34
|
return new Observable(subscriber => {
|
|
35
|
-
return
|
|
35
|
+
return withDevice(
|
|
36
36
|
deviceId,
|
|
37
37
|
deviceName ? { matchDeviceByName: deviceName } : undefined,
|
|
38
|
-
)(
|
|
39
|
-
quitApp(
|
|
38
|
+
)(transport =>
|
|
39
|
+
quitApp(transport).pipe(
|
|
40
40
|
switchMap(() => {
|
|
41
41
|
return from(getLatestFirmwareForDeviceUseCase(deviceInfo));
|
|
42
42
|
}),
|
|
@@ -36,7 +36,6 @@ import { parseDeviceInfo } from "./getDeviceInfo";
|
|
|
36
36
|
import {
|
|
37
37
|
DeviceDisconnectedBeforeSendingApdu,
|
|
38
38
|
DeviceDisconnectedWhileSendingError,
|
|
39
|
-
SendApduEmptyResponseError,
|
|
40
39
|
} from "@ledgerhq/device-management-kit";
|
|
41
40
|
|
|
42
41
|
export type UpdateFirmwareTaskArgs = {
|
|
@@ -80,7 +79,6 @@ const waitForGetVersion = retryOnErrorsCommandWrapper({
|
|
|
80
79
|
allowedDmkErrors: [
|
|
81
80
|
new DeviceDisconnectedWhileSendingError(),
|
|
82
81
|
new DeviceDisconnectedBeforeSendingApdu(),
|
|
83
|
-
new SendApduEmptyResponseError(),
|
|
84
82
|
],
|
|
85
83
|
});
|
|
86
84
|
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { getEnv } from "@ledgerhq/live-env";
|
|
2
|
+
import { getSpeculosAddress, retryAxiosRequest } from "../speculos";
|
|
3
|
+
import axios from "axios";
|
|
4
|
+
|
|
5
|
+
export async function pressBoth() {
|
|
6
|
+
const speculosApiPort = getEnv("SPECULOS_API_PORT");
|
|
7
|
+
const speculosAddress = getSpeculosAddress();
|
|
8
|
+
await retryAxiosRequest(() =>
|
|
9
|
+
axios.post(`${speculosAddress}:${speculosApiPort}/button/both`, {
|
|
10
|
+
action: "press-and-release",
|
|
11
|
+
}),
|
|
12
|
+
);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export async function pressRightButton(): Promise<void> {
|
|
16
|
+
const speculosApiPort = getEnv("SPECULOS_API_PORT");
|
|
17
|
+
const speculosAddress = getSpeculosAddress();
|
|
18
|
+
await retryAxiosRequest(() =>
|
|
19
|
+
axios.post(`${speculosAddress}:${speculosApiPort}/button/right`, {
|
|
20
|
+
action: "press-and-release",
|
|
21
|
+
}),
|
|
22
|
+
);
|
|
23
|
+
}
|
package/src/e2e/enum/Account.ts
CHANGED
|
@@ -108,6 +108,12 @@ 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
|
+
);
|
|
111
117
|
|
|
112
118
|
static readonly BTC_LEGACY_1 = new Account(
|
|
113
119
|
Currency.BTC,
|
package/src/e2e/enum/Currency.ts
CHANGED
|
@@ -72,7 +72,7 @@ export class Currency {
|
|
|
72
72
|
);
|
|
73
73
|
static readonly SOL = new Currency("Solana", "SOL", "solana", AppInfos.SOLANA, [Network.SOLANA]);
|
|
74
74
|
|
|
75
|
-
static readonly DOT = new Currency("Polkadot", "DOT", "
|
|
75
|
+
static readonly DOT = new Currency("Polkadot", "DOT", "polkadot", AppInfos.POLKADOT, [
|
|
76
76
|
Network.POLKADOT,
|
|
77
77
|
]);
|
|
78
78
|
static readonly TRX = new Currency("Tron", "TRX", "tron", AppInfos.TRON, [Network.TRON]);
|
|
@@ -156,6 +156,10 @@ 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
|
+
]);
|
|
159
163
|
static readonly POL_DAI = new Currency(
|
|
160
164
|
"(PoS) Dai Stablecoin",
|
|
161
165
|
"DAI",
|
|
@@ -200,7 +204,7 @@ export class Currency {
|
|
|
200
204
|
static readonly SUI = new Currency("Sui", "SUI", "sui", AppInfos.SUI, [Network.SUI]);
|
|
201
205
|
|
|
202
206
|
static readonly SUI_USDC = new Currency(
|
|
203
|
-
"
|
|
207
|
+
"USDC",
|
|
204
208
|
"USDC",
|
|
205
209
|
"sui/coin/usdc_0xdba34672e30cb065b1f93e3ab55318768fd6fef66c15942c9f7cb846e2f900e7::usdc::usdc",
|
|
206
210
|
AppInfos.SUI,
|
|
@@ -2,26 +2,19 @@ import expect from "expect";
|
|
|
2
2
|
import { Transaction } from "../models/Transaction";
|
|
3
3
|
import { containsSubstringInEvent, getSendEvents } from "../speculos";
|
|
4
4
|
import { isTouchDevice } from "../speculosAppVersion";
|
|
5
|
+
import { pressBoth } from "../deviceInteraction/ButtonDeviceSimulator";
|
|
5
6
|
import { DeviceLabels } from "../enum/DeviceLabels";
|
|
6
7
|
import { longPressAndRelease } from "../deviceInteraction/TouchDeviceSimulator";
|
|
7
|
-
import { withDeviceController } from "../deviceInteraction/DeviceController";
|
|
8
8
|
|
|
9
|
-
export
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
if (isTouchDevice()) {
|
|
22
|
-
await longPressAndRelease(DeviceLabels.HOLD_TO_SIGN, 3);
|
|
23
|
-
} else {
|
|
24
|
-
await buttons.both();
|
|
25
|
-
}
|
|
26
|
-
},
|
|
27
|
-
);
|
|
9
|
+
export async function sendAlgorand(tx: Transaction) {
|
|
10
|
+
const events = await getSendEvents(tx);
|
|
11
|
+
const isAmountCorrect = containsSubstringInEvent(tx.amount, events);
|
|
12
|
+
expect(isAmountCorrect).toBeTruthy();
|
|
13
|
+
const isAddressCorrect = containsSubstringInEvent(tx.accountToCredit.address, events);
|
|
14
|
+
expect(isAddressCorrect).toBeTruthy();
|
|
15
|
+
if (isTouchDevice()) {
|
|
16
|
+
await longPressAndRelease(DeviceLabels.HOLD_TO_SIGN, 3);
|
|
17
|
+
} else {
|
|
18
|
+
await pressBoth();
|
|
19
|
+
}
|
|
20
|
+
}
|
|
@@ -2,36 +2,24 @@ import expect from "expect";
|
|
|
2
2
|
import { Transaction } from "../models/Transaction";
|
|
3
3
|
import { waitFor, pressUntilTextFound, containsSubstringInEvent, getSendEvents } from "../speculos";
|
|
4
4
|
import { isTouchDevice } from "../speculosAppVersion";
|
|
5
|
+
import { pressBoth } from "../deviceInteraction/ButtonDeviceSimulator";
|
|
5
6
|
import { DeviceLabels } from "../enum/DeviceLabels";
|
|
6
7
|
import { Delegate } from "../models/Delegate";
|
|
7
8
|
import { longPressAndRelease } from "../deviceInteraction/TouchDeviceSimulator";
|
|
8
|
-
import { withDeviceController } from "../deviceInteraction/DeviceController";
|
|
9
9
|
|
|
10
|
-
export
|
|
11
|
-
(
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
export async function sendAptos(tx: Transaction) {
|
|
11
|
+
await getSendEvents(tx);
|
|
12
|
+
if (isTouchDevice()) {
|
|
13
|
+
await longPressAndRelease(DeviceLabels.HOLD_TO_SIGN, 3);
|
|
14
|
+
} else {
|
|
15
|
+
await pressBoth();
|
|
16
|
+
}
|
|
17
|
+
}
|
|
14
18
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
},
|
|
23
|
-
);
|
|
24
|
-
|
|
25
|
-
export const delegateAptos = withDeviceController(
|
|
26
|
-
({ getButtonsController }) =>
|
|
27
|
-
async (delegatingAccount: Delegate) => {
|
|
28
|
-
const buttons = getButtonsController();
|
|
29
|
-
|
|
30
|
-
await waitFor(DeviceLabels.REVIEW_OPERATION);
|
|
31
|
-
const events = await pressUntilTextFound(DeviceLabels.APPROVE);
|
|
32
|
-
const isAmountCorrect = containsSubstringInEvent(delegatingAccount.amount, events);
|
|
33
|
-
expect(isAmountCorrect).toBeTruthy();
|
|
34
|
-
|
|
35
|
-
await buttons.both();
|
|
36
|
-
},
|
|
37
|
-
);
|
|
19
|
+
export async function delegateAptos(delegatingAccount: Delegate) {
|
|
20
|
+
await waitFor(DeviceLabels.REVIEW_OPERATION);
|
|
21
|
+
const events = await pressUntilTextFound(DeviceLabels.APPROVE);
|
|
22
|
+
const isAmountCorrect = containsSubstringInEvent(delegatingAccount.amount, events);
|
|
23
|
+
expect(isAmountCorrect).toBeTruthy();
|
|
24
|
+
await pressBoth();
|
|
25
|
+
}
|
|
@@ -2,63 +2,49 @@ import expect from "expect";
|
|
|
2
2
|
import { Transaction } from "../models/Transaction";
|
|
3
3
|
import { waitFor, containsSubstringInEvent, pressUntilTextFound, getSendEvents } from "../speculos";
|
|
4
4
|
import { getSpeculosModel, isTouchDevice } from "../speculosAppVersion";
|
|
5
|
+
import { pressBoth } from "../deviceInteraction/ButtonDeviceSimulator";
|
|
5
6
|
import { DeviceLabels } from "../enum/DeviceLabels";
|
|
6
7
|
import invariant from "invariant";
|
|
7
8
|
import { DeviceModelId } from "@ledgerhq/types-devices";
|
|
8
9
|
import { longPressAndRelease } from "../deviceInteraction/TouchDeviceSimulator";
|
|
9
|
-
import { withDeviceController } from "../deviceInteraction/DeviceController";
|
|
10
10
|
|
|
11
|
-
export
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
11
|
+
export async function sendBTCBasedCoin(tx: Transaction) {
|
|
12
|
+
const events = await getSendEvents(tx);
|
|
13
|
+
const isAmountCorrect = containsSubstringInEvent(tx.amount, events);
|
|
14
|
+
expect(isAmountCorrect).toBeTruthy();
|
|
15
|
+
const isAddressCorrect = containsSubstringInEvent(tx.accountToCredit.address, events);
|
|
16
|
+
expect(isAddressCorrect).toBeTruthy();
|
|
17
|
+
if (isTouchDevice()) {
|
|
18
|
+
await longPressAndRelease(DeviceLabels.HOLD_TO_SIGN, 3);
|
|
19
|
+
} else {
|
|
20
|
+
await pressBoth();
|
|
21
|
+
await waitFor(DeviceLabels.CONFIRM);
|
|
22
|
+
await pressUntilTextFound(DeviceLabels.ACCEPT);
|
|
23
|
+
await pressBoth();
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export async function sendBTC(tx: Transaction) {
|
|
28
|
+
const speculosDevice = getSpeculosModel();
|
|
29
|
+
try {
|
|
30
|
+
const events = await getSendEvents(tx);
|
|
31
|
+
const isAmountCorrect = containsSubstringInEvent(tx.amount, events);
|
|
32
|
+
expect(isAmountCorrect).toBeTruthy();
|
|
33
|
+
const isAddressCorrect = containsSubstringInEvent(tx.accountToCredit.address, events);
|
|
34
|
+
expect(isAddressCorrect).toBeTruthy();
|
|
35
|
+
if (isTouchDevice()) {
|
|
36
|
+
await longPressAndRelease(DeviceLabels.HOLD_TO_SIGN, 3);
|
|
37
|
+
} else {
|
|
38
|
+
await pressBoth();
|
|
39
|
+
if (speculosDevice === DeviceModelId.nanoS) {
|
|
40
|
+
await pressUntilTextFound(DeviceLabels.SIGN);
|
|
41
|
+
await pressBoth();
|
|
42
|
+
await waitFor(DeviceLabels.BITCOIN_IS_READY);
|
|
25
43
|
} else {
|
|
26
|
-
await
|
|
27
|
-
await waitFor(DeviceLabels.CONFIRM);
|
|
28
|
-
await pressUntilTextFound(DeviceLabels.ACCEPT);
|
|
29
|
-
await buttons.both();
|
|
30
|
-
}
|
|
31
|
-
},
|
|
32
|
-
);
|
|
33
|
-
|
|
34
|
-
export const sendBTC = withDeviceController(
|
|
35
|
-
({ getButtonsController }) =>
|
|
36
|
-
async (tx: Transaction) => {
|
|
37
|
-
const buttons = getButtonsController();
|
|
38
|
-
const speculosDevice = getSpeculosModel();
|
|
39
|
-
|
|
40
|
-
try {
|
|
41
|
-
const events = await getSendEvents(tx);
|
|
42
|
-
const isAmountCorrect = containsSubstringInEvent(tx.amount, events);
|
|
43
|
-
expect(isAmountCorrect).toBeTruthy();
|
|
44
|
-
|
|
45
|
-
const isAddressCorrect = containsSubstringInEvent(tx.accountToCredit.address, events);
|
|
46
|
-
expect(isAddressCorrect).toBeTruthy();
|
|
47
|
-
|
|
48
|
-
if (isTouchDevice()) {
|
|
49
|
-
await longPressAndRelease(DeviceLabels.HOLD_TO_SIGN, 3);
|
|
50
|
-
} else {
|
|
51
|
-
await buttons.both();
|
|
52
|
-
if (speculosDevice === DeviceModelId.nanoS) {
|
|
53
|
-
await pressUntilTextFound(DeviceLabels.SIGN);
|
|
54
|
-
await buttons.both();
|
|
55
|
-
await waitFor(DeviceLabels.BITCOIN_IS_READY);
|
|
56
|
-
} else {
|
|
57
|
-
await waitFor(DeviceLabels.TRANSACTION_SIGNED);
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
} catch (e) {
|
|
61
|
-
invariant(false, `Error while sending BTC transaction: ${e}`);
|
|
44
|
+
await waitFor(DeviceLabels.TRANSACTION_SIGNED);
|
|
62
45
|
}
|
|
63
|
-
}
|
|
64
|
-
)
|
|
46
|
+
}
|
|
47
|
+
} catch (e) {
|
|
48
|
+
invariant(false, `Error while sending BTC transaction: ${e}`);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import expect from "expect";
|
|
2
2
|
import { Transaction } from "../models/Transaction";
|
|
3
3
|
import { pressUntilTextFound, containsSubstringInEvent, waitFor } from "../speculos";
|
|
4
|
-
import { getSpeculosModel
|
|
4
|
+
import { getSpeculosModel } from "../speculosAppVersion";
|
|
5
|
+
import { pressBoth, pressRightButton } from "../deviceInteraction/ButtonDeviceSimulator";
|
|
5
6
|
import {
|
|
6
7
|
pressAndRelease,
|
|
7
8
|
longPressAndRelease,
|
|
@@ -9,7 +10,7 @@ import {
|
|
|
9
10
|
} from "../deviceInteraction/TouchDeviceSimulator";
|
|
10
11
|
import { DeviceLabels } from "../enum/DeviceLabels";
|
|
11
12
|
import { DeviceModelId } from "@ledgerhq/types-devices";
|
|
12
|
-
import {
|
|
13
|
+
import { isTouchDevice } from "../speculosAppVersion";
|
|
13
14
|
|
|
14
15
|
type ActionType = "both" | "right" | "tap" | "swipe" | "confirm" | "hold";
|
|
15
16
|
|
|
@@ -31,40 +32,32 @@ async function sendCardanoTouchDevices(tx: Transaction) {
|
|
|
31
32
|
await longPressAndRelease(DeviceLabels.HOLD_TO_SIGN, 3);
|
|
32
33
|
}
|
|
33
34
|
|
|
34
|
-
|
|
35
|
-
(
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
await waitFor(DeviceLabels.CONFIRM);
|
|
47
|
-
await buttons.right();
|
|
48
|
-
},
|
|
49
|
-
);
|
|
35
|
+
async function sendCardanoNanoS(_tx: Transaction) {
|
|
36
|
+
await waitFor(DeviceLabels.NEW_ORDINARY);
|
|
37
|
+
await pressRightButton();
|
|
38
|
+
await waitFor(DeviceLabels.SEND_TO_ADDRESS);
|
|
39
|
+
await pressBoth();
|
|
40
|
+
await pressUntilTextFound(DeviceLabels.SEND);
|
|
41
|
+
await pressBoth();
|
|
42
|
+
await waitFor(DeviceLabels.TRANSACTION_FEE);
|
|
43
|
+
await pressBoth();
|
|
44
|
+
await waitFor(DeviceLabels.CONFIRM);
|
|
45
|
+
await pressRightButton();
|
|
46
|
+
}
|
|
50
47
|
|
|
51
|
-
|
|
52
|
-
(
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
await waitFor(DeviceLabels.CONFIRM);
|
|
65
|
-
await buttons.both();
|
|
66
|
-
},
|
|
67
|
-
);
|
|
48
|
+
async function sendCardanoButtonDevice(tx: Transaction) {
|
|
49
|
+
await waitFor(DeviceLabels.NEW_ORDINARY);
|
|
50
|
+
await pressBoth();
|
|
51
|
+
await pressUntilTextFound(DeviceLabels.SEND_TO_ADDRESS_2);
|
|
52
|
+
await pressBoth();
|
|
53
|
+
const events = await pressUntilTextFound(DeviceLabels.SEND);
|
|
54
|
+
validateTransactionData(tx, events);
|
|
55
|
+
await pressBoth();
|
|
56
|
+
await waitFor(DeviceLabels.TRANSACTION_FEE);
|
|
57
|
+
await pressBoth();
|
|
58
|
+
await waitFor(DeviceLabels.CONFIRM);
|
|
59
|
+
await pressBoth();
|
|
60
|
+
}
|
|
68
61
|
|
|
69
62
|
export async function sendCardano(tx: Transaction) {
|
|
70
63
|
const speculosModel = getSpeculosModel();
|
|
@@ -134,18 +127,14 @@ async function delegateTouchDevicesAction(label: DeviceLabels) {
|
|
|
134
127
|
}
|
|
135
128
|
}
|
|
136
129
|
|
|
137
|
-
|
|
138
|
-
(
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
await buttons.right();
|
|
146
|
-
}
|
|
147
|
-
},
|
|
148
|
-
);
|
|
130
|
+
async function delegateNanoAction(label: DeviceLabels, action: ActionType) {
|
|
131
|
+
await waitFor(label);
|
|
132
|
+
if (action === "both") {
|
|
133
|
+
await pressBoth();
|
|
134
|
+
} else {
|
|
135
|
+
await pressRightButton();
|
|
136
|
+
}
|
|
137
|
+
}
|
|
149
138
|
|
|
150
139
|
async function executeDelegateStep(label: DeviceLabels, action: ActionType) {
|
|
151
140
|
try {
|
package/src/e2e/families/celo.ts
CHANGED
|
@@ -2,24 +2,18 @@ import { containsSubstringInEvent, getDelegateEvents, pressUntilTextFound } from
|
|
|
2
2
|
import { isTouchDevice } from "../speculosAppVersion";
|
|
3
3
|
import { Delegate } from "../models/Delegate";
|
|
4
4
|
import expect from "expect";
|
|
5
|
+
import { pressBoth } from "../deviceInteraction/ButtonDeviceSimulator";
|
|
5
6
|
import { longPressAndRelease } from "../deviceInteraction/TouchDeviceSimulator";
|
|
6
7
|
import { DeviceLabels } from "../enum/DeviceLabels";
|
|
7
|
-
import { withDeviceController } from "../deviceInteraction/DeviceController";
|
|
8
8
|
|
|
9
|
-
export
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
await longPressAndRelease(DeviceLabels.HOLD_TO_SIGN, 3);
|
|
21
|
-
} else {
|
|
22
|
-
await buttons.both();
|
|
23
|
-
}
|
|
24
|
-
},
|
|
25
|
-
);
|
|
9
|
+
export async function delegateCelo(delegatingAccount: Delegate) {
|
|
10
|
+
const events = await getDelegateEvents(delegatingAccount);
|
|
11
|
+
const isAmountCorrect = containsSubstringInEvent(delegatingAccount.amount, events);
|
|
12
|
+
expect(isAmountCorrect).toBeTruthy();
|
|
13
|
+
if (isTouchDevice()) {
|
|
14
|
+
await pressUntilTextFound(DeviceLabels.HOLD_TO_SIGN);
|
|
15
|
+
await longPressAndRelease(DeviceLabels.HOLD_TO_SIGN, 3);
|
|
16
|
+
} else {
|
|
17
|
+
await pressBoth();
|
|
18
|
+
}
|
|
19
|
+
}
|