@ledgerhq/live-common 34.52.0-nightly.1 → 34.52.0-nightly.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/__tests__/test-helpers/environment.js +2 -0
- package/lib/__tests__/test-helpers/environment.js.map +1 -1
- package/lib/apps/config.js +1 -1
- package/lib/bridge/generic-alpaca/alpaca/network/network-alpaca.d.ts +2 -1
- package/lib/bridge/generic-alpaca/alpaca/network/network-alpaca.d.ts.map +1 -1
- package/lib/bridge/generic-alpaca/alpaca/network/network-alpaca.js +3 -0
- package/lib/bridge/generic-alpaca/alpaca/network/network-alpaca.js.map +1 -1
- package/lib/bridge/generic-alpaca/getAccountShape.d.ts.map +1 -1
- package/lib/bridge/generic-alpaca/getAccountShape.js +7 -1
- package/lib/bridge/generic-alpaca/getAccountShape.js.map +1 -1
- package/lib/bridge/generic-alpaca/utils.d.ts.map +1 -1
- package/lib/bridge/generic-alpaca/utils.js +5 -4
- package/lib/bridge/generic-alpaca/utils.js.map +1 -1
- package/lib/dada-client/hooks/useAssetsData.d.ts +4 -10
- package/lib/dada-client/hooks/useAssetsData.d.ts.map +1 -1
- package/lib/dada-client/hooks/useAssetsData.js +2 -1
- package/lib/dada-client/hooks/useAssetsData.js.map +1 -1
- package/lib/dada-client/hooks/useInterestRatesByCurrencies.d.ts +5 -1
- package/lib/dada-client/hooks/useInterestRatesByCurrencies.d.ts.map +1 -1
- package/lib/dada-client/hooks/useMarketByCurrencies.d.ts +4 -1
- package/lib/dada-client/hooks/useMarketByCurrencies.d.ts.map +1 -1
- package/lib/dada-client/state-manager/api.d.ts.map +1 -1
- package/lib/dada-client/state-manager/api.js +3 -0
- package/lib/dada-client/state-manager/api.js.map +1 -1
- package/lib/dada-client/state-manager/types.d.ts +1 -0
- package/lib/dada-client/state-manager/types.d.ts.map +1 -1
- package/lib/deposit/helper.d.ts.map +1 -1
- package/lib/deposit/helper.js +54 -1
- package/lib/deposit/helper.js.map +1 -1
- package/lib/e2e/data/deviceLabelsData.d.ts.map +1 -1
- package/lib/e2e/data/deviceLabelsData.js +37 -33
- package/lib/e2e/data/deviceLabelsData.js.map +1 -1
- package/lib/e2e/deviceInteraction/TouchDeviceSimulator.d.ts.map +1 -1
- package/lib/e2e/deviceInteraction/TouchDeviceSimulator.js +13 -5
- package/lib/e2e/deviceInteraction/TouchDeviceSimulator.js.map +1 -1
- package/lib/e2e/enum/Account.d.ts +0 -1
- package/lib/e2e/enum/Account.d.ts.map +1 -1
- package/lib/e2e/enum/Account.js +0 -1
- package/lib/e2e/enum/Account.js.map +1 -1
- package/lib/e2e/enum/Currency.d.ts +0 -1
- package/lib/e2e/enum/Currency.d.ts.map +1 -1
- package/lib/e2e/enum/Currency.js +0 -1
- package/lib/e2e/enum/Currency.js.map +1 -1
- package/lib/e2e/enum/Device.d.ts +1 -0
- package/lib/e2e/enum/Device.d.ts.map +1 -1
- package/lib/e2e/enum/Device.js +1 -0
- package/lib/e2e/enum/Device.js.map +1 -1
- package/lib/e2e/enum/DeviceLabels.d.ts +2 -0
- package/lib/e2e/enum/DeviceLabels.d.ts.map +1 -1
- package/lib/e2e/enum/DeviceLabels.js +2 -0
- package/lib/e2e/enum/DeviceLabels.js.map +1 -1
- package/lib/e2e/families/bitcoin.js +1 -1
- package/lib/e2e/families/bitcoin.js.map +1 -1
- package/lib/e2e/families/cardano.d.ts.map +1 -1
- package/lib/e2e/families/cardano.js +12 -11
- package/lib/e2e/families/cardano.js.map +1 -1
- package/lib/e2e/families/evm.d.ts.map +1 -1
- package/lib/e2e/families/evm.js +4 -3
- package/lib/e2e/families/evm.js.map +1 -1
- package/lib/e2e/families/solana.d.ts.map +1 -1
- package/lib/e2e/families/solana.js +1 -1
- package/lib/e2e/families/solana.js.map +1 -1
- package/lib/e2e/index.d.ts +8 -0
- package/lib/e2e/index.d.ts.map +1 -1
- package/lib/e2e/speculos.d.ts +2 -0
- package/lib/e2e/speculos.d.ts.map +1 -1
- package/lib/e2e/speculos.js +22 -17
- package/lib/e2e/speculos.js.map +1 -1
- package/lib/e2e/speculosAppVersion.d.ts.map +1 -1
- package/lib/e2e/speculosAppVersion.js +5 -2
- package/lib/e2e/speculosAppVersion.js.map +1 -1
- package/lib/e2e/speculosCI.d.ts.map +1 -1
- package/lib/e2e/speculosCI.js +4 -0
- package/lib/e2e/speculosCI.js.map +1 -1
- package/lib/env.react.d.ts +1 -1
- package/lib/env.react.d.ts.map +1 -1
- package/lib/exchange/swap/completeExchange.d.ts.map +1 -1
- package/lib/exchange/swap/completeExchange.js +13 -0
- package/lib/exchange/swap/completeExchange.js.map +1 -1
- package/lib/exchange/swap/getIncompatibleCurrencyKeys.d.ts.map +1 -1
- package/lib/exchange/swap/getIncompatibleCurrencyKeys.js +4 -0
- package/lib/exchange/swap/getIncompatibleCurrencyKeys.js.map +1 -1
- package/lib/exchange/swap/transactionStrategies.d.ts +3 -0
- package/lib/exchange/swap/transactionStrategies.d.ts.map +1 -1
- package/lib/exchange/swap/transactionStrategies.js +12 -2
- package/lib/exchange/swap/transactionStrategies.js.map +1 -1
- package/lib/families/canton/bridge/mock.d.ts +2 -2
- package/lib/families/canton/bridge/mock.d.ts.map +1 -1
- package/lib/families/canton/bridge/mock.js +3 -0
- package/lib/families/canton/bridge/mock.js.map +1 -1
- package/lib/families/canton/config.d.ts.map +1 -1
- package/lib/families/canton/config.js +3 -0
- package/lib/families/canton/config.js.map +1 -1
- package/lib/families/canton/setup.d.ts +3 -3
- package/lib/families/canton/setup.d.ts.map +1 -1
- package/lib/families/canton/setup.js.map +1 -1
- package/lib/families/evm/config.d.ts.map +1 -1
- package/lib/families/evm/config.js +18 -1
- package/lib/families/evm/config.js.map +1 -1
- package/lib/families/hedera/utils.d.ts +2 -0
- package/lib/families/hedera/utils.d.ts.map +1 -0
- package/lib/families/hedera/{logic.js → utils.js} +2 -2
- package/lib/families/hedera/utils.js.map +1 -0
- package/lib/families/sui/react.d.ts.map +1 -1
- package/lib/families/sui/react.js +1 -0
- package/lib/families/sui/react.js.map +1 -1
- package/lib/featureFlags/defaultFeatures.d.ts +3 -0
- package/lib/featureFlags/defaultFeatures.d.ts.map +1 -1
- package/lib/featureFlags/defaultFeatures.js +3 -0
- package/lib/featureFlags/defaultFeatures.js.map +1 -1
- package/lib/generated/bridge/js.d.ts +1 -1
- package/lib/generated/bridge/mock.d.ts +1 -1
- package/lib/generated/deviceTransactionConfig.d.ts +1 -1
- package/lib/generated/specs.d.ts +1 -0
- package/lib/generated/specs.d.ts.map +1 -1
- package/lib/hooks/useDeviceTransactionConfig.d.ts +19 -0
- package/lib/hooks/useDeviceTransactionConfig.d.ts.map +1 -0
- package/lib/hooks/useDeviceTransactionConfig.js +45 -0
- package/lib/hooks/useDeviceTransactionConfig.js.map +1 -0
- package/lib/load/speculos.d.ts.map +1 -1
- package/lib/load/speculos.js +1 -0
- package/lib/load/speculos.js.map +1 -1
- package/lib/modularDrawer/__mocks__/currencies.mock.d.ts +3 -0
- package/lib/modularDrawer/__mocks__/currencies.mock.d.ts.map +1 -1
- package/lib/modularDrawer/__mocks__/currencies.mock.js +40 -1
- package/lib/modularDrawer/__mocks__/currencies.mock.js.map +1 -1
- package/lib/modularDrawer/hooks/useCurrenciesUnderFeatureFlag.d.ts.map +1 -1
- package/lib/modularDrawer/hooks/useCurrenciesUnderFeatureFlag.js +7 -0
- package/lib/modularDrawer/hooks/useCurrenciesUnderFeatureFlag.js.map +1 -1
- package/lib/modularDrawer/utils/index.d.ts +3 -2
- package/lib/modularDrawer/utils/index.d.ts.map +1 -1
- package/lib/modularDrawer/utils/index.js +6 -10
- package/lib/modularDrawer/utils/index.js.map +1 -1
- package/lib/postOnboarding/hooks/useAutoDismissPostOnboardingEntryPoint.js.map +1 -1
- package/lib/postOnboarding/hooks/usePostOnboardingHubState.d.ts.map +1 -1
- package/lib/postOnboarding/hooks/usePostOnboardingHubState.js +7 -6
- package/lib/postOnboarding/hooks/usePostOnboardingHubState.js.map +1 -1
- package/lib/transaction/deviceTransactionConfig.d.ts +1 -1
- package/lib/transaction/deviceTransactionConfig.d.ts.map +1 -1
- package/lib/transaction/deviceTransactionConfig.js +2 -2
- package/lib/transaction/deviceTransactionConfig.js.map +1 -1
- package/lib-es/__tests__/test-helpers/environment.js +2 -0
- package/lib-es/__tests__/test-helpers/environment.js.map +1 -1
- package/lib-es/apps/config.js +1 -1
- package/lib-es/bridge/generic-alpaca/alpaca/network/network-alpaca.d.ts +2 -1
- package/lib-es/bridge/generic-alpaca/alpaca/network/network-alpaca.d.ts.map +1 -1
- package/lib-es/bridge/generic-alpaca/alpaca/network/network-alpaca.js +3 -0
- package/lib-es/bridge/generic-alpaca/alpaca/network/network-alpaca.js.map +1 -1
- package/lib-es/bridge/generic-alpaca/getAccountShape.d.ts.map +1 -1
- package/lib-es/bridge/generic-alpaca/getAccountShape.js +7 -1
- package/lib-es/bridge/generic-alpaca/getAccountShape.js.map +1 -1
- package/lib-es/bridge/generic-alpaca/utils.d.ts.map +1 -1
- package/lib-es/bridge/generic-alpaca/utils.js +5 -4
- package/lib-es/bridge/generic-alpaca/utils.js.map +1 -1
- package/lib-es/dada-client/hooks/useAssetsData.d.ts +4 -10
- package/lib-es/dada-client/hooks/useAssetsData.d.ts.map +1 -1
- package/lib-es/dada-client/hooks/useAssetsData.js +2 -1
- package/lib-es/dada-client/hooks/useAssetsData.js.map +1 -1
- package/lib-es/dada-client/hooks/useInterestRatesByCurrencies.d.ts +5 -1
- package/lib-es/dada-client/hooks/useInterestRatesByCurrencies.d.ts.map +1 -1
- package/lib-es/dada-client/hooks/useMarketByCurrencies.d.ts +4 -1
- package/lib-es/dada-client/hooks/useMarketByCurrencies.d.ts.map +1 -1
- package/lib-es/dada-client/state-manager/api.d.ts.map +1 -1
- package/lib-es/dada-client/state-manager/api.js +3 -0
- package/lib-es/dada-client/state-manager/api.js.map +1 -1
- package/lib-es/dada-client/state-manager/types.d.ts +1 -0
- package/lib-es/dada-client/state-manager/types.d.ts.map +1 -1
- package/lib-es/deposit/helper.d.ts.map +1 -1
- package/lib-es/deposit/helper.js +54 -1
- package/lib-es/deposit/helper.js.map +1 -1
- package/lib-es/e2e/data/deviceLabelsData.d.ts.map +1 -1
- package/lib-es/e2e/data/deviceLabelsData.js +37 -33
- package/lib-es/e2e/data/deviceLabelsData.js.map +1 -1
- package/lib-es/e2e/deviceInteraction/TouchDeviceSimulator.d.ts.map +1 -1
- package/lib-es/e2e/deviceInteraction/TouchDeviceSimulator.js +13 -5
- package/lib-es/e2e/deviceInteraction/TouchDeviceSimulator.js.map +1 -1
- package/lib-es/e2e/enum/Account.d.ts +0 -1
- package/lib-es/e2e/enum/Account.d.ts.map +1 -1
- package/lib-es/e2e/enum/Account.js +0 -1
- package/lib-es/e2e/enum/Account.js.map +1 -1
- package/lib-es/e2e/enum/Currency.d.ts +0 -1
- package/lib-es/e2e/enum/Currency.d.ts.map +1 -1
- package/lib-es/e2e/enum/Currency.js +0 -1
- package/lib-es/e2e/enum/Currency.js.map +1 -1
- package/lib-es/e2e/enum/Device.d.ts +1 -0
- package/lib-es/e2e/enum/Device.d.ts.map +1 -1
- package/lib-es/e2e/enum/Device.js +1 -0
- package/lib-es/e2e/enum/Device.js.map +1 -1
- package/lib-es/e2e/enum/DeviceLabels.d.ts +2 -0
- package/lib-es/e2e/enum/DeviceLabels.d.ts.map +1 -1
- package/lib-es/e2e/enum/DeviceLabels.js +2 -0
- package/lib-es/e2e/enum/DeviceLabels.js.map +1 -1
- package/lib-es/e2e/families/bitcoin.js +1 -1
- package/lib-es/e2e/families/bitcoin.js.map +1 -1
- package/lib-es/e2e/families/cardano.d.ts.map +1 -1
- package/lib-es/e2e/families/cardano.js +12 -11
- package/lib-es/e2e/families/cardano.js.map +1 -1
- package/lib-es/e2e/families/evm.d.ts.map +1 -1
- package/lib-es/e2e/families/evm.js +4 -3
- package/lib-es/e2e/families/evm.js.map +1 -1
- package/lib-es/e2e/families/solana.d.ts.map +1 -1
- package/lib-es/e2e/families/solana.js +1 -1
- package/lib-es/e2e/families/solana.js.map +1 -1
- package/lib-es/e2e/index.d.ts +8 -0
- package/lib-es/e2e/index.d.ts.map +1 -1
- package/lib-es/e2e/speculos.d.ts +2 -0
- package/lib-es/e2e/speculos.d.ts.map +1 -1
- package/lib-es/e2e/speculos.js +22 -17
- package/lib-es/e2e/speculos.js.map +1 -1
- package/lib-es/e2e/speculosAppVersion.d.ts.map +1 -1
- package/lib-es/e2e/speculosAppVersion.js +5 -2
- package/lib-es/e2e/speculosAppVersion.js.map +1 -1
- package/lib-es/e2e/speculosCI.d.ts.map +1 -1
- package/lib-es/e2e/speculosCI.js +4 -0
- package/lib-es/e2e/speculosCI.js.map +1 -1
- package/lib-es/env.react.d.ts +1 -1
- package/lib-es/env.react.d.ts.map +1 -1
- package/lib-es/exchange/swap/completeExchange.d.ts.map +1 -1
- package/lib-es/exchange/swap/completeExchange.js +13 -0
- package/lib-es/exchange/swap/completeExchange.js.map +1 -1
- package/lib-es/exchange/swap/getIncompatibleCurrencyKeys.d.ts.map +1 -1
- package/lib-es/exchange/swap/getIncompatibleCurrencyKeys.js +4 -0
- package/lib-es/exchange/swap/getIncompatibleCurrencyKeys.js.map +1 -1
- package/lib-es/exchange/swap/transactionStrategies.d.ts +3 -0
- package/lib-es/exchange/swap/transactionStrategies.d.ts.map +1 -1
- package/lib-es/exchange/swap/transactionStrategies.js +10 -1
- package/lib-es/exchange/swap/transactionStrategies.js.map +1 -1
- package/lib-es/families/canton/bridge/mock.d.ts +2 -2
- package/lib-es/families/canton/bridge/mock.d.ts.map +1 -1
- package/lib-es/families/canton/bridge/mock.js +3 -0
- package/lib-es/families/canton/bridge/mock.js.map +1 -1
- package/lib-es/families/canton/config.d.ts.map +1 -1
- package/lib-es/families/canton/config.js +3 -0
- package/lib-es/families/canton/config.js.map +1 -1
- package/lib-es/families/canton/setup.d.ts +3 -3
- package/lib-es/families/canton/setup.d.ts.map +1 -1
- package/lib-es/families/canton/setup.js.map +1 -1
- package/lib-es/families/evm/config.d.ts.map +1 -1
- package/lib-es/families/evm/config.js +18 -1
- package/lib-es/families/evm/config.js.map +1 -1
- package/lib-es/families/hedera/utils.d.ts +2 -0
- package/lib-es/families/hedera/utils.d.ts.map +1 -0
- package/lib-es/families/hedera/utils.js +3 -0
- package/lib-es/families/hedera/utils.js.map +1 -0
- package/lib-es/families/sui/react.d.ts.map +1 -1
- package/lib-es/families/sui/react.js +1 -0
- package/lib-es/families/sui/react.js.map +1 -1
- package/lib-es/featureFlags/defaultFeatures.d.ts +3 -0
- package/lib-es/featureFlags/defaultFeatures.d.ts.map +1 -1
- package/lib-es/featureFlags/defaultFeatures.js +3 -0
- package/lib-es/featureFlags/defaultFeatures.js.map +1 -1
- package/lib-es/generated/bridge/js.d.ts +1 -1
- package/lib-es/generated/bridge/mock.d.ts +1 -1
- package/lib-es/generated/deviceTransactionConfig.d.ts +1 -1
- package/lib-es/generated/specs.d.ts +1 -0
- package/lib-es/generated/specs.d.ts.map +1 -1
- package/lib-es/hooks/useDeviceTransactionConfig.d.ts +19 -0
- package/lib-es/hooks/useDeviceTransactionConfig.d.ts.map +1 -0
- package/lib-es/hooks/useDeviceTransactionConfig.js +41 -0
- package/lib-es/hooks/useDeviceTransactionConfig.js.map +1 -0
- package/lib-es/load/speculos.d.ts.map +1 -1
- package/lib-es/load/speculos.js +1 -0
- package/lib-es/load/speculos.js.map +1 -1
- package/lib-es/modularDrawer/__mocks__/currencies.mock.d.ts +3 -0
- package/lib-es/modularDrawer/__mocks__/currencies.mock.d.ts.map +1 -1
- package/lib-es/modularDrawer/__mocks__/currencies.mock.js +39 -0
- package/lib-es/modularDrawer/__mocks__/currencies.mock.js.map +1 -1
- package/lib-es/modularDrawer/hooks/useCurrenciesUnderFeatureFlag.d.ts.map +1 -1
- package/lib-es/modularDrawer/hooks/useCurrenciesUnderFeatureFlag.js +7 -0
- package/lib-es/modularDrawer/hooks/useCurrenciesUnderFeatureFlag.js.map +1 -1
- package/lib-es/modularDrawer/utils/index.d.ts +3 -2
- package/lib-es/modularDrawer/utils/index.d.ts.map +1 -1
- package/lib-es/modularDrawer/utils/index.js +4 -9
- package/lib-es/modularDrawer/utils/index.js.map +1 -1
- package/lib-es/postOnboarding/hooks/useAutoDismissPostOnboardingEntryPoint.js.map +1 -1
- package/lib-es/postOnboarding/hooks/usePostOnboardingHubState.d.ts.map +1 -1
- package/lib-es/postOnboarding/hooks/usePostOnboardingHubState.js +7 -6
- package/lib-es/postOnboarding/hooks/usePostOnboardingHubState.js.map +1 -1
- package/lib-es/transaction/deviceTransactionConfig.d.ts +1 -1
- package/lib-es/transaction/deviceTransactionConfig.d.ts.map +1 -1
- package/lib-es/transaction/deviceTransactionConfig.js +2 -2
- package/lib-es/transaction/deviceTransactionConfig.js.map +1 -1
- package/package.json +72 -71
- package/src/__tests__/environment.test.ts +8 -5
- package/src/__tests__/migration/account-migration.ts +1 -0
- package/src/__tests__/test-helpers/environment.ts +2 -0
- package/src/account/serialization.test.ts +1 -0
- package/src/apps/config.ts +1 -1
- package/src/bridge/generic-alpaca/alpaca/network/network-alpaca.ts +4 -0
- package/src/bridge/generic-alpaca/getAccountShape.ts +8 -1
- package/src/bridge/generic-alpaca/tests/getAccountShape.test.ts +25 -2
- package/src/bridge/generic-alpaca/utils.test.ts +165 -0
- package/src/bridge/generic-alpaca/utils.ts +5 -4
- package/src/dada-client/hooks/useAssetsData.ts +4 -8
- package/src/dada-client/state-manager/api.ts +3 -0
- package/src/dada-client/state-manager/types.ts +1 -0
- package/src/deposit/helper.ts +65 -1
- package/src/e2e/data/deviceLabelsData.ts +38 -33
- package/src/e2e/deviceInteraction/TouchDeviceSimulator.ts +13 -5
- package/src/e2e/enum/Account.ts +0 -6
- package/src/e2e/enum/Currency.ts +0 -7
- package/src/e2e/enum/Device.ts +1 -0
- package/src/e2e/enum/DeviceLabels.ts +2 -0
- package/src/e2e/families/bitcoin.ts +1 -1
- package/src/e2e/families/cardano.ts +12 -15
- package/src/e2e/families/evm.ts +4 -3
- package/src/e2e/families/solana.ts +1 -4
- package/src/e2e/speculos.ts +32 -18
- package/src/e2e/speculosAppVersion.ts +5 -2
- package/src/e2e/speculosCI.ts +4 -0
- package/src/exchange/swap/completeExchange.ts +17 -0
- package/src/exchange/swap/getIncompatibleCurrencyKeys.ts +4 -0
- package/src/exchange/swap/transactionStrategies.ts +16 -1
- package/src/families/bitcoin/satstack.test.ts +1 -0
- package/src/families/canton/bridge/mock.ts +10 -7
- package/src/families/canton/config.ts +3 -0
- package/src/families/canton/setup.ts +3 -3
- package/src/families/evm/config.ts +18 -1
- package/src/families/hedera/__snapshots__/bridge.integration.test.ts.snap +222 -86
- package/src/families/hedera/utils.ts +2 -0
- package/src/families/sui/react.ts +5 -0
- package/src/featureFlags/defaultFeatures.ts +3 -0
- package/src/hooks/useDeviceTransactionConfig.test.tsx +200 -0
- package/src/hooks/useDeviceTransactionConfig.ts +65 -0
- package/src/load/speculos.ts +1 -0
- package/src/modularDrawer/__mocks__/currencies.mock.ts +40 -0
- package/src/modularDrawer/hooks/useCurrenciesUnderFeatureFlag.ts +7 -0
- package/src/modularDrawer/utils/index.ts +6 -10
- package/src/postOnboarding/hooks/useAutoDismissPostOnboardingEntryPoint.ts +1 -1
- package/src/postOnboarding/hooks/usePostOnboardingHubState.ts +7 -9
- package/src/transaction/deviceTransactionConfig.ts +3 -3
- package/lib/families/hedera/logic.d.ts +0 -2
- package/lib/families/hedera/logic.d.ts.map +0 -1
- package/lib/families/hedera/logic.js.map +0 -1
- package/lib-es/families/hedera/logic.d.ts +0 -2
- package/lib-es/families/hedera/logic.d.ts.map +0 -1
- package/lib-es/families/hedera/logic.js +0 -3
- package/lib-es/families/hedera/logic.js.map +0 -1
- package/src/dada-client/MIGRATION_GUIDE.md +0 -187
- package/src/families/hedera/logic.ts +0 -2
- package/src/families/sui/__snapshots__/bridge.integration.test.ts.snap +0 -428
- package/src/modularDrawer/utils/index.test.ts +0 -43
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ledgerhq/live-common",
|
|
3
3
|
"description": "Common ground for the Ledger Live apps",
|
|
4
|
-
"version": "34.52.0-nightly.
|
|
4
|
+
"version": "34.52.0-nightly.10",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "https://github.com/LedgerHQ/ledger-live.git"
|
|
@@ -103,7 +103,7 @@
|
|
|
103
103
|
"dependencies": {
|
|
104
104
|
"@blooo/hw-app-acre": "^1.1.1",
|
|
105
105
|
"@cardano-foundation/ledgerjs-hw-app-cardano": "^7.1.2",
|
|
106
|
-
"@ledgerhq/device-management-kit": "0.9.
|
|
106
|
+
"@ledgerhq/device-management-kit": "0.9.2",
|
|
107
107
|
"@ledgerhq/live-app-sdk": "^0.8.1",
|
|
108
108
|
"@ledgerhq/wallet-api-client": "^1.12.3",
|
|
109
109
|
"@ledgerhq/wallet-api-core": "^1.25.0",
|
|
@@ -129,7 +129,7 @@
|
|
|
129
129
|
"@zondax/ledger-mina-js": "0.0.2",
|
|
130
130
|
"@zondax/ledger-stacks": "^1.0.2",
|
|
131
131
|
"async": "^3.2.3",
|
|
132
|
-
"axios": "1.
|
|
132
|
+
"axios": "1.12.2",
|
|
133
133
|
"bech32": "^1.1.3",
|
|
134
134
|
"bignumber.js": "^9.1.2",
|
|
135
135
|
"bip32": "^2.0.6",
|
|
@@ -163,77 +163,78 @@
|
|
|
163
163
|
"xstate": "^5.19.2",
|
|
164
164
|
"yargs": "^17.0.0",
|
|
165
165
|
"zod": "^3.22.4",
|
|
166
|
-
"
|
|
167
|
-
"@ledgerhq/coin-
|
|
168
|
-
"@ledgerhq/coin-
|
|
169
|
-
"@ledgerhq/coin-
|
|
170
|
-
"@ledgerhq/coin-
|
|
171
|
-
"@ledgerhq/coin-
|
|
172
|
-
"@ledgerhq/coin-
|
|
173
|
-
"@ledgerhq/coin-
|
|
174
|
-
"@ledgerhq/coin-
|
|
175
|
-
"@ledgerhq/coin-
|
|
176
|
-
"@ledgerhq/coin-
|
|
177
|
-
"@ledgerhq/coin-
|
|
178
|
-
"@ledgerhq/coin-
|
|
179
|
-
"@ledgerhq/coin-
|
|
180
|
-
"@ledgerhq/coin-
|
|
181
|
-
"@ledgerhq/coin-
|
|
182
|
-
"@ledgerhq/coin-
|
|
183
|
-
"@ledgerhq/coin-
|
|
184
|
-
"@ledgerhq/coin-
|
|
185
|
-
"@ledgerhq/coin-
|
|
186
|
-
"@ledgerhq/coin-
|
|
187
|
-
"@ledgerhq/coin-
|
|
188
|
-
"@ledgerhq/coin-
|
|
189
|
-
"@ledgerhq/coin-
|
|
190
|
-
"@ledgerhq/coin-
|
|
191
|
-
"@ledgerhq/coin-
|
|
192
|
-
"@ledgerhq/coin-
|
|
193
|
-
"@ledgerhq/coin-
|
|
194
|
-
"@ledgerhq/
|
|
195
|
-
"@ledgerhq/
|
|
196
|
-
"@ledgerhq/
|
|
197
|
-
"@ledgerhq/
|
|
166
|
+
"react-redux": "^7.2.9",
|
|
167
|
+
"@ledgerhq/coin-algorand": "^0.12.0-nightly.8",
|
|
168
|
+
"@ledgerhq/coin-aptos": "^3.5.0-nightly.7",
|
|
169
|
+
"@ledgerhq/coin-bitcoin": "^0.24.0-nightly.7",
|
|
170
|
+
"@ledgerhq/coin-canton": "^0.9.0-nightly.7",
|
|
171
|
+
"@ledgerhq/coin-cardano": "^0.14.0-nightly.7",
|
|
172
|
+
"@ledgerhq/coin-casper": "^2.3.0-nightly.7",
|
|
173
|
+
"@ledgerhq/coin-celo": "^1.7.0-nightly.9",
|
|
174
|
+
"@ledgerhq/coin-cosmos": "^0.19.0-nightly.7",
|
|
175
|
+
"@ledgerhq/coin-evm": "^2.34.0-nightly.9",
|
|
176
|
+
"@ledgerhq/coin-filecoin": "^1.14.0-nightly.7",
|
|
177
|
+
"@ledgerhq/coin-framework": "^6.8.0-nightly.7",
|
|
178
|
+
"@ledgerhq/coin-hedera": "^1.13.0-nightly.7",
|
|
179
|
+
"@ledgerhq/coin-icon": "^0.14.0-nightly.7",
|
|
180
|
+
"@ledgerhq/coin-internet_computer": "^1.10.0-nightly.8",
|
|
181
|
+
"@ledgerhq/coin-kaspa": "^1.4.0-nightly.7",
|
|
182
|
+
"@ledgerhq/coin-mina": "^1.4.0-nightly.7",
|
|
183
|
+
"@ledgerhq/coin-multiversx": "^0.7.0-nightly.8",
|
|
184
|
+
"@ledgerhq/coin-near": "^0.15.0-nightly.7",
|
|
185
|
+
"@ledgerhq/coin-polkadot": "^6.12.0-nightly.7",
|
|
186
|
+
"@ledgerhq/coin-solana": "^0.36.0-nightly.7",
|
|
187
|
+
"@ledgerhq/coin-stacks": "^0.11.0-nightly.7",
|
|
188
|
+
"@ledgerhq/coin-stellar": "^6.6.0-nightly.7",
|
|
189
|
+
"@ledgerhq/coin-sui": "^0.17.0-nightly.9",
|
|
190
|
+
"@ledgerhq/coin-tezos": "^6.8.0-nightly.7",
|
|
191
|
+
"@ledgerhq/coin-ton": "^0.16.0-nightly.7",
|
|
192
|
+
"@ledgerhq/coin-tron": "^5.6.0-nightly.7",
|
|
193
|
+
"@ledgerhq/coin-vechain": "^2.12.0-nightly.7",
|
|
194
|
+
"@ledgerhq/coin-xrp": "^7.7.0-nightly.7",
|
|
195
|
+
"@ledgerhq/crypto-icons-ui": "^1.22.0-nightly.1",
|
|
196
|
+
"@ledgerhq/cryptoassets": "^13.32.0-nightly.5",
|
|
197
|
+
"@ledgerhq/device-core": "^0.6.7-nightly.3",
|
|
198
|
+
"@ledgerhq/devices": "8.7.0-nightly.1",
|
|
198
199
|
"@ledgerhq/errors": "^6.27.0-nightly.0",
|
|
199
|
-
"@ledgerhq/hw-app-algorand": "^6.31.9-nightly.
|
|
200
|
-
"@ledgerhq/hw-app-aptos": "^6.34.9-nightly.
|
|
201
|
-
"@ledgerhq/hw-app-btc": "^10.
|
|
202
|
-
"@ledgerhq/hw-app-celo": "^6.35.2-nightly.
|
|
203
|
-
"@ledgerhq/hw-app-cosmos": "^6.32.9-nightly.
|
|
204
|
-
"@ledgerhq/hw-app-eth": "^6.
|
|
205
|
-
"@ledgerhq/hw-app-exchange": "^0.
|
|
206
|
-
"@ledgerhq/hw-app-hedera": "^1.2.9-nightly.
|
|
207
|
-
"@ledgerhq/hw-app-icon": "^1.3.9-nightly.
|
|
208
|
-
"@ledgerhq/hw-app-kaspa": "^1.3.2-nightly.
|
|
209
|
-
"@ledgerhq/hw-app-multiversx": "^6.
|
|
210
|
-
"@ledgerhq/hw-app-near": "^6.31.9-nightly.
|
|
211
|
-
"@ledgerhq/hw-app-polkadot": "^6.34.9-nightly.
|
|
212
|
-
"@ledgerhq/hw-app-str": "^7.2.9-nightly.
|
|
200
|
+
"@ledgerhq/hw-app-algorand": "^6.31.9-nightly.1",
|
|
201
|
+
"@ledgerhq/hw-app-aptos": "^6.34.9-nightly.1",
|
|
202
|
+
"@ledgerhq/hw-app-btc": "^10.12.0-nightly.4",
|
|
203
|
+
"@ledgerhq/hw-app-celo": "^6.35.2-nightly.3",
|
|
204
|
+
"@ledgerhq/hw-app-cosmos": "^6.32.9-nightly.1",
|
|
205
|
+
"@ledgerhq/hw-app-eth": "^6.47.0-nightly.3",
|
|
206
|
+
"@ledgerhq/hw-app-exchange": "^0.17.0-nightly.0",
|
|
207
|
+
"@ledgerhq/hw-app-hedera": "^1.2.9-nightly.1",
|
|
208
|
+
"@ledgerhq/hw-app-icon": "^1.3.9-nightly.1",
|
|
209
|
+
"@ledgerhq/hw-app-kaspa": "^1.3.2-nightly.1",
|
|
210
|
+
"@ledgerhq/hw-app-multiversx": "^6.26.0-nightly.2",
|
|
211
|
+
"@ledgerhq/hw-app-near": "^6.31.9-nightly.1",
|
|
212
|
+
"@ledgerhq/hw-app-polkadot": "^6.34.9-nightly.1",
|
|
213
|
+
"@ledgerhq/hw-app-str": "^7.2.9-nightly.1",
|
|
213
214
|
"@ledgerhq/hw-app-sui": "^1.4.0",
|
|
214
|
-
"@ledgerhq/hw-app-tezos": "^6.31.9-nightly.
|
|
215
|
-
"@ledgerhq/hw-app-trx": "^6.31.9-nightly.
|
|
216
|
-
"@ledgerhq/hw-app-vet": "^0.6.
|
|
217
|
-
"@ledgerhq/hw-app-xrp": "^6.32.7-nightly.
|
|
218
|
-
"@ledgerhq/hw-bolos": "^6.32.9-nightly.
|
|
219
|
-
"@ledgerhq/hw-transport": "6.31.13-nightly.
|
|
220
|
-
"@ledgerhq/hw-transport-mocker": "^6.29.13-nightly.
|
|
221
|
-
"@ledgerhq/ledger-cal-service": "^1.
|
|
222
|
-
"@ledgerhq/ledger-trust-service": "^0.4.
|
|
215
|
+
"@ledgerhq/hw-app-tezos": "^6.31.9-nightly.1",
|
|
216
|
+
"@ledgerhq/hw-app-trx": "^6.31.9-nightly.1",
|
|
217
|
+
"@ledgerhq/hw-app-vet": "^0.6.3-nightly.0",
|
|
218
|
+
"@ledgerhq/hw-app-xrp": "^6.32.7-nightly.1",
|
|
219
|
+
"@ledgerhq/hw-bolos": "^6.32.9-nightly.1",
|
|
220
|
+
"@ledgerhq/hw-transport": "6.31.13-nightly.1",
|
|
221
|
+
"@ledgerhq/hw-transport-mocker": "^6.29.13-nightly.1",
|
|
222
|
+
"@ledgerhq/ledger-cal-service": "^1.8.0-nightly.1",
|
|
223
|
+
"@ledgerhq/ledger-trust-service": "^0.4.1-nightly.1",
|
|
223
224
|
"@ledgerhq/live-config": "^3.2.0",
|
|
224
|
-
"@ledgerhq/live-countervalues": "^0.8.1-nightly.
|
|
225
|
-
"@ledgerhq/live-countervalues-react": "^0.7.1-nightly.
|
|
226
|
-
"@ledgerhq/live-dmk-shared": "^0.
|
|
227
|
-
"@ledgerhq/live-env": "^2.
|
|
225
|
+
"@ledgerhq/live-countervalues": "^0.8.1-nightly.7",
|
|
226
|
+
"@ledgerhq/live-countervalues-react": "^0.7.1-nightly.7",
|
|
227
|
+
"@ledgerhq/live-dmk-shared": "^0.15.0-nightly.0",
|
|
228
|
+
"@ledgerhq/live-env": "^2.20.0-nightly.0",
|
|
228
229
|
"@ledgerhq/live-hooks": "0.2.0",
|
|
229
|
-
"@ledgerhq/live-network": "^2.0.
|
|
230
|
+
"@ledgerhq/live-network": "^2.1.0-nightly.1",
|
|
230
231
|
"@ledgerhq/live-promise": "^0.1.1",
|
|
231
|
-
"@ledgerhq/live-signer-canton": "^0.
|
|
232
|
-
"@ledgerhq/live-signer-evm": "^0.
|
|
233
|
-
"@ledgerhq/live-signer-solana": "^0.5.9-nightly.
|
|
234
|
-
"@ledgerhq/live-wallet": "^0.
|
|
232
|
+
"@ledgerhq/live-signer-canton": "^0.5.0-nightly.7",
|
|
233
|
+
"@ledgerhq/live-signer-evm": "^0.10.0-nightly.9",
|
|
234
|
+
"@ledgerhq/live-signer-solana": "^0.5.9-nightly.7",
|
|
235
|
+
"@ledgerhq/live-wallet": "^0.15.0-nightly.7",
|
|
235
236
|
"@ledgerhq/logs": "^6.13.0",
|
|
236
|
-
"@ledgerhq/speculos-transport": "^0.2.
|
|
237
|
+
"@ledgerhq/speculos-transport": "^0.2.14-nightly.2",
|
|
237
238
|
"@ledgerhq/wallet-api-acre-module": "^0.8.0",
|
|
238
239
|
"@ledgerhq/wallet-api-exchange-module": "^0.17.0"
|
|
239
240
|
},
|
|
@@ -251,6 +252,7 @@
|
|
|
251
252
|
"@types/lodash": "^4.14.179",
|
|
252
253
|
"@types/node": "^22.10.10",
|
|
253
254
|
"@types/react": "^18.2.21",
|
|
255
|
+
"@types/react-redux": "^7.1.33",
|
|
254
256
|
"@types/uuid": "^8.3.4",
|
|
255
257
|
"benchmark": "^2.1.4",
|
|
256
258
|
"buffer": "6.0.3",
|
|
@@ -273,7 +275,6 @@
|
|
|
273
275
|
"react-dom": "18.3.1",
|
|
274
276
|
"react-native": "0.77.2",
|
|
275
277
|
"react-native-svg": "15.11.2",
|
|
276
|
-
"react-redux": "^7.2.9",
|
|
277
278
|
"react-test-renderer": "18.3.1",
|
|
278
279
|
"redux-actions": "2.6.5",
|
|
279
280
|
"timemachine": "^0.3.2",
|
|
@@ -283,10 +284,10 @@
|
|
|
283
284
|
"undici": "6.19.2",
|
|
284
285
|
"uuid": "^8.3.2",
|
|
285
286
|
"ws": "7",
|
|
286
|
-
"@ledgerhq/device-react": "^0.3.1-nightly.
|
|
287
|
+
"@ledgerhq/device-react": "^0.3.1-nightly.3",
|
|
287
288
|
"@ledgerhq/types-cryptoassets": "^7.29.0",
|
|
288
289
|
"@ledgerhq/types-devices": "^6.27.0",
|
|
289
|
-
"@ledgerhq/types-live": "^6.88.0-nightly.
|
|
290
|
+
"@ledgerhq/types-live": "^6.88.0-nightly.3"
|
|
290
291
|
},
|
|
291
292
|
"scripts": {
|
|
292
293
|
"build": "zx ./scripts/build-ts.mjs",
|
|
@@ -4,9 +4,12 @@ import "./test-helpers/setup";
|
|
|
4
4
|
import { getAbandonSeedAddress, listSupportedCurrencies } from "../currencies";
|
|
5
5
|
|
|
6
6
|
describe("supported currencies are ready to work", () => {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
7
|
+
// Skip bitcoin_regtest this one because it's only for cointester bitcoin
|
|
8
|
+
listSupportedCurrencies()
|
|
9
|
+
.filter(c => c.id !== "bitcoin_regtest")
|
|
10
|
+
.forEach(c =>
|
|
11
|
+
test("getAbandonSeedAddress works for currency " + c.id, () =>
|
|
12
|
+
expect(getAbandonSeedAddress(c.id)).toBeTruthy(),
|
|
13
|
+
),
|
|
14
|
+
);
|
|
12
15
|
});
|
|
@@ -46,6 +46,7 @@ setSupportedCurrencies([
|
|
|
46
46
|
"algorand",
|
|
47
47
|
"polkadot",
|
|
48
48
|
"bitcoin_testnet",
|
|
49
|
+
"bitcoin_regtest",
|
|
49
50
|
"ethereum_sepolia",
|
|
50
51
|
"ethereum_holesky",
|
|
51
52
|
"ethereum_hoodi",
|
|
@@ -122,6 +123,7 @@ setSupportedCurrencies([
|
|
|
122
123
|
"canton_network_devnet",
|
|
123
124
|
"canton_network_testnet",
|
|
124
125
|
"kaspa",
|
|
126
|
+
"monad",
|
|
125
127
|
]);
|
|
126
128
|
LiveConfig.setConfig(liveConfig);
|
|
127
129
|
|
|
@@ -26,6 +26,7 @@ setCryptoAssetsStoreForCoinFramework({
|
|
|
26
26
|
return undefined;
|
|
27
27
|
},
|
|
28
28
|
findTokenByAddressInCurrency: (_: string, __: string) => undefined,
|
|
29
|
+
getTokensSyncHash: (_: string) => Promise.resolve("0"),
|
|
29
30
|
} as CryptoAssetsStore);
|
|
30
31
|
|
|
31
32
|
describe("serialization", () => {
|
package/src/apps/config.ts
CHANGED
|
@@ -14,6 +14,7 @@ import type {
|
|
|
14
14
|
Stake,
|
|
15
15
|
Reward,
|
|
16
16
|
CraftedTransaction,
|
|
17
|
+
Validator,
|
|
17
18
|
} from "@ledgerhq/coin-framework/api/index";
|
|
18
19
|
import network from "@ledgerhq/live-network";
|
|
19
20
|
|
|
@@ -206,4 +207,7 @@ export const getNetworkAlpacaApi = (networkFamily: string) =>
|
|
|
206
207
|
getRewards(_address: string, _cursor?: Cursor): Promise<Page<Reward>> {
|
|
207
208
|
throw new Error("getRewards is not supported");
|
|
208
209
|
},
|
|
210
|
+
getValidators(_cursor?: Cursor): Promise<Page<Validator>> {
|
|
211
|
+
throw new Error("getValidators is not supported");
|
|
212
|
+
},
|
|
209
213
|
}) satisfies Api<any>;
|
|
@@ -91,7 +91,14 @@ export function genericGetAccountShape(network: string, kind: string): GetAccoun
|
|
|
91
91
|
subOperations,
|
|
92
92
|
});
|
|
93
93
|
});
|
|
94
|
-
const
|
|
94
|
+
const confirmedOperations =
|
|
95
|
+
alpacaApi.refreshOperations && initialAccount?.pendingOperations.length
|
|
96
|
+
? await alpacaApi.refreshOperations(initialAccount.pendingOperations)
|
|
97
|
+
: [];
|
|
98
|
+
const operations = mergeOps(oldOps, [
|
|
99
|
+
...confirmedOperations,
|
|
100
|
+
...newOpsWithSubs,
|
|
101
|
+
]) as OperationCommon[];
|
|
95
102
|
|
|
96
103
|
const res = {
|
|
97
104
|
id: accountId,
|
|
@@ -15,12 +15,14 @@ const getBalanceMock = jest.fn();
|
|
|
15
15
|
const lastBlockMock = jest.fn();
|
|
16
16
|
const getTokenFromAssetMock = jest.fn();
|
|
17
17
|
const chainSpecificGetAccountShapeMock = jest.fn();
|
|
18
|
+
const refreshOperationsMock = jest.fn();
|
|
18
19
|
jest.mock("../alpaca", () => ({
|
|
19
20
|
getAlpacaApi: () => ({
|
|
20
21
|
lastBlock: (...a: any[]) => lastBlockMock(...a),
|
|
21
22
|
getBalance: (...a: any[]) => getBalanceMock(...a),
|
|
22
23
|
listOperations: (...a: any[]) => listOperationsMock(...a),
|
|
23
24
|
getTokenFromAsset: (...a: any[]) => getTokenFromAssetMock(...a),
|
|
25
|
+
refreshOperations: (...a: any[]) => refreshOperationsMock(...a),
|
|
24
26
|
getChainSpecificRules: () => ({
|
|
25
27
|
getAccountShape: (...a: any[]) => chainSpecificGetAccountShapeMock(...a),
|
|
26
28
|
}),
|
|
@@ -68,7 +70,16 @@ describe("genericGetAccountShape", () => {
|
|
|
68
70
|
type: "OPT_IN",
|
|
69
71
|
extra: { pagingToken: "pt1", assetReference: "ar1", assetOwner: "ow1" },
|
|
70
72
|
};
|
|
71
|
-
const
|
|
73
|
+
const pendingOp = {
|
|
74
|
+
hash: "h0",
|
|
75
|
+
blockHeight: 10,
|
|
76
|
+
type: "OUT",
|
|
77
|
+
};
|
|
78
|
+
const initialAccount = {
|
|
79
|
+
operations: [oldOp],
|
|
80
|
+
pendingOperations: [pendingOp],
|
|
81
|
+
blockHeight: 10,
|
|
82
|
+
};
|
|
72
83
|
|
|
73
84
|
extractBalanceMock.mockReturnValue({ value: "1000", locked: "300" });
|
|
74
85
|
getBalanceMock.mockResolvedValue([
|
|
@@ -83,6 +94,13 @@ describe("genericGetAccountShape", () => {
|
|
|
83
94
|
|
|
84
95
|
const coreOp = { hash: "h2", height: 12 };
|
|
85
96
|
listOperationsMock.mockResolvedValue([[coreOp]]);
|
|
97
|
+
refreshOperationsMock.mockImplementation(ops => {
|
|
98
|
+
const op = ops[0];
|
|
99
|
+
if (op?.hash === "h0") {
|
|
100
|
+
return [{ ...op, blockHeight: 12 }];
|
|
101
|
+
}
|
|
102
|
+
return [];
|
|
103
|
+
});
|
|
86
104
|
|
|
87
105
|
adaptCoreOperationToLiveOperationMock.mockImplementation((_accId, op) => ({
|
|
88
106
|
hash: op.hash,
|
|
@@ -141,9 +159,14 @@ describe("genericGetAccountShape", () => {
|
|
|
141
159
|
balance: new BigNumber(1000),
|
|
142
160
|
spendableBalance: new BigNumber(700),
|
|
143
161
|
blockHeight: 123,
|
|
144
|
-
operationsCount:
|
|
162
|
+
operationsCount: 3,
|
|
145
163
|
subAccounts: [{ id: `${currency.id}_subAcc1`, type: "TokenAccount" }],
|
|
146
164
|
operations: [
|
|
165
|
+
{
|
|
166
|
+
hash: "h0",
|
|
167
|
+
type: "OUT",
|
|
168
|
+
blockHeight: 12,
|
|
169
|
+
},
|
|
147
170
|
{
|
|
148
171
|
hash: "h2",
|
|
149
172
|
type: "IN",
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
adaptCoreOperationToLiveOperation,
|
|
3
|
+
buildOptimisticOperation,
|
|
3
4
|
cleanedOperation,
|
|
4
5
|
extractBalance,
|
|
5
6
|
findCryptoCurrencyByNetwork,
|
|
@@ -11,6 +12,170 @@ import { Account } from "@ledgerhq/types-live";
|
|
|
11
12
|
import { GenericTransaction, OperationCommon } from "./types";
|
|
12
13
|
|
|
13
14
|
describe("Alpaca utils", () => {
|
|
15
|
+
describe("buildOptimisticOperation", () => {
|
|
16
|
+
it.each([
|
|
17
|
+
[
|
|
18
|
+
"coin",
|
|
19
|
+
"changeTrust",
|
|
20
|
+
{},
|
|
21
|
+
{
|
|
22
|
+
parentType: "OPT_IN",
|
|
23
|
+
subType: undefined,
|
|
24
|
+
parentValue: new BigNumber(50),
|
|
25
|
+
},
|
|
26
|
+
],
|
|
27
|
+
[
|
|
28
|
+
"coin",
|
|
29
|
+
"delegate",
|
|
30
|
+
{},
|
|
31
|
+
{
|
|
32
|
+
parentType: "DELEGATE",
|
|
33
|
+
subType: undefined,
|
|
34
|
+
parentValue: new BigNumber(50),
|
|
35
|
+
},
|
|
36
|
+
],
|
|
37
|
+
[
|
|
38
|
+
"coin",
|
|
39
|
+
"stake",
|
|
40
|
+
{},
|
|
41
|
+
{
|
|
42
|
+
parentType: "DELEGATE",
|
|
43
|
+
subType: undefined,
|
|
44
|
+
parentValue: new BigNumber(50),
|
|
45
|
+
},
|
|
46
|
+
],
|
|
47
|
+
[
|
|
48
|
+
"coin",
|
|
49
|
+
"undelegate",
|
|
50
|
+
{},
|
|
51
|
+
{
|
|
52
|
+
parentType: "UNDELEGATE",
|
|
53
|
+
subType: undefined,
|
|
54
|
+
parentValue: new BigNumber(50),
|
|
55
|
+
},
|
|
56
|
+
],
|
|
57
|
+
[
|
|
58
|
+
"coin",
|
|
59
|
+
"unstake",
|
|
60
|
+
{},
|
|
61
|
+
{
|
|
62
|
+
parentType: "UNDELEGATE",
|
|
63
|
+
subType: undefined,
|
|
64
|
+
parentValue: new BigNumber(50),
|
|
65
|
+
},
|
|
66
|
+
],
|
|
67
|
+
[
|
|
68
|
+
"coin",
|
|
69
|
+
"send",
|
|
70
|
+
{},
|
|
71
|
+
{
|
|
72
|
+
parentType: "OUT",
|
|
73
|
+
subType: undefined,
|
|
74
|
+
parentValue: new BigNumber(50),
|
|
75
|
+
},
|
|
76
|
+
],
|
|
77
|
+
[
|
|
78
|
+
"token",
|
|
79
|
+
"changeTrust",
|
|
80
|
+
{ subAccountId: "sub-account-id" },
|
|
81
|
+
{
|
|
82
|
+
parentType: "FEES",
|
|
83
|
+
subType: "OPT_IN",
|
|
84
|
+
parentValue: new BigNumber(12),
|
|
85
|
+
},
|
|
86
|
+
],
|
|
87
|
+
[
|
|
88
|
+
"token",
|
|
89
|
+
"delegate",
|
|
90
|
+
{ subAccountId: "sub-account-id" },
|
|
91
|
+
{
|
|
92
|
+
parentType: "FEES",
|
|
93
|
+
subType: "DELEGATE",
|
|
94
|
+
parentValue: new BigNumber(12),
|
|
95
|
+
},
|
|
96
|
+
],
|
|
97
|
+
[
|
|
98
|
+
"token",
|
|
99
|
+
"stake",
|
|
100
|
+
{ subAccountId: "sub-account-id" },
|
|
101
|
+
{
|
|
102
|
+
parentType: "FEES",
|
|
103
|
+
subType: "DELEGATE",
|
|
104
|
+
parentValue: new BigNumber(12),
|
|
105
|
+
},
|
|
106
|
+
],
|
|
107
|
+
[
|
|
108
|
+
"token",
|
|
109
|
+
"undelegate",
|
|
110
|
+
{ subAccountId: "sub-account-id" },
|
|
111
|
+
{
|
|
112
|
+
parentType: "FEES",
|
|
113
|
+
subType: "UNDELEGATE",
|
|
114
|
+
parentValue: new BigNumber(12),
|
|
115
|
+
},
|
|
116
|
+
],
|
|
117
|
+
[
|
|
118
|
+
"token",
|
|
119
|
+
"unstake",
|
|
120
|
+
{ subAccountId: "sub-account-id" },
|
|
121
|
+
{
|
|
122
|
+
parentType: "FEES",
|
|
123
|
+
subType: "UNDELEGATE",
|
|
124
|
+
parentValue: new BigNumber(12),
|
|
125
|
+
},
|
|
126
|
+
],
|
|
127
|
+
[
|
|
128
|
+
"token",
|
|
129
|
+
"send",
|
|
130
|
+
{ subAccountId: "sub-account-id" },
|
|
131
|
+
{ parentType: "FEES", subType: "OUT", parentValue: new BigNumber(12) },
|
|
132
|
+
],
|
|
133
|
+
])("builds an optimistic %s operation with %s mode ", (_s, mode, params, expected) => {
|
|
134
|
+
const operation = buildOptimisticOperation(
|
|
135
|
+
{
|
|
136
|
+
id: "parent-account-id",
|
|
137
|
+
freshAddress: "account-address",
|
|
138
|
+
subAccounts: [{ id: "sub-account-id" }],
|
|
139
|
+
} as Account,
|
|
140
|
+
{
|
|
141
|
+
mode,
|
|
142
|
+
amount: new BigNumber(50),
|
|
143
|
+
fees: new BigNumber(12),
|
|
144
|
+
recipient: "recipient-address",
|
|
145
|
+
...params,
|
|
146
|
+
} as GenericTransaction,
|
|
147
|
+
);
|
|
148
|
+
|
|
149
|
+
expect(operation).toMatchObject({
|
|
150
|
+
id: `parent-account-id--${expected.parentType}`,
|
|
151
|
+
type: expected.parentType,
|
|
152
|
+
value: expected.parentValue,
|
|
153
|
+
accountId: "parent-account-id",
|
|
154
|
+
senders: ["account-address"],
|
|
155
|
+
recipients: ["recipient-address"],
|
|
156
|
+
fee: new BigNumber(12),
|
|
157
|
+
blockHash: null,
|
|
158
|
+
blockHeight: null,
|
|
159
|
+
...(expected.subType
|
|
160
|
+
? {
|
|
161
|
+
subOperations: [
|
|
162
|
+
{
|
|
163
|
+
id: `sub-account-id--${expected.subType}`,
|
|
164
|
+
accountId: "sub-account-id",
|
|
165
|
+
type: expected.subType,
|
|
166
|
+
senders: ["account-address"],
|
|
167
|
+
recipients: ["recipient-address"],
|
|
168
|
+
value: new BigNumber(50),
|
|
169
|
+
blockHash: null,
|
|
170
|
+
blockHeight: null,
|
|
171
|
+
},
|
|
172
|
+
],
|
|
173
|
+
}
|
|
174
|
+
: {}),
|
|
175
|
+
});
|
|
176
|
+
});
|
|
177
|
+
});
|
|
178
|
+
|
|
14
179
|
describe("cleanedOperation", () => {
|
|
15
180
|
it("creates a cleaned version of an operation without mutating it", () => {
|
|
16
181
|
const dirty = {
|
|
@@ -241,11 +241,12 @@ export const buildOptimisticOperation = (
|
|
|
241
241
|
const fees = BigInt(transaction.fees?.toString() || "0");
|
|
242
242
|
const { subAccountId } = transaction;
|
|
243
243
|
const { subAccounts } = account;
|
|
244
|
+
const parentType = subAccountId ? "FEES" : type;
|
|
244
245
|
|
|
245
246
|
const operation: Operation = {
|
|
246
|
-
id: encodeOperationId(account.id, "",
|
|
247
|
+
id: encodeOperationId(account.id, "", parentType),
|
|
247
248
|
hash: "",
|
|
248
|
-
type:
|
|
249
|
+
type: parentType,
|
|
249
250
|
value: subAccountId ? new BigNumber(fees.toString()) : transaction.amount, // match old behavior
|
|
250
251
|
fee: new BigNumber(fees.toString()),
|
|
251
252
|
blockHash: null,
|
|
@@ -266,9 +267,9 @@ export const buildOptimisticOperation = (
|
|
|
266
267
|
if (tokenAccount && subAccountId) {
|
|
267
268
|
operation.subOperations = [
|
|
268
269
|
{
|
|
269
|
-
id: `${subAccountId}
|
|
270
|
+
id: `${subAccountId}--${type}`,
|
|
270
271
|
hash: "",
|
|
271
|
-
type
|
|
272
|
+
type,
|
|
272
273
|
value: transaction.useAllAmount ? tokenAccount.balance : transaction.amount,
|
|
273
274
|
fee: new BigNumber(0),
|
|
274
275
|
blockHash: null,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useMemo } from "react";
|
|
2
2
|
import { useGetAssetsDataInfiniteQuery } from "../state-manager/api";
|
|
3
|
-
import { AssetsDataWithPagination } from "../state-manager/types";
|
|
3
|
+
import { AssetsDataWithPagination, GetAssetsDataParams } from "../state-manager/types";
|
|
4
4
|
|
|
5
5
|
const emptyData = () => ({
|
|
6
6
|
cryptoAssets: {},
|
|
@@ -25,14 +25,9 @@ export function useAssetsData({
|
|
|
25
25
|
product,
|
|
26
26
|
version,
|
|
27
27
|
isStaging,
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
currencyIds?: string[];
|
|
31
|
-
useCase?: string;
|
|
28
|
+
includeTestNetworks,
|
|
29
|
+
}: GetAssetsDataParams & {
|
|
32
30
|
areCurrenciesFiltered?: boolean;
|
|
33
|
-
product: "llm" | "lld";
|
|
34
|
-
version: string;
|
|
35
|
-
isStaging?: boolean;
|
|
36
31
|
}) {
|
|
37
32
|
const {
|
|
38
33
|
data,
|
|
@@ -51,6 +46,7 @@ export function useAssetsData({
|
|
|
51
46
|
product,
|
|
52
47
|
version,
|
|
53
48
|
isStaging,
|
|
49
|
+
includeTestNetworks,
|
|
54
50
|
});
|
|
55
51
|
|
|
56
52
|
const joinedPages = useMemo(() => {
|
|
@@ -45,6 +45,9 @@ export const assetsDataApi = createApi({
|
|
|
45
45
|
...(queryArg?.search && { search: queryArg.search }),
|
|
46
46
|
product: queryArg.product,
|
|
47
47
|
minVersion: queryArg.version,
|
|
48
|
+
...(queryArg?.includeTestNetworks && {
|
|
49
|
+
includeTestNetworks: queryArg.includeTestNetworks,
|
|
50
|
+
}),
|
|
48
51
|
additionalData: queryArg.additionalData || [
|
|
49
52
|
AssetsAdditionalData.Apy,
|
|
50
53
|
AssetsAdditionalData.MarketTrend,
|