@ledgerhq/live-common 34.46.0-nightly.5 → 34.46.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/bridge/crypto-assets/index.d.ts +1 -1
- package/lib/bridge/crypto-assets/index.d.ts.map +1 -1
- package/lib/bridge/crypto-assets/index.js +1 -1
- package/lib/bridge/crypto-assets/index.js.map +1 -1
- package/lib/bridge/generic-alpaca/estimateMaxSpendable.d.ts.map +1 -1
- package/lib/bridge/generic-alpaca/estimateMaxSpendable.js +4 -6
- package/lib/bridge/generic-alpaca/estimateMaxSpendable.js.map +1 -1
- package/lib/bridge/generic-alpaca/getTransactionStatus.d.ts.map +1 -1
- package/lib/bridge/generic-alpaca/getTransactionStatus.js +2 -2
- package/lib/bridge/generic-alpaca/getTransactionStatus.js.map +1 -1
- package/lib/bridge/generic-alpaca/prepareTransaction.d.ts.map +1 -1
- package/lib/bridge/generic-alpaca/prepareTransaction.js +12 -12
- package/lib/bridge/generic-alpaca/prepareTransaction.js.map +1 -1
- package/lib/bridge/generic-alpaca/signOperation.d.ts.map +1 -1
- package/lib/bridge/generic-alpaca/signOperation.js +4 -3
- package/lib/bridge/generic-alpaca/signOperation.js.map +1 -1
- package/lib/bridge/generic-alpaca/tests/prepareTransaction.test.js +1 -1
- package/lib/bridge/generic-alpaca/tests/prepareTransaction.test.js.map +1 -1
- package/lib/bridge/generic-alpaca/utils.d.ts +1 -0
- package/lib/bridge/generic-alpaca/utils.d.ts.map +1 -1
- package/lib/bridge/generic-alpaca/utils.js +1 -0
- package/lib/bridge/generic-alpaca/utils.js.map +1 -1
- package/lib/bridge/impl.d.ts +1 -1
- package/lib/bridge/impl.d.ts.map +1 -1
- package/lib/currencies/index.d.ts +1 -1
- package/lib/currencies/index.d.ts.map +1 -1
- package/lib/currencies/index.js +2 -1
- package/lib/currencies/index.js.map +1 -1
- package/lib/currencies/sortByMarketcap.test.js +1 -2
- package/lib/currencies/sortByMarketcap.test.js.map +1 -1
- package/lib/domain/getTokensWithFunds.test.js +1 -1
- package/lib/domain/getTokensWithFunds.test.js.map +1 -1
- package/lib/e2e/enum/AppInfos.d.ts +1 -1
- package/lib/e2e/enum/AppInfos.d.ts.map +1 -1
- package/lib/e2e/enum/DeviceLabels.d.ts +2 -3
- package/lib/e2e/enum/DeviceLabels.d.ts.map +1 -1
- package/lib/e2e/enum/DeviceLabels.js +1 -2
- package/lib/e2e/enum/DeviceLabels.js.map +1 -1
- package/lib/e2e/enum/Provider.d.ts.map +1 -1
- package/lib/e2e/enum/Provider.js +2 -2
- package/lib/e2e/enum/Provider.js.map +1 -1
- package/lib/e2e/families/solana.d.ts.map +1 -1
- package/lib/e2e/families/solana.js +4 -4
- package/lib/e2e/families/solana.js.map +1 -1
- package/lib/e2e/index.d.ts +0 -5
- package/lib/e2e/index.d.ts.map +1 -1
- package/lib/e2e/speculos.d.ts.map +1 -1
- package/lib/e2e/speculos.js +5 -4
- package/lib/e2e/speculos.js.map +1 -1
- package/lib/e2e/speculosCI.d.ts +0 -4
- package/lib/e2e/speculosCI.d.ts.map +1 -1
- package/lib/e2e/speculosCI.js +6 -16
- 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/api/v5/actions.js +1 -1
- package/lib/exchange/swap/api/v5/actions.js.map +1 -1
- package/lib/exchange/swap/types.d.ts +1 -1
- package/lib/exchange/swap/types.d.ts.map +1 -1
- package/lib/families/evm/setup.d.ts.map +1 -1
- package/lib/families/evm/setup.js +1 -11
- package/lib/families/evm/setup.js.map +1 -1
- package/lib/families/hedera/setup.d.ts +5 -5
- package/lib/families/hedera/setup.d.ts.map +1 -1
- package/lib/families/hedera/setup.js.map +1 -1
- package/lib/families/solana/setup.d.ts.map +1 -1
- package/lib/families/solana/setup.js +1 -2
- package/lib/families/solana/setup.js.map +1 -1
- package/lib/featureFlags/defaultFeatures.d.ts.map +1 -1
- package/lib/featureFlags/defaultFeatures.js +0 -1
- 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/generated/bridge/js.d.ts +1 -1
- package/lib/market/utils/countervalueFormatter.d.ts.map +1 -1
- package/lib/market/utils/countervalueFormatter.js.map +1 -1
- package/lib/market/utils/types.d.ts +0 -2
- package/lib/market/utils/types.d.ts.map +1 -1
- package/lib/modularDrawer/__mocks__/currencies.mock.d.ts.map +1 -1
- package/lib/modularDrawer/__mocks__/currencies.mock.js +7 -7
- package/lib/modularDrawer/__mocks__/currencies.mock.js.map +1 -1
- package/lib/modularDrawer/__mocks__/useGroupedCurrenciesByProvider.mock.js +1 -1
- package/lib/modularDrawer/__mocks__/useGroupedCurrenciesByProvider.mock.js.map +1 -1
- package/lib/modularDrawer/utils/__tests__/currencyUtils.test.js +1 -1
- package/lib/modularDrawer/utils/__tests__/currencyUtils.test.js.map +1 -1
- package/lib/modularDrawer/utils/__tests__/haveOneCommonProvider.test.js +1 -1
- package/lib/modularDrawer/utils/__tests__/haveOneCommonProvider.test.js.map +1 -1
- package/lib/utils/__tests__/getAccountTuplesForCurrency.test.js +1 -1
- package/lib/utils/__tests__/getAccountTuplesForCurrency.test.js.map +1 -1
- package/lib-es/bridge/crypto-assets/index.d.ts +1 -1
- package/lib-es/bridge/crypto-assets/index.d.ts.map +1 -1
- package/lib-es/bridge/crypto-assets/index.js +1 -1
- package/lib-es/bridge/crypto-assets/index.js.map +1 -1
- package/lib-es/bridge/generic-alpaca/estimateMaxSpendable.d.ts.map +1 -1
- package/lib-es/bridge/generic-alpaca/estimateMaxSpendable.js +4 -6
- package/lib-es/bridge/generic-alpaca/estimateMaxSpendable.js.map +1 -1
- package/lib-es/bridge/generic-alpaca/getTransactionStatus.d.ts.map +1 -1
- package/lib-es/bridge/generic-alpaca/getTransactionStatus.js +2 -2
- package/lib-es/bridge/generic-alpaca/getTransactionStatus.js.map +1 -1
- package/lib-es/bridge/generic-alpaca/prepareTransaction.d.ts.map +1 -1
- package/lib-es/bridge/generic-alpaca/prepareTransaction.js +12 -12
- package/lib-es/bridge/generic-alpaca/prepareTransaction.js.map +1 -1
- package/lib-es/bridge/generic-alpaca/signOperation.d.ts.map +1 -1
- package/lib-es/bridge/generic-alpaca/signOperation.js +4 -3
- package/lib-es/bridge/generic-alpaca/signOperation.js.map +1 -1
- package/lib-es/bridge/generic-alpaca/tests/prepareTransaction.test.js +1 -1
- package/lib-es/bridge/generic-alpaca/tests/prepareTransaction.test.js.map +1 -1
- package/lib-es/bridge/generic-alpaca/utils.d.ts +1 -0
- package/lib-es/bridge/generic-alpaca/utils.d.ts.map +1 -1
- package/lib-es/bridge/generic-alpaca/utils.js +1 -0
- package/lib-es/bridge/generic-alpaca/utils.js.map +1 -1
- package/lib-es/bridge/impl.d.ts +1 -1
- package/lib-es/bridge/impl.d.ts.map +1 -1
- package/lib-es/currencies/index.d.ts +1 -1
- package/lib-es/currencies/index.d.ts.map +1 -1
- package/lib-es/currencies/index.js +1 -1
- package/lib-es/currencies/index.js.map +1 -1
- package/lib-es/currencies/sortByMarketcap.test.js +1 -2
- package/lib-es/currencies/sortByMarketcap.test.js.map +1 -1
- package/lib-es/domain/getTokensWithFunds.test.js +1 -1
- package/lib-es/domain/getTokensWithFunds.test.js.map +1 -1
- package/lib-es/e2e/enum/AppInfos.d.ts +1 -1
- package/lib-es/e2e/enum/AppInfos.d.ts.map +1 -1
- package/lib-es/e2e/enum/DeviceLabels.d.ts +2 -3
- package/lib-es/e2e/enum/DeviceLabels.d.ts.map +1 -1
- package/lib-es/e2e/enum/DeviceLabels.js +1 -2
- package/lib-es/e2e/enum/DeviceLabels.js.map +1 -1
- package/lib-es/e2e/enum/Provider.d.ts.map +1 -1
- package/lib-es/e2e/enum/Provider.js +2 -2
- package/lib-es/e2e/enum/Provider.js.map +1 -1
- package/lib-es/e2e/families/solana.d.ts.map +1 -1
- package/lib-es/e2e/families/solana.js +4 -4
- package/lib-es/e2e/families/solana.js.map +1 -1
- package/lib-es/e2e/index.d.ts +0 -5
- package/lib-es/e2e/index.d.ts.map +1 -1
- package/lib-es/e2e/speculos.d.ts.map +1 -1
- package/lib-es/e2e/speculos.js +5 -4
- package/lib-es/e2e/speculos.js.map +1 -1
- package/lib-es/e2e/speculosCI.d.ts +0 -4
- package/lib-es/e2e/speculosCI.d.ts.map +1 -1
- package/lib-es/e2e/speculosCI.js +5 -14
- 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/api/v5/actions.js +1 -1
- package/lib-es/exchange/swap/api/v5/actions.js.map +1 -1
- package/lib-es/exchange/swap/types.d.ts +1 -1
- package/lib-es/exchange/swap/types.d.ts.map +1 -1
- package/lib-es/families/evm/setup.d.ts.map +1 -1
- package/lib-es/families/evm/setup.js +1 -11
- package/lib-es/families/evm/setup.js.map +1 -1
- package/lib-es/families/hedera/setup.d.ts +5 -5
- package/lib-es/families/hedera/setup.d.ts.map +1 -1
- package/lib-es/families/hedera/setup.js.map +1 -1
- package/lib-es/families/solana/setup.d.ts.map +1 -1
- package/lib-es/families/solana/setup.js +1 -2
- package/lib-es/families/solana/setup.js.map +1 -1
- package/lib-es/featureFlags/defaultFeatures.d.ts.map +1 -1
- package/lib-es/featureFlags/defaultFeatures.js +0 -1
- 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/generated/bridge/js.d.ts +1 -1
- package/lib-es/market/utils/countervalueFormatter.d.ts.map +1 -1
- package/lib-es/market/utils/countervalueFormatter.js.map +1 -1
- package/lib-es/market/utils/types.d.ts +0 -2
- package/lib-es/market/utils/types.d.ts.map +1 -1
- package/lib-es/modularDrawer/__mocks__/currencies.mock.d.ts.map +1 -1
- package/lib-es/modularDrawer/__mocks__/currencies.mock.js +1 -1
- package/lib-es/modularDrawer/__mocks__/currencies.mock.js.map +1 -1
- package/lib-es/modularDrawer/__mocks__/useGroupedCurrenciesByProvider.mock.js +1 -1
- package/lib-es/modularDrawer/__mocks__/useGroupedCurrenciesByProvider.mock.js.map +1 -1
- package/lib-es/modularDrawer/utils/__tests__/currencyUtils.test.js +1 -1
- package/lib-es/modularDrawer/utils/__tests__/currencyUtils.test.js.map +1 -1
- package/lib-es/modularDrawer/utils/__tests__/haveOneCommonProvider.test.js +1 -1
- package/lib-es/modularDrawer/utils/__tests__/haveOneCommonProvider.test.js.map +1 -1
- package/lib-es/utils/__tests__/getAccountTuplesForCurrency.test.js +1 -1
- package/lib-es/utils/__tests__/getAccountTuplesForCurrency.test.js.map +1 -1
- package/package.json +74 -76
- package/src/DataModel.test.ts +1 -1
- package/src/__tests__/accounts/groupPerDay.ts +1 -1
- package/src/__tests__/test-helpers/setup.ts +1 -1
- package/src/account/serialization.test.ts +1 -1
- package/src/bridge/crypto-assets/index.test.ts +1 -1
- package/src/bridge/crypto-assets/index.ts +2 -3
- package/src/bridge/generic-alpaca/estimateMaxSpendable.ts +5 -11
- package/src/bridge/generic-alpaca/getTransactionStatus.ts +1 -2
- package/src/bridge/generic-alpaca/prepareTransaction.ts +16 -20
- package/src/bridge/generic-alpaca/signOperation.ts +2 -3
- package/src/bridge/generic-alpaca/tests/prepareTransaction.test.ts +1 -1
- package/src/bridge/generic-alpaca/utils.ts +2 -0
- package/src/bridge/impl.ts +1 -1
- package/src/currencies/index.ts +1 -0
- package/src/currencies/sortByMarketcap.test.ts +2 -3
- package/src/domain/getTokensWithFunds.test.ts +1 -1
- package/src/e2e/enum/AppInfos.ts +1 -1
- package/src/e2e/enum/DeviceLabels.ts +1 -2
- package/src/e2e/enum/Provider.ts +2 -2
- package/src/e2e/families/solana.ts +4 -7
- package/src/e2e/speculos.ts +5 -4
- package/src/e2e/speculosCI.ts +6 -18
- package/src/exchange/swap/api/v5/actions.ts +1 -1
- package/src/exchange/swap/types.ts +1 -1
- package/src/families/bitcoin/__snapshots__/bridge.integration.test.ts.snap +0 -7
- package/src/families/bitcoin/satstack.test.ts +1 -1
- package/src/families/evm/setup.ts +1 -12
- package/src/families/hedera/__snapshots__/bridge.integration.test.ts.snap +1135 -464
- package/src/families/hedera/setup.ts +3 -7
- package/src/families/solana/setup.ts +0 -2
- package/src/families/tron/data.mock.ts +1 -1
- package/src/featureFlags/defaultFeatures.ts +0 -1
- package/src/market/utils/countervalueFormatter.ts +1 -0
- package/src/market/utils/types.ts +0 -4
- package/src/modularDrawer/__mocks__/currencies.mock.ts +1 -1
- package/src/modularDrawer/__mocks__/useGroupedCurrenciesByProvider.mock.ts +1 -1
- package/src/modularDrawer/utils/__tests__/currencyUtils.test.ts +1 -1
- package/src/modularDrawer/utils/__tests__/haveOneCommonProvider.test.ts +2 -2
- package/src/utils/__tests__/getAccountTuplesForCurrency.test.ts +1 -1
- package/lib/families/hedera/constants.d.ts +0 -2
- package/lib/families/hedera/constants.d.ts.map +0 -1
- package/lib/families/hedera/constants.js +0 -19
- package/lib/families/hedera/constants.js.map +0 -1
- package/lib/modularDrawer/data/entities/index.d.ts +0 -68
- package/lib/modularDrawer/data/entities/index.d.ts.map +0 -1
- package/lib/modularDrawer/data/entities/index.js +0 -3
- package/lib/modularDrawer/data/entities/index.js.map +0 -1
- package/lib/modularDrawer/data/state-manager/api.d.ts +0 -152
- package/lib/modularDrawer/data/state-manager/api.d.ts.map +0 -1
- package/lib/modularDrawer/data/state-manager/api.js +0 -45
- package/lib/modularDrawer/data/state-manager/api.js.map +0 -1
- package/lib/modularDrawer/hooks/__test__/useAssetsData.test.d.ts +0 -5
- package/lib/modularDrawer/hooks/__test__/useAssetsData.test.d.ts.map +0 -1
- package/lib/modularDrawer/hooks/__test__/useAssetsData.test.js +0 -120
- package/lib/modularDrawer/hooks/__test__/useAssetsData.test.js.map +0 -1
- package/lib/modularDrawer/hooks/useAssetsData.d.ts +0 -13
- package/lib/modularDrawer/hooks/useAssetsData.d.ts.map +0 -1
- package/lib/modularDrawer/hooks/useAssetsData.js +0 -31
- package/lib/modularDrawer/hooks/useAssetsData.js.map +0 -1
- package/lib/modularDrawer/utils/__tests__/counterValueFormatter.test.d.ts +0 -2
- package/lib/modularDrawer/utils/__tests__/counterValueFormatter.test.d.ts.map +0 -1
- package/lib/modularDrawer/utils/__tests__/counterValueFormatter.test.js +0 -496
- package/lib/modularDrawer/utils/__tests__/counterValueFormatter.test.js.map +0 -1
- package/lib/modularDrawer/utils/calculateProviderTotal.d.ts +0 -9
- package/lib/modularDrawer/utils/calculateProviderTotal.d.ts.map +0 -1
- package/lib/modularDrawer/utils/calculateProviderTotal.js +0 -23
- package/lib/modularDrawer/utils/calculateProviderTotal.js.map +0 -1
- package/lib/modularDrawer/utils/counterValueFormatter.d.ts +0 -14
- package/lib/modularDrawer/utils/counterValueFormatter.d.ts.map +0 -1
- package/lib/modularDrawer/utils/counterValueFormatter.js +0 -107
- package/lib/modularDrawer/utils/counterValueFormatter.js.map +0 -1
- package/lib/modularDrawer/utils/getBalanceAndFiatValueByAssets.d.ts +0 -11
- package/lib/modularDrawer/utils/getBalanceAndFiatValueByAssets.d.ts.map +0 -1
- package/lib/modularDrawer/utils/getBalanceAndFiatValueByAssets.js +0 -45
- package/lib/modularDrawer/utils/getBalanceAndFiatValueByAssets.js.map +0 -1
- package/lib/modularDrawer/utils/getProviderCurrency.d.ts +0 -3
- package/lib/modularDrawer/utils/getProviderCurrency.d.ts.map +0 -1
- package/lib/modularDrawer/utils/getProviderCurrency.js +0 -14
- package/lib/modularDrawer/utils/getProviderCurrency.js.map +0 -1
- package/lib/modularDrawer/utils/groupAccountsByAsset.d.ts +0 -11
- package/lib/modularDrawer/utils/groupAccountsByAsset.d.ts.map +0 -1
- package/lib/modularDrawer/utils/groupAccountsByAsset.js +0 -32
- package/lib/modularDrawer/utils/groupAccountsByAsset.js.map +0 -1
- package/lib/modularDrawer/utils/parseToBigNumber.d.ts +0 -9
- package/lib/modularDrawer/utils/parseToBigNumber.d.ts.map +0 -1
- package/lib/modularDrawer/utils/parseToBigNumber.js +0 -24
- package/lib/modularDrawer/utils/parseToBigNumber.js.map +0 -1
- package/lib/modularDrawer/utils/type.d.ts +0 -21
- package/lib/modularDrawer/utils/type.d.ts.map +0 -1
- package/lib/modularDrawer/utils/type.js +0 -3
- package/lib/modularDrawer/utils/type.js.map +0 -1
- package/lib-es/families/hedera/constants.d.ts +0 -2
- package/lib-es/families/hedera/constants.d.ts.map +0 -1
- package/lib-es/families/hedera/constants.js +0 -3
- package/lib-es/families/hedera/constants.js.map +0 -1
- package/lib-es/modularDrawer/data/entities/index.d.ts +0 -68
- package/lib-es/modularDrawer/data/entities/index.d.ts.map +0 -1
- package/lib-es/modularDrawer/data/entities/index.js +0 -2
- package/lib-es/modularDrawer/data/entities/index.js.map +0 -1
- package/lib-es/modularDrawer/data/state-manager/api.d.ts +0 -152
- package/lib-es/modularDrawer/data/state-manager/api.d.ts.map +0 -1
- package/lib-es/modularDrawer/data/state-manager/api.js +0 -42
- package/lib-es/modularDrawer/data/state-manager/api.js.map +0 -1
- package/lib-es/modularDrawer/hooks/__test__/useAssetsData.test.d.ts +0 -5
- package/lib-es/modularDrawer/hooks/__test__/useAssetsData.test.d.ts.map +0 -1
- package/lib-es/modularDrawer/hooks/__test__/useAssetsData.test.js +0 -118
- package/lib-es/modularDrawer/hooks/__test__/useAssetsData.test.js.map +0 -1
- package/lib-es/modularDrawer/hooks/useAssetsData.d.ts +0 -13
- package/lib-es/modularDrawer/hooks/useAssetsData.d.ts.map +0 -1
- package/lib-es/modularDrawer/hooks/useAssetsData.js +0 -27
- package/lib-es/modularDrawer/hooks/useAssetsData.js.map +0 -1
- package/lib-es/modularDrawer/utils/__tests__/counterValueFormatter.test.d.ts +0 -2
- package/lib-es/modularDrawer/utils/__tests__/counterValueFormatter.test.d.ts.map +0 -1
- package/lib-es/modularDrawer/utils/__tests__/counterValueFormatter.test.js +0 -494
- package/lib-es/modularDrawer/utils/__tests__/counterValueFormatter.test.js.map +0 -1
- package/lib-es/modularDrawer/utils/calculateProviderTotal.d.ts +0 -9
- package/lib-es/modularDrawer/utils/calculateProviderTotal.d.ts.map +0 -1
- package/lib-es/modularDrawer/utils/calculateProviderTotal.js +0 -16
- package/lib-es/modularDrawer/utils/calculateProviderTotal.js.map +0 -1
- package/lib-es/modularDrawer/utils/counterValueFormatter.d.ts +0 -14
- package/lib-es/modularDrawer/utils/counterValueFormatter.d.ts.map +0 -1
- package/lib-es/modularDrawer/utils/counterValueFormatter.js +0 -103
- package/lib-es/modularDrawer/utils/counterValueFormatter.js.map +0 -1
- package/lib-es/modularDrawer/utils/getBalanceAndFiatValueByAssets.d.ts +0 -11
- package/lib-es/modularDrawer/utils/getBalanceAndFiatValueByAssets.d.ts.map +0 -1
- package/lib-es/modularDrawer/utils/getBalanceAndFiatValueByAssets.js +0 -41
- package/lib-es/modularDrawer/utils/getBalanceAndFiatValueByAssets.js.map +0 -1
- package/lib-es/modularDrawer/utils/getProviderCurrency.d.ts +0 -3
- package/lib-es/modularDrawer/utils/getProviderCurrency.d.ts.map +0 -1
- package/lib-es/modularDrawer/utils/getProviderCurrency.js +0 -10
- package/lib-es/modularDrawer/utils/getProviderCurrency.js.map +0 -1
- package/lib-es/modularDrawer/utils/groupAccountsByAsset.d.ts +0 -11
- package/lib-es/modularDrawer/utils/groupAccountsByAsset.d.ts.map +0 -1
- package/lib-es/modularDrawer/utils/groupAccountsByAsset.js +0 -25
- package/lib-es/modularDrawer/utils/groupAccountsByAsset.js.map +0 -1
- package/lib-es/modularDrawer/utils/parseToBigNumber.d.ts +0 -9
- package/lib-es/modularDrawer/utils/parseToBigNumber.d.ts.map +0 -1
- package/lib-es/modularDrawer/utils/parseToBigNumber.js +0 -17
- package/lib-es/modularDrawer/utils/parseToBigNumber.js.map +0 -1
- package/lib-es/modularDrawer/utils/type.d.ts +0 -21
- package/lib-es/modularDrawer/utils/type.d.ts.map +0 -1
- package/lib-es/modularDrawer/utils/type.js +0 -2
- package/lib-es/modularDrawer/utils/type.js.map +0 -1
- package/src/families/hedera/constants.ts +0 -2
- package/src/modularDrawer/data/entities/index.ts +0 -79
- package/src/modularDrawer/data/state-manager/api.ts +0 -62
- package/src/modularDrawer/hooks/__test__/useAssetsData.test.ts +0 -139
- package/src/modularDrawer/hooks/useAssetsData.ts +0 -36
- package/src/modularDrawer/utils/__tests__/counterValueFormatter.test.ts +0 -549
- package/src/modularDrawer/utils/calculateProviderTotal.ts +0 -23
- package/src/modularDrawer/utils/counterValueFormatter.ts +0 -165
- package/src/modularDrawer/utils/getBalanceAndFiatValueByAssets.ts +0 -76
- package/src/modularDrawer/utils/getProviderCurrency.ts +0 -13
- package/src/modularDrawer/utils/groupAccountsByAsset.ts +0 -51
- package/src/modularDrawer/utils/parseToBigNumber.ts +0 -17
- package/src/modularDrawer/utils/type.ts +0 -22
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.46.0
|
4
|
+
"version": "34.46.0",
|
5
5
|
"repository": {
|
6
6
|
"type": "git",
|
7
7
|
"url": "https://github.com/LedgerHQ/ledger-live.git"
|
@@ -111,8 +111,7 @@
|
|
111
111
|
"@ledgerhq/wallet-api-client": "^1.9.1",
|
112
112
|
"@ledgerhq/wallet-api-core": "^1.21.1",
|
113
113
|
"@ledgerhq/wallet-api-server": "^1.10.1",
|
114
|
-
"@
|
115
|
-
"@stellar/stellar-sdk": "^14.0.0",
|
114
|
+
"@stellar/stellar-sdk": "^11.3.0",
|
116
115
|
"@stricahq/typhonjs": "^3.0.0",
|
117
116
|
"@taquito/ledger-signer": "^22.0.0",
|
118
117
|
"@ton-community/ton-ledger": "^7.2.0",
|
@@ -130,7 +129,7 @@
|
|
130
129
|
"@zondax/ledger-mina-js": "0.0.2",
|
131
130
|
"@zondax/ledger-stacks": "^1.0.2",
|
132
131
|
"async": "^3.2.3",
|
133
|
-
"axios": "1.
|
132
|
+
"axios": "1.7.7",
|
134
133
|
"bech32": "^1.1.3",
|
135
134
|
"bignumber.js": "^9.1.2",
|
136
135
|
"bip32": "^2.0.6",
|
@@ -139,7 +138,6 @@
|
|
139
138
|
"date-fns": "^2.23.0",
|
140
139
|
"expect": "^27.4.6",
|
141
140
|
"fuse.js": "^6.6.2",
|
142
|
-
"i18next": "20.6.1",
|
143
141
|
"invariant": "^2.2.2",
|
144
142
|
"isomorphic-ws": "^4.0.1",
|
145
143
|
"jotai": "2.12.4",
|
@@ -165,76 +163,76 @@
|
|
165
163
|
"xstate": "^5.19.2",
|
166
164
|
"yargs": "^17.0.0",
|
167
165
|
"zod": "^3.22.4",
|
168
|
-
"@ledgerhq/coin-algorand": "^0.9.18
|
169
|
-
"@ledgerhq/coin-aptos": "^3.1.1
|
170
|
-
"@ledgerhq/coin-bitcoin": "^0.
|
171
|
-
"@ledgerhq/coin-canton": "^0.
|
172
|
-
"@ledgerhq/coin-cardano": "^0.11.2
|
173
|
-
"@ledgerhq/coin-casper": "^2.0.9
|
174
|
-
"@ledgerhq/coin-celo": "^1.2.1
|
175
|
-
"@ledgerhq/coin-cosmos": "^0.16.7
|
176
|
-
"@ledgerhq/coin-evm": "^2.28.0
|
177
|
-
"@ledgerhq/coin-filecoin": "^1.10.1
|
178
|
-
"@ledgerhq/coin-framework": "^6.2.0
|
179
|
-
"@ledgerhq/coin-hedera": "^1.
|
180
|
-
"@ledgerhq/coin-icon": "^0.11.5
|
181
|
-
"@ledgerhq/coin-internet_computer": "^1.7.18
|
182
|
-
"@ledgerhq/coin-mina": "^1.1.17
|
183
|
-
"@ledgerhq/coin-multiversx": "^0.4.18
|
184
|
-
"@ledgerhq/coin-near": "^0.12.1
|
185
|
-
"@ledgerhq/coin-polkadot": "^6.
|
186
|
-
"@ledgerhq/coin-solana": "^0.
|
187
|
-
"@ledgerhq/coin-stacks": "^0.8.18
|
188
|
-
"@ledgerhq/coin-stellar": "^6.2.0
|
189
|
-
"@ledgerhq/coin-sui": "^0.
|
190
|
-
"@ledgerhq/coin-tezos": "^6.
|
191
|
-
"@ledgerhq/coin-ton": "^0.13.7
|
192
|
-
"@ledgerhq/coin-tron": "^5.
|
193
|
-
"@ledgerhq/coin-vechain": "^2.8.2
|
194
|
-
"@ledgerhq/coin-xrp": "^7.2.0
|
195
|
-
"@ledgerhq/crypto-icons-ui": "^1.
|
196
|
-
"@ledgerhq/cryptoassets": "^13.26.0
|
197
|
-
"@ledgerhq/device-core": "^0.6.1
|
198
|
-
"@ledgerhq/devices": "8.5.
|
199
|
-
"@ledgerhq/errors": "^6.
|
200
|
-
"@ledgerhq/hw-app-algorand": "^6.31.
|
201
|
-
"@ledgerhq/hw-app-aptos": "^6.34.
|
202
|
-
"@ledgerhq/hw-app-btc": "^10.10.
|
203
|
-
"@ledgerhq/hw-app-celo": "^6.34.1
|
204
|
-
"@ledgerhq/hw-app-cosmos": "^6.32.
|
205
|
-
"@ledgerhq/hw-app-eth": "^6.45.16
|
206
|
-
"@ledgerhq/hw-app-exchange": "^0.
|
207
|
-
"@ledgerhq/hw-app-hedera": "^1.2.
|
208
|
-
"@ledgerhq/hw-app-icon": "^1.3.
|
209
|
-
"@ledgerhq/hw-app-multiversx": "^6.25.
|
210
|
-
"@ledgerhq/hw-app-near": "^6.31.
|
211
|
-
"@ledgerhq/hw-app-polkadot": "^6.34.
|
212
|
-
"@ledgerhq/hw-app-str": "^7.2.
|
213
|
-
"@ledgerhq/hw-app-sui": "^1.3.0
|
214
|
-
"@ledgerhq/hw-app-tezos": "^6.31.
|
215
|
-
"@ledgerhq/hw-app-trx": "^6.31.
|
216
|
-
"@ledgerhq/hw-app-vet": "^0.5.14
|
217
|
-
"@ledgerhq/hw-app-xrp": "^6.32.
|
218
|
-
"@ledgerhq/hw-transport": "^6.31.
|
219
|
-
"@ledgerhq/hw-transport-mocker": "^6.29.
|
220
|
-
"@ledgerhq/ledger-cal-service": "^1.3.
|
221
|
-
"@ledgerhq/live-config": "^3.
|
222
|
-
"@ledgerhq/live-countervalues": "^0.
|
223
|
-
"@ledgerhq/live-countervalues-react": "^0.
|
224
|
-
"@ledgerhq/live-dmk-shared": "^0.12.1
|
225
|
-
"@ledgerhq/live-env": "^2.
|
166
|
+
"@ledgerhq/coin-algorand": "^0.9.18",
|
167
|
+
"@ledgerhq/coin-aptos": "^3.1.1",
|
168
|
+
"@ledgerhq/coin-bitcoin": "^0.20.2",
|
169
|
+
"@ledgerhq/coin-canton": "^0.3.0",
|
170
|
+
"@ledgerhq/coin-cardano": "^0.11.2",
|
171
|
+
"@ledgerhq/coin-casper": "^2.0.9",
|
172
|
+
"@ledgerhq/coin-celo": "^1.2.1",
|
173
|
+
"@ledgerhq/coin-cosmos": "^0.16.7",
|
174
|
+
"@ledgerhq/coin-evm": "^2.28.0",
|
175
|
+
"@ledgerhq/coin-filecoin": "^1.10.1",
|
176
|
+
"@ledgerhq/coin-framework": "^6.2.0",
|
177
|
+
"@ledgerhq/coin-hedera": "^1.10.1",
|
178
|
+
"@ledgerhq/coin-icon": "^0.11.5",
|
179
|
+
"@ledgerhq/coin-internet_computer": "^1.7.18",
|
180
|
+
"@ledgerhq/coin-mina": "^1.1.17",
|
181
|
+
"@ledgerhq/coin-multiversx": "^0.4.18",
|
182
|
+
"@ledgerhq/coin-near": "^0.12.1",
|
183
|
+
"@ledgerhq/coin-polkadot": "^6.8.0",
|
184
|
+
"@ledgerhq/coin-solana": "^0.31.1",
|
185
|
+
"@ledgerhq/coin-stacks": "^0.8.18",
|
186
|
+
"@ledgerhq/coin-stellar": "^6.2.0",
|
187
|
+
"@ledgerhq/coin-sui": "^0.11.0",
|
188
|
+
"@ledgerhq/coin-tezos": "^6.2.0",
|
189
|
+
"@ledgerhq/coin-ton": "^0.13.7",
|
190
|
+
"@ledgerhq/coin-tron": "^5.2.0",
|
191
|
+
"@ledgerhq/coin-vechain": "^2.8.2",
|
192
|
+
"@ledgerhq/coin-xrp": "^7.2.0",
|
193
|
+
"@ledgerhq/crypto-icons-ui": "^1.17.0",
|
194
|
+
"@ledgerhq/cryptoassets": "^13.26.0",
|
195
|
+
"@ledgerhq/device-core": "^0.6.1",
|
196
|
+
"@ledgerhq/devices": "8.5.0",
|
197
|
+
"@ledgerhq/errors": "^6.24.0",
|
198
|
+
"@ledgerhq/hw-app-algorand": "^6.31.5",
|
199
|
+
"@ledgerhq/hw-app-aptos": "^6.34.5",
|
200
|
+
"@ledgerhq/hw-app-btc": "^10.10.1",
|
201
|
+
"@ledgerhq/hw-app-celo": "^6.34.1",
|
202
|
+
"@ledgerhq/hw-app-cosmos": "^6.32.5",
|
203
|
+
"@ledgerhq/hw-app-eth": "^6.45.16",
|
204
|
+
"@ledgerhq/hw-app-exchange": "^0.13.0",
|
205
|
+
"@ledgerhq/hw-app-hedera": "^1.2.5",
|
206
|
+
"@ledgerhq/hw-app-icon": "^1.3.5",
|
207
|
+
"@ledgerhq/hw-app-multiversx": "^6.25.0",
|
208
|
+
"@ledgerhq/hw-app-near": "^6.31.5",
|
209
|
+
"@ledgerhq/hw-app-polkadot": "^6.34.5",
|
210
|
+
"@ledgerhq/hw-app-str": "^7.2.5",
|
211
|
+
"@ledgerhq/hw-app-sui": "^1.3.0",
|
212
|
+
"@ledgerhq/hw-app-tezos": "^6.31.5",
|
213
|
+
"@ledgerhq/hw-app-trx": "^6.31.5",
|
214
|
+
"@ledgerhq/hw-app-vet": "^0.5.14",
|
215
|
+
"@ledgerhq/hw-app-xrp": "^6.32.3",
|
216
|
+
"@ledgerhq/hw-transport": "^6.31.9",
|
217
|
+
"@ledgerhq/hw-transport-mocker": "^6.29.9",
|
218
|
+
"@ledgerhq/ledger-cal-service": "^1.3.0",
|
219
|
+
"@ledgerhq/live-config": "^3.1.0",
|
220
|
+
"@ledgerhq/live-countervalues": "^0.6.2",
|
221
|
+
"@ledgerhq/live-countervalues-react": "^0.5.0",
|
222
|
+
"@ledgerhq/live-dmk-shared": "^0.12.1",
|
223
|
+
"@ledgerhq/live-env": "^2.14.0",
|
226
224
|
"@ledgerhq/live-hooks": "0.1.0",
|
227
|
-
"@ledgerhq/live-network": "^2.0.
|
228
|
-
"@ledgerhq/live-nft": "^0.8.18
|
225
|
+
"@ledgerhq/live-network": "^2.0.15",
|
226
|
+
"@ledgerhq/live-nft": "^0.8.18",
|
229
227
|
"@ledgerhq/live-promise": "^0.1.1",
|
230
|
-
"@ledgerhq/live-signer-
|
231
|
-
"@ledgerhq/live-signer-
|
232
|
-
"@ledgerhq/live-signer-
|
233
|
-
"@ledgerhq/live-wallet": "^0.
|
228
|
+
"@ledgerhq/live-signer-evm": "^0.7.1",
|
229
|
+
"@ledgerhq/live-signer-solana": "^0.5.3",
|
230
|
+
"@ledgerhq/live-signer-canton": "^0.2.2",
|
231
|
+
"@ledgerhq/live-wallet": "^0.12.2",
|
234
232
|
"@ledgerhq/logs": "^6.13.0",
|
235
|
-
"@ledgerhq/speculos-transport": "^0.2.
|
233
|
+
"@ledgerhq/speculos-transport": "^0.2.8",
|
236
234
|
"@ledgerhq/wallet-api-acre-module": "^0.6.0",
|
237
|
-
"@ledgerhq/wallet-api-exchange-module": "^0.
|
235
|
+
"@ledgerhq/wallet-api-exchange-module": "^0.15.0"
|
238
236
|
},
|
239
237
|
"devDependencies": {
|
240
238
|
"@solana/web3.js": "1.95.4",
|
@@ -282,10 +280,10 @@
|
|
282
280
|
"undici": "6.19.2",
|
283
281
|
"uuid": "^8.3.2",
|
284
282
|
"ws": "7",
|
285
|
-
"@ledgerhq/device-react": "^0.2.42
|
286
|
-
"@ledgerhq/types-cryptoassets": "^7.
|
287
|
-
"@ledgerhq/types-devices": "^6.
|
288
|
-
"@ledgerhq/types-live": "^6.82.0
|
283
|
+
"@ledgerhq/device-react": "^0.2.42",
|
284
|
+
"@ledgerhq/types-cryptoassets": "^7.25.0",
|
285
|
+
"@ledgerhq/types-devices": "^6.27.0",
|
286
|
+
"@ledgerhq/types-live": "^6.82.0"
|
289
287
|
},
|
290
288
|
"scripts": {
|
291
289
|
"build": "zx ./scripts/build-ts.mjs",
|
@@ -307,6 +305,6 @@
|
|
307
305
|
"test-bridge-update": "UPDATE_BACKEND_MOCKS=1 env-cmd -f .ci.integration.env pnpm jest --ci --updateSnapshot --passWithNoTests",
|
308
306
|
"test-account-migration": "tsx src/__tests__/migration/account-migration.ts",
|
309
307
|
"unimported": "unimported",
|
310
|
-
"coverage": "env-cmd -f .ci.unit.env pnpm jest --coverage --ci --updateSnapshot"
|
308
|
+
"coverage": "env-cmd -f .ci.unit.env pnpm jest --coverage --ci --updateSnapshot && git diff --exit-code src"
|
311
309
|
}
|
312
310
|
}
|
package/src/DataModel.test.ts
CHANGED
@@ -7,7 +7,7 @@ import { accountRawToAccountUserData } from "@ledgerhq/live-wallet/store";
|
|
7
7
|
import { createDataModel } from "./DataModel";
|
8
8
|
import { fromAccountRaw, toAccountRaw } from "./account";
|
9
9
|
import { getCurrencyConfiguration } from "./config";
|
10
|
-
import
|
10
|
+
import { CryptoAssetsStore } from "@ledgerhq/coin-framework/crypto-assets/type";
|
11
11
|
import { setCryptoAssetsStore as setCryptoAssetsStoreForCoinFramework } from "@ledgerhq/coin-framework/crypto-assets/index";
|
12
12
|
|
13
13
|
jest.mock("./config", () => ({
|
@@ -2,7 +2,7 @@ import flatMap from "lodash/flatMap";
|
|
2
2
|
import { fromAccountRaw, groupAccountOperationsByDay } from "../../account";
|
3
3
|
import { TezosAccountRaw } from "../../families/tezos/types";
|
4
4
|
import { setSupportedCurrencies } from "../../currencies";
|
5
|
-
import
|
5
|
+
import { CryptoAssetsStore } from "@ledgerhq/coin-framework/crypto-assets/type";
|
6
6
|
import { setup } from "../../bridge/impl";
|
7
7
|
import { LiveConfig } from "@ledgerhq/live-config/LiveConfig";
|
8
8
|
setSupportedCurrencies(["tezos"]);
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { setCryptoAssetsStore as setCryptoAssetsStoreForCoinFramework } from "@ledgerhq/coin-framework/crypto-assets/index";
|
2
|
-
import
|
2
|
+
import { CryptoAssetsStore } from "@ledgerhq/coin-framework/crypto-assets/type";
|
3
3
|
import "./environment";
|
4
4
|
import BigNumber from "bignumber.js";
|
5
5
|
|
@@ -4,7 +4,7 @@ import { toAccountRaw, fromAccountRaw } from "./serialization";
|
|
4
4
|
import { setWalletAPIVersion } from "../wallet-api/version";
|
5
5
|
import { WALLET_API_VERSION } from "../wallet-api/constants";
|
6
6
|
import { setCryptoAssetsStore as setCryptoAssetsStoreForCoinFramework } from "@ledgerhq/coin-framework/crypto-assets/index";
|
7
|
-
import
|
7
|
+
import { CryptoAssetsStore } from "@ledgerhq/coin-framework/crypto-assets/type";
|
8
8
|
import solanaSplTokenData from "../__fixtures__/solana-spl-epjfwdd5aufqssqem2qn1xzybapc8g4weggkzwytdt1v.json";
|
9
9
|
import { TokenCurrency } from "@ledgerhq/types-cryptoassets";
|
10
10
|
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import { LiveConfig } from "@ledgerhq/live-config/LiveConfig";
|
2
2
|
import { getCryptoAssetsStore, setCryptoAssetsStore } from ".";
|
3
3
|
import * as legacy from "@ledgerhq/cryptoassets/tokens";
|
4
|
-
import
|
4
|
+
import { CryptoAssetsStore } from "@ledgerhq/coin-framework/crypto-assets/type";
|
5
5
|
|
6
6
|
describe("Testing CryptoAssetStore", () => {
|
7
7
|
it("should return the default methods from cryptoassets libs when feature flag does not exists", () => {
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { LiveConfig } from "@ledgerhq/live-config/LiveConfig";
|
2
|
+
import { CryptoAssetsStore } from "@ledgerhq/coin-framework/crypto-assets/type";
|
2
3
|
import * as legacy from "@ledgerhq/cryptoassets/tokens";
|
3
|
-
import type { CryptoAssetsStore } from "@ledgerhq/types-live";
|
4
4
|
|
5
5
|
const legacyStore: CryptoAssetsStore = {
|
6
6
|
findTokenByAddress: legacy.findTokenByAddress,
|
@@ -17,8 +17,7 @@ export function setCryptoAssetsStore(store: CryptoAssetsStore) {
|
|
17
17
|
}
|
18
18
|
|
19
19
|
export function getCryptoAssetsStore(): CryptoAssetsStore {
|
20
|
-
const featureEnabled =
|
21
|
-
LiveConfig.isConfigSet() && LiveConfig.getValueByKey("feature_cal_lazy_loading");
|
20
|
+
const featureEnabled = LiveConfig.getValueByKey("feature_cal_lazy_loading");
|
22
21
|
if (!featureEnabled) {
|
23
22
|
return legacyStore;
|
24
23
|
}
|
@@ -19,24 +19,18 @@ export function genericEstimateMaxSpendable(
|
|
19
19
|
...transaction,
|
20
20
|
amount: mainAccount.spendableBalance,
|
21
21
|
useAllAmount: true,
|
22
|
+
fees: transaction?.fees ? BigInt(transaction.fees.toString()) : 0n,
|
22
23
|
};
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
fees = (
|
27
|
-
await getAlpacaApi(network, kind).estimateFees(
|
28
|
-
transactionToIntent(mainAccount, draftTransaction),
|
29
|
-
)
|
30
|
-
).value;
|
31
|
-
}
|
24
|
+
const fees = await getAlpacaApi(network, kind).estimateFees(
|
25
|
+
transactionToIntent(mainAccount, draftTransaction),
|
26
|
+
);
|
32
27
|
const { amount } = await getAlpacaApi(network, kind).validateIntent(
|
33
28
|
transactionToIntent(account, { ...draftTransaction }),
|
34
|
-
{ value: transaction?.fees ? BigInt(transaction.fees.toString()) : 0n },
|
35
29
|
);
|
36
30
|
if (network === "stellar") {
|
37
31
|
return amount > 0 ? new BigNumber(amount.toString()) : new BigNumber(0);
|
38
32
|
}
|
39
|
-
const bnFee = BigNumber(fees.toString());
|
33
|
+
const bnFee = BigNumber(fees.value.toString());
|
40
34
|
return BigNumber.max(0, account.spendableBalance.minus(bnFee));
|
41
35
|
};
|
42
36
|
}
|
@@ -3,7 +3,6 @@ import { AccountAwaitingSendPendingOperations } from "@ledgerhq/errors";
|
|
3
3
|
import BigNumber from "bignumber.js";
|
4
4
|
import { getAlpacaApi } from "./alpaca";
|
5
5
|
import { transactionToIntent } from "./utils";
|
6
|
-
// import { FeeEstimation } from "@ledgerhq/coin-framework/api/types";
|
7
6
|
|
8
7
|
// => alpaca validateIntent
|
9
8
|
export function genericGetTransactionStatus(
|
@@ -27,6 +26,7 @@ export function genericGetTransactionStatus(
|
|
27
26
|
mode: transaction?.mode,
|
28
27
|
recipient: transaction.recipient,
|
29
28
|
amount: transaction.amount ?? new BigNumber(0),
|
29
|
+
fees: transaction.fees ? BigInt(transaction.fees.toString()) : 0n,
|
30
30
|
useAllAmount: !!transaction.useAllAmount,
|
31
31
|
assetReference: transaction.assetReference || "",
|
32
32
|
assetOwner: transaction.assetOwner || "",
|
@@ -46,7 +46,6 @@ export function genericGetTransactionStatus(
|
|
46
46
|
|
47
47
|
const { errors, warnings, estimatedFees, amount, totalSpent } = await alpacaApi.validateIntent(
|
48
48
|
transactionToIntent(account, draftTransaction),
|
49
|
-
{ value: transaction.fees ? BigInt(transaction.fees.toString()) : 0n },
|
50
49
|
);
|
51
50
|
|
52
51
|
return Promise.resolve({
|
@@ -2,7 +2,7 @@ import { Account, AccountBridge, TransactionCommon } from "@ledgerhq/types-live"
|
|
2
2
|
import { getAlpacaApi } from "./alpaca";
|
3
3
|
import { transactionToIntent } from "./utils";
|
4
4
|
import BigNumber from "bignumber.js";
|
5
|
-
import {
|
5
|
+
import { NetworkInfo } from "./createTransaction";
|
6
6
|
|
7
7
|
function bnEq(a: BigNumber | null | undefined, b: BigNumber | null | undefined): boolean {
|
8
8
|
return !a && !b ? true : !a || !b ? false : a.eq(b);
|
@@ -16,35 +16,31 @@ export function genericPrepareTransaction(
|
|
16
16
|
account,
|
17
17
|
transaction: TransactionCommon & {
|
18
18
|
fees: BigNumber | null | undefined;
|
19
|
-
customFees?: FeeEstimation;
|
20
19
|
assetReference?: string;
|
21
20
|
assetOwner?: string;
|
22
21
|
subAccountId?: string;
|
22
|
+
networkInfo?: NetworkInfo | null;
|
23
23
|
},
|
24
24
|
) => {
|
25
25
|
const [assetReference, assetOwner] = getAssetInfos(transaction);
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
if (!bnEq(transaction.fees, new BigNumber(fees.toString()))) {
|
26
|
+
const fees = await getAlpacaApi(network, kind).estimateFees(
|
27
|
+
transactionToIntent(account, {
|
28
|
+
...transaction,
|
29
|
+
fees: transaction.fees ? BigInt(transaction.fees.toString()) : 0n,
|
30
|
+
}),
|
31
|
+
);
|
32
|
+
// NOTE: this is problematic, we should maybe have a method / object that lists what field warrant an update per chain
|
33
|
+
// for reference, stellar checked this:
|
34
|
+
// transaction.networkInfo !== networkInfo ||
|
35
|
+
// transaction.baseReserve !== baseReserve
|
36
|
+
if (!bnEq(transaction.fees, new BigNumber(fees.value.toString()))) {
|
39
37
|
return {
|
40
38
|
...transaction,
|
41
|
-
fees: new BigNumber(fees.toString()),
|
39
|
+
fees: new BigNumber(fees.value.toString()),
|
42
40
|
assetReference,
|
43
41
|
assetOwner,
|
44
|
-
|
45
|
-
|
46
|
-
fees: new BigNumber(fees.toString()),
|
47
|
-
},
|
42
|
+
networkInfo: {
|
43
|
+
fees: new BigNumber(fees.value.toString()),
|
48
44
|
},
|
49
45
|
};
|
50
46
|
}
|
@@ -95,6 +95,7 @@ export const genericSignOperation =
|
|
95
95
|
const draftTransaction = {
|
96
96
|
recipient: transaction.recipient,
|
97
97
|
amount: transaction.amount ?? 0,
|
98
|
+
fees: fees,
|
98
99
|
useAllAmount: !!transaction.useAllAmount,
|
99
100
|
assetReference: transaction?.["assetReference"] || "",
|
100
101
|
assetOwner: transaction?.["assetOwner"] || "",
|
@@ -102,7 +103,6 @@ export const genericSignOperation =
|
|
102
103
|
};
|
103
104
|
const { amount } = await getAlpacaApi(network, kind).validateIntent(
|
104
105
|
transactionToIntent(account, draftTransaction),
|
105
|
-
{ value: fees },
|
106
106
|
);
|
107
107
|
transaction.amount = new BigNumber(amount.toString());
|
108
108
|
}
|
@@ -110,7 +110,7 @@ export const genericSignOperation =
|
|
110
110
|
const derivationPath = account.freshAddressPath;
|
111
111
|
const { publicKey } = (await signer.getAddress(derivationPath)) as Result;
|
112
112
|
|
113
|
-
let transactionIntent = transactionToIntent(account, { ...transaction });
|
113
|
+
let transactionIntent = transactionToIntent(account, { ...transaction, fees });
|
114
114
|
transactionIntent.senderPublicKey = publicKey;
|
115
115
|
|
116
116
|
// Enrich with memo and asset information
|
@@ -125,7 +125,6 @@ export const genericSignOperation =
|
|
125
125
|
/* Craft unsigned blob via Alpaca */
|
126
126
|
const unsigned: string = await getAlpacaApi(network, kind).craftTransaction(
|
127
127
|
transactionIntent,
|
128
|
-
{ value: fees },
|
129
128
|
);
|
130
129
|
|
131
130
|
/* Notify UI that the device is now showing the tx */
|
@@ -47,7 +47,7 @@ describe("genericPrepareTransaction", () => {
|
|
47
47
|
expect((result as any).fees.toString()).toBe(newFee.toString());
|
48
48
|
expect(transactionToIntent).toHaveBeenCalledWith(
|
49
49
|
account,
|
50
|
-
expect.objectContaining(baseTransaction),
|
50
|
+
expect.objectContaining({ ...baseTransaction, fees: 500n }),
|
51
51
|
);
|
52
52
|
});
|
53
53
|
|
@@ -94,6 +94,7 @@ export function transactionToIntent(
|
|
94
94
|
assetOwner?: string;
|
95
95
|
assetReference?: string;
|
96
96
|
mode?: string;
|
97
|
+
fees?: bigint | null | undefined;
|
97
98
|
memoType?: string;
|
98
99
|
memoValue?: string;
|
99
100
|
useAllAmount?: boolean;
|
@@ -113,6 +114,7 @@ export function transactionToIntent(
|
|
113
114
|
}
|
114
115
|
}
|
115
116
|
const res: TransactionIntent & { memo?: { type: string; value?: string } } = {
|
117
|
+
fees: transaction?.fees ? transaction.fees : null,
|
116
118
|
type: transactionType,
|
117
119
|
sender: account.freshAddress,
|
118
120
|
recipient: transaction.recipient,
|
package/src/bridge/impl.ts
CHANGED
@@ -20,7 +20,7 @@ import {
|
|
20
20
|
import { getAlpacaAccountBridge } from "./generic-alpaca/accountBridge";
|
21
21
|
import { getAlpacaCurrencyBridge } from "./generic-alpaca/currencyBridge";
|
22
22
|
import { AddressesSanctionedError } from "@ledgerhq/coin-framework/sanction/errors";
|
23
|
-
import
|
23
|
+
import { CryptoAssetsStore } from "@ledgerhq/coin-framework/crypto-assets/type";
|
24
24
|
import { setCryptoAssetsStore as setCryptoAssetsStoreForCoinFramework } from "@ledgerhq/coin-framework/crypto-assets/index";
|
25
25
|
import { getCryptoAssetsStore, setCryptoAssetsStore } from "./crypto-assets";
|
26
26
|
|
package/src/currencies/index.ts
CHANGED
@@ -1,10 +1,9 @@
|
|
1
1
|
import { sortCurrenciesByIds } from "./sortByMarketcap";
|
2
|
-
import { listCryptoCurrencies, listTokens } from ".";
|
2
|
+
import { findCurrencyByTicker, listCryptoCurrencies, listTokens } from ".";
|
3
3
|
import { getBTCValues } from "@ledgerhq/live-countervalues/mock";
|
4
4
|
import { CURRENCIES_LIST, IDS } from "./mock";
|
5
5
|
import { setCryptoAssetsStore as setCryptoAssetsStoreForCoinFramework } from "@ledgerhq/coin-framework/crypto-assets/index";
|
6
|
-
import
|
7
|
-
import { findCurrencyByTicker } from "@ledgerhq/live-countervalues/findCurrencyByTicker";
|
6
|
+
import { CryptoAssetsStore } from "@ledgerhq/coin-framework/crypto-assets/type";
|
8
7
|
|
9
8
|
// eslint-disable-next-line @typescript-eslint/consistent-type-assertions
|
10
9
|
setCryptoAssetsStoreForCoinFramework({
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { genAccount } from "@ledgerhq/coin-framework/lib/mocks/account";
|
2
|
-
import { getCryptoCurrencyById } from "
|
2
|
+
import { getCryptoCurrencyById } from "@ledgerhq/live-common/currencies/index";
|
3
3
|
import { Account } from "@ledgerhq/types-live";
|
4
4
|
import BigNumber from "bignumber.js";
|
5
5
|
import { getTokensWithFunds } from "./getTokensWithFunds";
|
package/src/e2e/enum/AppInfos.ts
CHANGED
@@ -8,6 +8,7 @@ export enum DeviceLabels {
|
|
8
8
|
ACCEPT = "Accept",
|
9
9
|
TRANSFER = "Transfer",
|
10
10
|
RECIPIENT = "Recipient",
|
11
|
+
PUBKEY = "Pubkey",
|
11
12
|
DEST = "Dest",
|
12
13
|
CAPS_APPROVE = "APPROVE",
|
13
14
|
CAPS_REJECT = "REJECT",
|
@@ -52,6 +53,4 @@ export enum DeviceLabels {
|
|
52
53
|
VERIFY_BSC = "Verify BSC",
|
53
54
|
SIGN_TRANSACTION = "Sign transaction",
|
54
55
|
VERIFY_POLYGON = "Verify Polygon",
|
55
|
-
VERIFY_SOLANA_ADDRESS = "Verify Solana address",
|
56
|
-
REVIEW_TRANSACTION = "Review transaction",
|
57
56
|
}
|
package/src/e2e/enum/Provider.ts
CHANGED
@@ -16,8 +16,8 @@ export class Provider {
|
|
16
16
|
static readonly LIFI = new Provider("lifi", "LI.FI", false, true, false);
|
17
17
|
static readonly CIC = new Provider("cic", "CIC", false, true, true);
|
18
18
|
static readonly COINBASE = new Provider("coinbase", "Coinbase", false, true, true);
|
19
|
-
static readonly KILN = new Provider("
|
20
|
-
static readonly STADER_LABS = new Provider("stader
|
19
|
+
static readonly KILN = new Provider("kiln", "Kiln staking Pool", false, true, true);
|
20
|
+
static readonly STADER_LABS = new Provider("stader", "Stader Labs", false, true, true);
|
21
21
|
static readonly LIDO = new Provider("lido", "Lido", false, true, true);
|
22
22
|
static readonly TRANSAK = new Provider("transak", "Transak", false, true, true);
|
23
23
|
|
@@ -5,20 +5,17 @@ import { Device } from "../enum/Device";
|
|
5
5
|
import { Transaction } from "../models/Transaction";
|
6
6
|
|
7
7
|
export async function delegateSolana() {
|
8
|
-
await waitFor(DeviceLabels.
|
9
|
-
await pressUntilTextFound(DeviceLabels.
|
8
|
+
await waitFor(DeviceLabels.DELEGATE_FROM);
|
9
|
+
await pressUntilTextFound(DeviceLabels.APPROVE);
|
10
10
|
await pressBoth();
|
11
11
|
}
|
12
12
|
|
13
13
|
export async function sendSolana(tx: Transaction) {
|
14
|
-
const events = await pressUntilTextFound(DeviceLabels.
|
14
|
+
const events = await pressUntilTextFound(DeviceLabels.APPROVE);
|
15
15
|
const isAmountCorrect = containsSubstringInEvent(tx.amount, events);
|
16
16
|
expect(isAmountCorrect).toBeTruthy();
|
17
17
|
if (process.env.SPECULOS_DEVICE !== Device.LNS) {
|
18
|
-
const isAddressCorrect = containsSubstringInEvent(
|
19
|
-
tx.accountToCredit.parentAccount?.address ?? tx.accountToCredit.address,
|
20
|
-
events,
|
21
|
-
);
|
18
|
+
const isAddressCorrect = containsSubstringInEvent(tx.accountToCredit.address, events);
|
22
19
|
expect(isAddressCorrect).toBeTruthy();
|
23
20
|
}
|
24
21
|
|
package/src/e2e/speculos.ts
CHANGED
@@ -14,13 +14,13 @@ import { CryptoCurrency } from "@ledgerhq/types-cryptoassets";
|
|
14
14
|
import axios, { AxiosError, AxiosResponse } from "axios";
|
15
15
|
import { getEnv } from "@ledgerhq/live-env";
|
16
16
|
import { getCryptoCurrencyById } from "../currencies";
|
17
|
-
import { DeviceLabels } from "
|
17
|
+
import { DeviceLabels } from "../e2e/enum/DeviceLabels";
|
18
18
|
import { Account } from "./enum/Account";
|
19
19
|
import { Device as CryptoWallet } from "./enum/Device";
|
20
20
|
import { Currency } from "./enum/Currency";
|
21
21
|
import expect from "expect";
|
22
22
|
import { sendBTCBasedCoin } from "./families/bitcoin";
|
23
|
-
import { sendEVM, sendEvmNFT } from "
|
23
|
+
import { sendEVM, sendEvmNFT } from ".//families/evm";
|
24
24
|
import { sendPolkadot } from "./families/polkadot";
|
25
25
|
import { sendAlgorand } from "./families/algorand";
|
26
26
|
import { sendTron } from "./families/tron";
|
@@ -385,12 +385,13 @@ export async function startSpeculos(
|
|
385
385
|
onSpeculosDeviceCreated,
|
386
386
|
};
|
387
387
|
try {
|
388
|
-
|
388
|
+
const device = isSpeculosRemote
|
389
389
|
? await createSpeculosDeviceCI(deviceParams)
|
390
390
|
: await createSpeculosDevice(deviceParams).then(device => {
|
391
391
|
invariant(device.ports.apiPort, "[E2E] Speculos apiPort is not defined");
|
392
392
|
return { id: device.id, port: device.ports.apiPort };
|
393
393
|
});
|
394
|
+
return device;
|
394
395
|
} catch (e: unknown) {
|
395
396
|
console.error(e);
|
396
397
|
log("engine", `test ${testName} failed with ${String(e)}`);
|
@@ -621,7 +622,7 @@ const APP_LABEL_MAP = new Map<AppInfos, [string, string]>([
|
|
621
622
|
[AppInfos.ETHEREUM, [DeviceLabels.VERIFY_ETHEREUM, DeviceLabels.CONFIRM]],
|
622
623
|
[AppInfos.BNB_CHAIN, [DeviceLabels.VERIFY_BSC, DeviceLabels.CONFIRM]],
|
623
624
|
[AppInfos.POLYGON, [DeviceLabels.VERIFY_POLYGON, DeviceLabels.CONFIRM]],
|
624
|
-
[AppInfos.SOLANA, [DeviceLabels.
|
625
|
+
[AppInfos.SOLANA, [DeviceLabels.PUBKEY, DeviceLabels.APPROVE]],
|
625
626
|
[AppInfos.POLKADOT, [DeviceLabels.PLEASE_REVIEW, DeviceLabels.CAPS_APPROVE]],
|
626
627
|
[AppInfos.COSMOS, [DeviceLabels.PLEASE_REVIEW, DeviceLabels.CAPS_APPROVE]],
|
627
628
|
[AppInfos.BITCOIN, [DeviceLabels.ADDRESS, DeviceLabels.CONFIRM]],
|