@ledgerhq/live-common 34.52.0 → 34.53.0-nightly.20251107095716
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/DataModel.d.ts +2 -2
- package/lib/DataModel.d.ts.map +1 -1
- package/lib/DataModel.js +2 -2
- package/lib/DataModel.js.map +1 -1
- package/lib/__tests__/test-helpers/bridge.d.ts.map +1 -1
- package/lib/__tests__/test-helpers/bridge.js +103 -47
- package/lib/__tests__/test-helpers/bridge.js.map +1 -1
- package/lib/__tests__/test-helpers/setup.d.ts.map +1 -1
- package/lib/__tests__/test-helpers/setup.js +6 -5
- package/lib/__tests__/test-helpers/setup.js.map +1 -1
- package/lib/account/serialization.d.ts +1 -1
- package/lib/account/serialization.d.ts.map +1 -1
- package/lib/account/serialization.js +2 -2
- package/lib/account/serialization.js.map +1 -1
- package/lib/api/ofacGeoBlockApi.d.ts +4 -0
- package/lib/api/ofacGeoBlockApi.d.ts.map +1 -0
- package/lib/api/ofacGeoBlockApi.js +21 -0
- package/lib/api/ofacGeoBlockApi.js.map +1 -0
- package/lib/apps/config.d.ts.map +1 -1
- package/lib/apps/config.js +1 -0
- package/lib/apps/config.js.map +1 -1
- package/lib/bot/engine.d.ts +5 -5
- package/lib/bot/engine.d.ts.map +1 -1
- package/lib/bot/engine.js.map +1 -1
- package/lib/bridge/crypto-assets/index.d.ts.map +1 -1
- package/lib/bridge/crypto-assets/index.js +2 -2
- package/lib/bridge/crypto-assets/index.js.map +1 -1
- package/lib/bridge/generic-alpaca/alpaca/network/network-alpaca.d.ts +2 -2
- package/lib/bridge/generic-alpaca/createTransaction.d.ts.map +1 -1
- package/lib/bridge/generic-alpaca/createTransaction.js +6 -1
- package/lib/bridge/generic-alpaca/createTransaction.js.map +1 -1
- package/lib/bridge/generic-alpaca/getTransactionStatus.d.ts.map +1 -1
- package/lib/bridge/generic-alpaca/getTransactionStatus.js +1 -0
- package/lib/bridge/generic-alpaca/getTransactionStatus.js.map +1 -1
- package/lib/bridge/generic-alpaca/prepareTransaction.d.ts +2 -2
- package/lib/bridge/generic-alpaca/prepareTransaction.d.ts.map +1 -1
- package/lib/bridge/generic-alpaca/prepareTransaction.js +30 -26
- 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 +6 -4
- package/lib/bridge/generic-alpaca/signOperation.js.map +1 -1
- package/lib/bridge/generic-alpaca/signer/Eth.d.ts +2 -1
- package/lib/bridge/generic-alpaca/signer/Eth.d.ts.map +1 -1
- package/lib/bridge/generic-alpaca/signer/Eth.js +2 -1
- package/lib/bridge/generic-alpaca/signer/Eth.js.map +1 -1
- package/lib/bridge/generic-alpaca/types.d.ts +61 -2
- package/lib/bridge/generic-alpaca/types.d.ts.map +1 -1
- package/lib/bridge/generic-alpaca/utils.d.ts +1 -1
- package/lib/bridge/generic-alpaca/utils.d.ts.map +1 -1
- package/lib/bridge/generic-alpaca/utils.js +121 -7
- package/lib/bridge/generic-alpaca/utils.js.map +1 -1
- package/lib/bridge/index.d.ts +1 -1
- package/lib/bridge/index.d.ts.map +1 -1
- package/lib/bridge/index.js +2 -2
- package/lib/bridge/index.js.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 +1 -4
- package/lib/currencies/index.js.map +1 -1
- package/lib/dada-client/__mocks__/assets.mock.d.ts +383 -0
- package/lib/dada-client/__mocks__/assets.mock.d.ts.map +1 -0
- package/lib/dada-client/__mocks__/assets.mock.js +260 -0
- package/lib/dada-client/__mocks__/assets.mock.js.map +1 -0
- package/lib/dada-client/hooks/useAssetsData.d.ts +2 -1
- package/lib/dada-client/hooks/useAssetsData.d.ts.map +1 -1
- package/lib/dada-client/hooks/useAssetsData.js +2 -2
- package/lib/dada-client/hooks/useAssetsData.js.map +1 -1
- package/lib/dada-client/hooks/useLazyLedgerCurrency.d.ts +13 -0
- package/lib/dada-client/hooks/useLazyLedgerCurrency.d.ts.map +1 -0
- package/lib/dada-client/hooks/useLazyLedgerCurrency.js +34 -0
- package/lib/dada-client/hooks/useLazyLedgerCurrency.js.map +1 -0
- package/lib/dada-client/index.d.ts +2 -0
- package/lib/dada-client/index.d.ts.map +1 -0
- package/lib/dada-client/index.js +18 -0
- package/lib/dada-client/index.js.map +1 -0
- package/lib/dada-client/state-manager/api.js +1 -1
- package/lib/dada-client/state-manager/api.js.map +1 -1
- package/lib/dada-client/utils/currencySelection.d.ts +10 -0
- package/lib/dada-client/utils/currencySelection.d.ts.map +1 -0
- package/lib/dada-client/utils/currencySelection.js +34 -0
- package/lib/dada-client/utils/currencySelection.js.map +1 -0
- package/lib/deposit/helper.d.ts +1 -1
- package/lib/deposit/helper.d.ts.map +1 -1
- package/lib/deposit/helper.js +3 -2
- package/lib/deposit/helper.js.map +1 -1
- package/lib/e2e/data/deviceLabelsData.d.ts.map +1 -1
- package/lib/e2e/data/deviceLabelsData.js +2 -1
- package/lib/e2e/data/deviceLabelsData.js.map +1 -1
- package/lib/e2e/enum/DeviceLabels.d.ts +5 -1
- package/lib/e2e/enum/DeviceLabels.d.ts.map +1 -1
- package/lib/e2e/enum/DeviceLabels.js +4 -0
- package/lib/e2e/enum/DeviceLabels.js.map +1 -1
- package/lib/e2e/index.d.ts +4 -8
- package/lib/e2e/index.d.ts.map +1 -1
- package/lib/e2e/speculos.d.ts +1 -1
- package/lib/e2e/speculos.d.ts.map +1 -1
- package/lib/e2e/speculos.js +24 -5
- package/lib/e2e/speculos.js.map +1 -1
- package/lib/e2e/speculosAppVersion.d.ts.map +1 -1
- package/lib/e2e/speculosAppVersion.js +1 -0
- package/lib/e2e/speculosAppVersion.js.map +1 -1
- package/lib/families/cosmos/datasets/coreum.d.ts.map +1 -1
- package/lib/families/cosmos/datasets/coreum.js +2 -1
- package/lib/families/cosmos/datasets/coreum.js.map +1 -1
- package/lib/families/near/config.d.ts.map +1 -1
- package/lib/families/near/config.js +1 -0
- package/lib/families/near/config.js.map +1 -1
- package/lib/families/solana/setup.d.ts +1 -1
- package/lib/families/tron/data.mock.d.ts +4 -4
- package/lib/families/tron/data.mock.d.ts.map +1 -1
- package/lib/families/tron/data.mock.js +27 -13
- package/lib/families/tron/data.mock.js.map +1 -1
- package/lib/featureFlags/defaultFeatures.d.ts.map +1 -1
- package/lib/featureFlags/defaultFeatures.js +3 -4
- package/lib/featureFlags/defaultFeatures.js.map +1 -1
- package/lib/featureFlags/stakePrograms/index.d.ts +1 -0
- package/lib/featureFlags/stakePrograms/index.d.ts.map +1 -1
- package/lib/featureFlags/stakePrograms/index.js +13 -1
- package/lib/featureFlags/stakePrograms/index.js.map +1 -1
- package/lib/featureFlags/useFeature.d.ts +1 -1
- package/lib/featureFlags/useFeature.d.ts.map +1 -1
- package/lib/generated/cli-transaction.d.ts +1 -1
- package/lib/generated/transaction.d.ts +1 -1
- package/lib/hw/actions/implementations.d.ts.map +1 -1
- package/lib/hw/actions/implementations.js +13 -7
- package/lib/hw/actions/implementations.js.map +1 -1
- package/lib/hw/connectAppEventMapper.d.ts.map +1 -1
- package/lib/hw/connectAppEventMapper.js +2 -2
- package/lib/hw/connectAppEventMapper.js.map +1 -1
- package/lib/market/hooks/useLargeMoverCurrencies.d.ts +1 -1
- package/lib/market/hooks/useMarketDataProvider.d.ts +2 -2
- package/lib/market/hooks/useMarketDataProvider.d.ts.map +1 -1
- package/lib/market/hooks/useMarketDataProvider.js +4 -7
- package/lib/market/hooks/useMarketDataProvider.js.map +1 -1
- package/lib/market/utils/currencyFormatter.d.ts +3 -4
- package/lib/market/utils/currencyFormatter.d.ts.map +1 -1
- package/lib/market/utils/currencyFormatter.js +3 -6
- package/lib/market/utils/currencyFormatter.js.map +1 -1
- package/lib/market/utils/queryKeys.d.ts +0 -1
- package/lib/market/utils/queryKeys.d.ts.map +1 -1
- package/lib/market/utils/queryKeys.js +0 -1
- package/lib/market/utils/queryKeys.js.map +1 -1
- package/lib/market/utils/types.d.ts +6 -8
- package/lib/market/utils/types.d.ts.map +1 -1
- package/lib/market/utils/types.js.map +1 -1
- package/lib/mock/fixtures/cryptoCurrencies.d.ts.map +1 -1
- package/lib/mock/fixtures/cryptoCurrencies.js +10 -1
- package/lib/mock/fixtures/cryptoCurrencies.js.map +1 -1
- package/lib/modularDrawer/__mocks__/currencies.mock.d.ts +1 -1
- package/lib/modularDrawer/__mocks__/currencies.mock.d.ts.map +1 -1
- package/lib/modularDrawer/__mocks__/currencies.mock.js +1 -1
- package/lib/modularDrawer/__mocks__/currencies.mock.js.map +1 -1
- package/lib/modularDrawer/utils/currencyUtils.d.ts +3 -3
- package/lib/modularDrawer/utils/currencyUtils.d.ts.map +1 -1
- package/lib/modularDrawer/utils/currencyUtils.js +8 -8
- package/lib/modularDrawer/utils/currencyUtils.js.map +1 -1
- package/lib/postOnboarding/hooks/usePostOnboardingHubState.d.ts.map +1 -1
- package/lib/postOnboarding/hooks/usePostOnboardingHubState.js +13 -4
- package/lib/postOnboarding/hooks/usePostOnboardingHubState.js.map +1 -1
- package/lib/postOnboarding/mock.d.ts +1 -0
- package/lib/postOnboarding/mock.d.ts.map +1 -1
- package/lib/postOnboarding/mock.js +3 -1
- package/lib/postOnboarding/mock.js.map +1 -1
- package/lib/postOnboarding/reducer.d.ts +16 -14
- package/lib/postOnboarding/reducer.d.ts.map +1 -1
- package/lib/transaction/index.d.ts +1 -1
- package/lib/transaction/index.d.ts.map +1 -1
- package/lib/transaction/index.js +2 -2
- package/lib/transaction/index.js.map +1 -1
- package/lib/utils/addressUtils.d.ts +15 -0
- package/lib/utils/addressUtils.d.ts.map +1 -0
- package/lib/utils/addressUtils.js +39 -0
- package/lib/utils/addressUtils.js.map +1 -0
- package/lib/wallet-api/ACRE/server.d.ts.map +1 -1
- package/lib/wallet-api/ACRE/server.js +19 -15
- package/lib/wallet-api/ACRE/server.js.map +1 -1
- package/lib/wallet-api/Exchange/server.d.ts.map +1 -1
- package/lib/wallet-api/Exchange/server.js +8 -5
- package/lib/wallet-api/Exchange/server.js.map +1 -1
- package/lib/wallet-api/logic.d.ts.map +1 -1
- package/lib/wallet-api/logic.js +29 -29
- package/lib/wallet-api/logic.js.map +1 -1
- package/lib/wallet-api/react.d.ts.map +1 -1
- package/lib/wallet-api/react.js +37 -29
- package/lib/wallet-api/react.js.map +1 -1
- package/lib/wallet-api/useDappLogic.d.ts.map +1 -1
- package/lib/wallet-api/useDappLogic.js +76 -60
- package/lib/wallet-api/useDappLogic.js.map +1 -1
- package/lib-es/DataModel.d.ts +2 -2
- package/lib-es/DataModel.d.ts.map +1 -1
- package/lib-es/DataModel.js +2 -2
- package/lib-es/DataModel.js.map +1 -1
- package/lib-es/__tests__/test-helpers/bridge.d.ts.map +1 -1
- package/lib-es/__tests__/test-helpers/bridge.js +103 -47
- package/lib-es/__tests__/test-helpers/bridge.js.map +1 -1
- package/lib-es/__tests__/test-helpers/setup.d.ts.map +1 -1
- package/lib-es/__tests__/test-helpers/setup.js +6 -5
- package/lib-es/__tests__/test-helpers/setup.js.map +1 -1
- package/lib-es/account/serialization.d.ts +1 -1
- package/lib-es/account/serialization.d.ts.map +1 -1
- package/lib-es/account/serialization.js +2 -2
- package/lib-es/account/serialization.js.map +1 -1
- package/lib-es/api/ofacGeoBlockApi.d.ts +4 -0
- package/lib-es/api/ofacGeoBlockApi.d.ts.map +1 -0
- package/lib-es/api/ofacGeoBlockApi.js +18 -0
- package/lib-es/api/ofacGeoBlockApi.js.map +1 -0
- package/lib-es/apps/config.d.ts.map +1 -1
- package/lib-es/apps/config.js +1 -0
- package/lib-es/apps/config.js.map +1 -1
- package/lib-es/bot/engine.d.ts +5 -5
- package/lib-es/bot/engine.d.ts.map +1 -1
- package/lib-es/bot/engine.js.map +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/alpaca/network/network-alpaca.d.ts +2 -2
- package/lib-es/bridge/generic-alpaca/createTransaction.d.ts.map +1 -1
- package/lib-es/bridge/generic-alpaca/createTransaction.js +6 -1
- package/lib-es/bridge/generic-alpaca/createTransaction.js.map +1 -1
- package/lib-es/bridge/generic-alpaca/getTransactionStatus.d.ts.map +1 -1
- package/lib-es/bridge/generic-alpaca/getTransactionStatus.js +1 -0
- package/lib-es/bridge/generic-alpaca/getTransactionStatus.js.map +1 -1
- package/lib-es/bridge/generic-alpaca/prepareTransaction.d.ts +2 -2
- package/lib-es/bridge/generic-alpaca/prepareTransaction.d.ts.map +1 -1
- package/lib-es/bridge/generic-alpaca/prepareTransaction.js +30 -26
- 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 +6 -4
- package/lib-es/bridge/generic-alpaca/signOperation.js.map +1 -1
- package/lib-es/bridge/generic-alpaca/signer/Eth.d.ts +2 -1
- package/lib-es/bridge/generic-alpaca/signer/Eth.d.ts.map +1 -1
- package/lib-es/bridge/generic-alpaca/signer/Eth.js +2 -1
- package/lib-es/bridge/generic-alpaca/signer/Eth.js.map +1 -1
- package/lib-es/bridge/generic-alpaca/types.d.ts +61 -2
- package/lib-es/bridge/generic-alpaca/types.d.ts.map +1 -1
- package/lib-es/bridge/generic-alpaca/utils.d.ts +1 -1
- package/lib-es/bridge/generic-alpaca/utils.d.ts.map +1 -1
- package/lib-es/bridge/generic-alpaca/utils.js +121 -7
- package/lib-es/bridge/generic-alpaca/utils.js.map +1 -1
- package/lib-es/bridge/index.d.ts +1 -1
- package/lib-es/bridge/index.d.ts.map +1 -1
- package/lib-es/bridge/index.js +2 -2
- package/lib-es/bridge/index.js.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/dada-client/__mocks__/assets.mock.d.ts +383 -0
- package/lib-es/dada-client/__mocks__/assets.mock.d.ts.map +1 -0
- package/lib-es/dada-client/__mocks__/assets.mock.js +257 -0
- package/lib-es/dada-client/__mocks__/assets.mock.js.map +1 -0
- package/lib-es/dada-client/hooks/useAssetsData.d.ts +2 -1
- package/lib-es/dada-client/hooks/useAssetsData.d.ts.map +1 -1
- package/lib-es/dada-client/hooks/useAssetsData.js +2 -2
- package/lib-es/dada-client/hooks/useAssetsData.js.map +1 -1
- package/lib-es/dada-client/hooks/useLazyLedgerCurrency.d.ts +13 -0
- package/lib-es/dada-client/hooks/useLazyLedgerCurrency.d.ts.map +1 -0
- package/lib-es/dada-client/hooks/useLazyLedgerCurrency.js +27 -0
- package/lib-es/dada-client/hooks/useLazyLedgerCurrency.js.map +1 -0
- package/lib-es/dada-client/index.d.ts +2 -0
- package/lib-es/dada-client/index.d.ts.map +1 -0
- package/lib-es/dada-client/index.js +2 -0
- package/lib-es/dada-client/index.js.map +1 -0
- package/lib-es/dada-client/state-manager/api.js +1 -1
- package/lib-es/dada-client/state-manager/api.js.map +1 -1
- package/lib-es/dada-client/utils/currencySelection.d.ts +10 -0
- package/lib-es/dada-client/utils/currencySelection.d.ts.map +1 -0
- package/lib-es/dada-client/utils/currencySelection.js +30 -0
- package/lib-es/dada-client/utils/currencySelection.js.map +1 -0
- package/lib-es/deposit/helper.d.ts +1 -1
- package/lib-es/deposit/helper.d.ts.map +1 -1
- package/lib-es/deposit/helper.js +4 -3
- 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 +2 -1
- package/lib-es/e2e/data/deviceLabelsData.js.map +1 -1
- package/lib-es/e2e/enum/DeviceLabels.d.ts +5 -1
- package/lib-es/e2e/enum/DeviceLabels.d.ts.map +1 -1
- package/lib-es/e2e/enum/DeviceLabels.js +4 -0
- package/lib-es/e2e/enum/DeviceLabels.js.map +1 -1
- package/lib-es/e2e/index.d.ts +4 -8
- package/lib-es/e2e/index.d.ts.map +1 -1
- package/lib-es/e2e/speculos.d.ts +1 -1
- package/lib-es/e2e/speculos.d.ts.map +1 -1
- package/lib-es/e2e/speculos.js +24 -5
- 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 +1 -0
- package/lib-es/e2e/speculosAppVersion.js.map +1 -1
- package/lib-es/families/cosmos/datasets/coreum.d.ts.map +1 -1
- package/lib-es/families/cosmos/datasets/coreum.js +2 -1
- package/lib-es/families/cosmos/datasets/coreum.js.map +1 -1
- package/lib-es/families/near/config.d.ts.map +1 -1
- package/lib-es/families/near/config.js +1 -0
- package/lib-es/families/near/config.js.map +1 -1
- package/lib-es/families/solana/setup.d.ts +1 -1
- package/lib-es/families/tron/data.mock.d.ts +4 -4
- package/lib-es/families/tron/data.mock.d.ts.map +1 -1
- package/lib-es/families/tron/data.mock.js +22 -12
- package/lib-es/families/tron/data.mock.js.map +1 -1
- package/lib-es/featureFlags/defaultFeatures.d.ts.map +1 -1
- package/lib-es/featureFlags/defaultFeatures.js +3 -4
- package/lib-es/featureFlags/defaultFeatures.js.map +1 -1
- package/lib-es/featureFlags/stakePrograms/index.d.ts +1 -0
- package/lib-es/featureFlags/stakePrograms/index.d.ts.map +1 -1
- package/lib-es/featureFlags/stakePrograms/index.js +11 -0
- package/lib-es/featureFlags/stakePrograms/index.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/cli-transaction.d.ts +1 -1
- package/lib-es/generated/transaction.d.ts +1 -1
- package/lib-es/hw/actions/implementations.d.ts.map +1 -1
- package/lib-es/hw/actions/implementations.js +15 -9
- package/lib-es/hw/actions/implementations.js.map +1 -1
- package/lib-es/hw/connectAppEventMapper.d.ts.map +1 -1
- package/lib-es/hw/connectAppEventMapper.js +3 -3
- package/lib-es/hw/connectAppEventMapper.js.map +1 -1
- package/lib-es/market/hooks/useLargeMoverCurrencies.d.ts +1 -1
- package/lib-es/market/hooks/useMarketDataProvider.d.ts +2 -2
- package/lib-es/market/hooks/useMarketDataProvider.d.ts.map +1 -1
- package/lib-es/market/hooks/useMarketDataProvider.js +2 -5
- package/lib-es/market/hooks/useMarketDataProvider.js.map +1 -1
- package/lib-es/market/utils/currencyFormatter.d.ts +3 -4
- package/lib-es/market/utils/currencyFormatter.d.ts.map +1 -1
- package/lib-es/market/utils/currencyFormatter.js +3 -6
- package/lib-es/market/utils/currencyFormatter.js.map +1 -1
- package/lib-es/market/utils/queryKeys.d.ts +0 -1
- package/lib-es/market/utils/queryKeys.d.ts.map +1 -1
- package/lib-es/market/utils/queryKeys.js +0 -1
- package/lib-es/market/utils/queryKeys.js.map +1 -1
- package/lib-es/market/utils/types.d.ts +6 -8
- package/lib-es/market/utils/types.d.ts.map +1 -1
- package/lib-es/market/utils/types.js.map +1 -1
- package/lib-es/mock/fixtures/cryptoCurrencies.d.ts.map +1 -1
- package/lib-es/mock/fixtures/cryptoCurrencies.js +11 -2
- package/lib-es/mock/fixtures/cryptoCurrencies.js.map +1 -1
- package/lib-es/modularDrawer/__mocks__/currencies.mock.d.ts +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/utils/currencyUtils.d.ts +3 -3
- package/lib-es/modularDrawer/utils/currencyUtils.d.ts.map +1 -1
- package/lib-es/modularDrawer/utils/currencyUtils.js +8 -8
- package/lib-es/modularDrawer/utils/currencyUtils.js.map +1 -1
- package/lib-es/postOnboarding/hooks/usePostOnboardingHubState.d.ts.map +1 -1
- package/lib-es/postOnboarding/hooks/usePostOnboardingHubState.js +13 -4
- package/lib-es/postOnboarding/hooks/usePostOnboardingHubState.js.map +1 -1
- package/lib-es/postOnboarding/mock.d.ts +1 -0
- package/lib-es/postOnboarding/mock.d.ts.map +1 -1
- package/lib-es/postOnboarding/mock.js +2 -0
- package/lib-es/postOnboarding/mock.js.map +1 -1
- package/lib-es/postOnboarding/reducer.d.ts +16 -14
- package/lib-es/postOnboarding/reducer.d.ts.map +1 -1
- package/lib-es/transaction/index.d.ts +1 -1
- package/lib-es/transaction/index.d.ts.map +1 -1
- package/lib-es/transaction/index.js +2 -2
- package/lib-es/transaction/index.js.map +1 -1
- package/lib-es/utils/addressUtils.d.ts +15 -0
- package/lib-es/utils/addressUtils.d.ts.map +1 -0
- package/lib-es/utils/addressUtils.js +35 -0
- package/lib-es/utils/addressUtils.js.map +1 -0
- package/lib-es/wallet-api/ACRE/server.d.ts.map +1 -1
- package/lib-es/wallet-api/ACRE/server.js +19 -15
- package/lib-es/wallet-api/ACRE/server.js.map +1 -1
- package/lib-es/wallet-api/Exchange/server.d.ts.map +1 -1
- package/lib-es/wallet-api/Exchange/server.js +9 -6
- package/lib-es/wallet-api/Exchange/server.js.map +1 -1
- package/lib-es/wallet-api/logic.d.ts.map +1 -1
- package/lib-es/wallet-api/logic.js +26 -26
- package/lib-es/wallet-api/logic.js.map +1 -1
- package/lib-es/wallet-api/react.d.ts.map +1 -1
- package/lib-es/wallet-api/react.js +38 -30
- package/lib-es/wallet-api/react.js.map +1 -1
- package/lib-es/wallet-api/useDappLogic.d.ts.map +1 -1
- package/lib-es/wallet-api/useDappLogic.js +74 -58
- package/lib-es/wallet-api/useDappLogic.js.map +1 -1
- package/package.json +56 -52
- package/src/DataModel.test.ts +74 -24
- package/src/DataModel.ts +4 -4
- package/src/__tests__/accounts/groupPerDay.ts +182 -177
- package/src/__tests__/csvExport.ts +3 -0
- package/src/__tests__/migration/account-migration.ts +2 -2
- package/src/__tests__/test-helpers/bridge.ts +426 -358
- package/src/__tests__/test-helpers/setup.ts +7 -6
- package/src/account/serialization.test.ts +6 -6
- package/src/account/serialization.ts +2 -2
- package/src/api/ofacGeoBlockApi.ts +19 -0
- package/src/apps/config.ts +1 -0
- package/src/bot/engine.ts +5 -5
- package/src/bridge/cache.test.ts +2 -0
- package/src/bridge/crypto-assets/index.test.ts +3 -9
- package/src/bridge/crypto-assets/index.ts +1 -1
- package/src/bridge/generic-alpaca/alpaca/network/network-alpaca.ts +3 -3
- package/src/bridge/generic-alpaca/createTransaction.ts +6 -1
- package/src/bridge/generic-alpaca/getTransactionStatus.ts +1 -0
- package/src/bridge/generic-alpaca/prepareTransaction.ts +36 -41
- package/src/bridge/generic-alpaca/signOperation.ts +10 -4
- package/src/bridge/generic-alpaca/signer/Eth.ts +4 -2
- package/src/bridge/generic-alpaca/tests/prepareTransaction.test.ts +29 -76
- package/src/bridge/generic-alpaca/tests/signOperation.test.ts +10 -2
- package/src/bridge/generic-alpaca/types.ts +80 -2
- package/src/bridge/generic-alpaca/utils.test.ts +58 -2
- package/src/bridge/generic-alpaca/utils.ts +151 -10
- package/src/bridge/index.ts +2 -2
- package/src/bridge/useBridgeTransaction.test.ts +9 -6
- package/src/currencies/cryptoIcons.test.ts +10 -5
- package/src/currencies/index.ts +0 -3
- package/src/currencies/sortByMarketcap.test.ts +4 -1
- package/src/dada-client/README.md +38 -0
- package/src/dada-client/__mocks__/assets.mock.ts +264 -0
- package/src/dada-client/hooks/__tests__/useLazyLedgerCurrency.test.ts +155 -0
- package/src/dada-client/hooks/useAssetsData.ts +14 -9
- package/src/dada-client/hooks/useLazyLedgerCurrency.ts +46 -0
- package/src/dada-client/index.ts +1 -0
- package/src/dada-client/state-manager/api.ts +1 -1
- package/src/dada-client/utils/__test__/currencySelection.test.ts +16 -0
- package/src/dada-client/utils/currencySelection.ts +33 -0
- package/src/deposit/deposit.integration.test.ts +15 -0
- package/src/deposit/deposit.test.ts +60 -40
- package/src/deposit/helper.ts +4 -8
- package/src/domain/getTokensWithFunds.test.ts +4 -0
- package/src/e2e/data/deviceLabelsData.ts +2 -1
- package/src/e2e/enum/DeviceLabels.ts +4 -0
- package/src/e2e/speculos.ts +26 -6
- package/src/e2e/speculosAppVersion.ts +1 -0
- package/src/families/aptos/__snapshots__/bridge.integration.test.ts.snap +12 -12
- package/src/families/bitcoin/__snapshots__/bridge.integration.test.ts.snap +1482 -843
- package/src/families/bitcoin/satstack.test.ts +33 -20
- package/src/families/cosmos/datasets/__snapshots__/babylon.integration.test.ts.snap +1 -1
- package/src/families/cosmos/datasets/__snapshots__/coreum.integration.test.ts.snap +4 -4
- package/src/families/cosmos/datasets/__snapshots__/cosmos.integration.test.ts.snap +251 -209
- package/src/families/cosmos/datasets/coreum.ts +2 -1
- package/src/families/hedera/__snapshots__/bridge.integration.test.ts.snap +675 -37
- package/src/families/multiversx/__snapshots__/bridge.integration.test.ts.snap +3 -3
- package/src/families/near/config.ts +1 -0
- package/src/families/polkadot/__snapshots__/bridge.integration.test.ts.snap +34 -34
- package/src/families/solana/__snapshots__/bridge.integration.test.ts.snap +3 -3
- package/src/families/stacks/__snapshots__/bridge.integration.test.ts.snap +10 -10
- package/src/families/stellar/__snapshots__/bridge.integration.test.ts.snap +1183 -625
- package/src/families/sui/__snapshots__/bridge.integration.test.ts.snap +428 -0
- package/src/families/tron/data.mock.ts +32 -16
- package/src/families/tron/react.test.ts +16 -4
- package/src/featureFlags/defaultFeatures.ts +3 -4
- package/src/featureFlags/stakePrograms/index.ts +14 -0
- package/src/hw/actions/implementations.ts +22 -11
- package/src/hw/connectAppEventMapper.ts +2 -4
- package/src/market/hooks/useMarketDataProvider.ts +4 -8
- package/src/market/utils/currencyFormatter.ts +4 -18
- package/src/market/utils/queryKeys.ts +0 -1
- package/src/market/utils/types.ts +6 -8
- package/src/mock/fixtures/cryptoCurrencies.ts +11 -2
- package/src/modularDrawer/__mocks__/currencies.mock.ts +1 -1
- package/src/modularDrawer/utils/__tests__/currencyUtils.test.ts +10 -10
- package/src/modularDrawer/utils/currencyUtils.ts +11 -10
- package/src/platform/serializers.test.ts +2 -2
- package/src/postOnboarding/hooks/usePostOnboardingHubState.test.ts +30 -3
- package/src/postOnboarding/hooks/usePostOnboardingHubState.ts +20 -6
- package/src/postOnboarding/mock.ts +2 -0
- package/src/transaction/index.ts +2 -2
- package/src/utils/__tests__/addressUtils.test.ts +229 -0
- package/src/utils/__tests__/getAccountTuplesForCurrency.test.ts +15 -4
- package/src/utils/addressUtils.ts +40 -0
- package/src/wallet-api/ACRE/server.test.ts +11 -8
- package/src/wallet-api/ACRE/server.ts +25 -22
- package/src/wallet-api/Exchange/server.ts +11 -8
- package/src/wallet-api/logic.test.ts +4 -0
- package/src/wallet-api/logic.ts +28 -32
- package/src/wallet-api/react.ts +37 -34
- package/src/wallet-api/useDappLogic.ts +103 -82
- package/lib/hooks/useOFACGeoBlockCheck.d.ts +0 -8
- package/lib/hooks/useOFACGeoBlockCheck.d.ts.map +0 -1
- package/lib/hooks/useOFACGeoBlockCheck.js +0 -32
- package/lib/hooks/useOFACGeoBlockCheck.js.map +0 -1
- package/lib-es/hooks/useOFACGeoBlockCheck.d.ts +0 -8
- package/lib-es/hooks/useOFACGeoBlockCheck.d.ts.map +0 -1
- package/lib-es/hooks/useOFACGeoBlockCheck.js +0 -28
- package/lib-es/hooks/useOFACGeoBlockCheck.js.map +0 -1
- package/src/hooks/useOFACGeoBlockCheck.ts +0 -37
|
@@ -9,18 +9,24 @@ import { MOCK_TOKENS_ONLY, MOCK_WITH_TOKEN_AND_CURRENCY_ASSET, MOCK_IDS, MOCK_PO
|
|
|
9
9
|
import { MappedAsset } from "./type";
|
|
10
10
|
import {
|
|
11
11
|
getCryptoCurrencyById,
|
|
12
|
-
findTokenById,
|
|
13
12
|
setSupportedCurrencies,
|
|
14
13
|
sortCurrenciesByIds,
|
|
15
14
|
} from "../currencies/index";
|
|
16
15
|
import { isCurrencySupported, listSupportedCurrencies, listTokens } from "../currencies";
|
|
17
16
|
import { CryptoOrTokenCurrency, TokenCurrency } from "@ledgerhq/types-cryptoassets";
|
|
17
|
+
import { getCryptoAssetsStore } from "../bridge/crypto-assets/index";
|
|
18
|
+
import { initializeLegacyTokens } from "@ledgerhq/cryptoassets/legacy/legacy-data";
|
|
19
|
+
import { addTokens } from "@ledgerhq/cryptoassets/legacy/legacy-utils";
|
|
18
20
|
|
|
19
21
|
const TOKEN_ONLY_ASSETS = MOCK_TOKENS_ONLY as MappedAsset[];
|
|
20
22
|
|
|
21
23
|
const listSupportedTokens = () => listTokens().filter(t => isCurrencySupported(t.parentCurrency));
|
|
22
24
|
|
|
23
25
|
describe("Deposit logic", () => {
|
|
26
|
+
beforeAll(() => {
|
|
27
|
+
initializeLegacyTokens(addTokens);
|
|
28
|
+
});
|
|
29
|
+
|
|
24
30
|
afterEach(() => {
|
|
25
31
|
setSupportedCurrencies([]);
|
|
26
32
|
});
|
|
@@ -106,10 +112,12 @@ describe("Deposit logic", () => {
|
|
|
106
112
|
});
|
|
107
113
|
|
|
108
114
|
describe("groupCurrenciesByProvider", () => {
|
|
109
|
-
test("should group currencies by provider", () => {
|
|
110
|
-
const currencies =
|
|
111
|
-
(
|
|
112
|
-
|
|
115
|
+
test("should group currencies by provider", async () => {
|
|
116
|
+
const currencies = (
|
|
117
|
+
await Promise.all(
|
|
118
|
+
TOKEN_ONLY_ASSETS.map(asset => getCryptoAssetsStore().findTokenById(asset.ledgerId)),
|
|
119
|
+
)
|
|
120
|
+
).filter((t): t is TokenCurrency => t !== undefined);
|
|
113
121
|
const { currenciesByProvider } = groupCurrenciesByProvider(TOKEN_ONLY_ASSETS, currencies);
|
|
114
122
|
expect(currenciesByProvider).toEqual([
|
|
115
123
|
{
|
|
@@ -119,11 +127,15 @@ describe("Deposit logic", () => {
|
|
|
119
127
|
]);
|
|
120
128
|
});
|
|
121
129
|
|
|
122
|
-
test("should handle POL assets correctly", () => {
|
|
123
|
-
const currenciesPol =
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
130
|
+
test("should handle POL assets correctly", async () => {
|
|
131
|
+
const currenciesPol = (
|
|
132
|
+
await Promise.all(
|
|
133
|
+
MOCK_POL.map(asset =>
|
|
134
|
+
asset.$type === "Token"
|
|
135
|
+
? getCryptoAssetsStore().findTokenById(asset.ledgerId)
|
|
136
|
+
: Promise.resolve(getCryptoCurrencyById(asset.ledgerId)),
|
|
137
|
+
),
|
|
138
|
+
)
|
|
127
139
|
).filter((c): c is CryptoOrTokenCurrency => c !== undefined);
|
|
128
140
|
const { currenciesByProvider: currenciesByProviderBis, sortedCryptoCurrencies } =
|
|
129
141
|
groupCurrenciesByProvider(MOCK_POL as MappedAsset[], currenciesPol);
|
|
@@ -137,10 +149,12 @@ describe("Deposit logic", () => {
|
|
|
137
149
|
expect(sortedCryptoCurrencies).toEqual([currenciesPol[1]]);
|
|
138
150
|
});
|
|
139
151
|
|
|
140
|
-
test("should handle empty assets array", () => {
|
|
141
|
-
const currencies =
|
|
142
|
-
(
|
|
143
|
-
|
|
152
|
+
test("should handle empty assets array", async () => {
|
|
153
|
+
const currencies = (
|
|
154
|
+
await Promise.all(
|
|
155
|
+
TOKEN_ONLY_ASSETS.map(asset => getCryptoAssetsStore().findTokenById(asset.ledgerId)),
|
|
156
|
+
)
|
|
157
|
+
).filter((t): t is TokenCurrency => t !== undefined);
|
|
144
158
|
const { currenciesByProvider, sortedCryptoCurrencies } = groupCurrenciesByProvider(
|
|
145
159
|
[],
|
|
146
160
|
currencies,
|
|
@@ -169,14 +183,16 @@ describe("Deposit logic", () => {
|
|
|
169
183
|
expect(sortedCryptoCurrencies).toEqual([]);
|
|
170
184
|
});
|
|
171
185
|
|
|
172
|
-
test("should prioritize crypto currencies over tokens in sortedCryptoCurrencies", () => {
|
|
186
|
+
test("should prioritize crypto currencies over tokens in sortedCryptoCurrencies", async () => {
|
|
173
187
|
const mockAssets = [
|
|
174
188
|
{ ...TOKEN_ONLY_ASSETS[0], providerId: "test-provider" },
|
|
175
189
|
] as MappedAsset[];
|
|
176
190
|
|
|
177
191
|
setSupportedCurrencies(["ethereum"]);
|
|
178
192
|
const ethCurrency = getCryptoCurrencyById("ethereum");
|
|
179
|
-
const tokenCurrency = findTokenById(
|
|
193
|
+
const tokenCurrency = await getCryptoAssetsStore().findTokenById(
|
|
194
|
+
TOKEN_ONLY_ASSETS[0].ledgerId,
|
|
195
|
+
);
|
|
180
196
|
if (!tokenCurrency) throw new Error("Token not found");
|
|
181
197
|
|
|
182
198
|
const { sortedCryptoCurrencies } = groupCurrenciesByProvider(mockAssets, [
|
|
@@ -187,13 +203,13 @@ describe("Deposit logic", () => {
|
|
|
187
203
|
expect(sortedCryptoCurrencies.length).toBeGreaterThan(0);
|
|
188
204
|
});
|
|
189
205
|
|
|
190
|
-
test("should handle duplicate provider IDs correctly", () => {
|
|
206
|
+
test("should handle duplicate provider IDs correctly", async () => {
|
|
191
207
|
const duplicateAssets = [
|
|
192
208
|
TOKEN_ONLY_ASSETS[0],
|
|
193
209
|
{ ...TOKEN_ONLY_ASSETS[0], ledgerId: "different-id" },
|
|
194
210
|
] as MappedAsset[];
|
|
195
211
|
|
|
196
|
-
const token = findTokenById(TOKEN_ONLY_ASSETS[0].ledgerId);
|
|
212
|
+
const token = await getCryptoAssetsStore().findTokenById(TOKEN_ONLY_ASSETS[0].ledgerId);
|
|
197
213
|
if (!token) throw new Error("Token not found");
|
|
198
214
|
const currencies = [token];
|
|
199
215
|
const { currenciesByProvider } = groupCurrenciesByProvider(duplicateAssets, currencies);
|
|
@@ -204,28 +220,28 @@ describe("Deposit logic", () => {
|
|
|
204
220
|
});
|
|
205
221
|
|
|
206
222
|
describe("getTokenOrCryptoCurrencyById", () => {
|
|
207
|
-
test("should return crypto currency by ID", () => {
|
|
208
|
-
const result = getTokenOrCryptoCurrencyById("bitcoin");
|
|
223
|
+
test("should return crypto currency by ID", async () => {
|
|
224
|
+
const result = await getTokenOrCryptoCurrencyById("bitcoin");
|
|
209
225
|
expect(result).toBeDefined();
|
|
210
226
|
expect(result.type).toBe("CryptoCurrency");
|
|
211
227
|
});
|
|
212
228
|
|
|
213
|
-
test("should return token by ID", () => {
|
|
214
|
-
const result = getTokenOrCryptoCurrencyById("ethereum/erc20/usd_tether__erc20_");
|
|
229
|
+
test("should return token by ID", async () => {
|
|
230
|
+
const result = await getTokenOrCryptoCurrencyById("ethereum/erc20/usd_tether__erc20_");
|
|
215
231
|
expect(result).toBeDefined();
|
|
216
232
|
expect(result.type).toBe("TokenCurrency");
|
|
217
233
|
});
|
|
218
234
|
|
|
219
|
-
test("should handle invalid crypto currency ID", () => {
|
|
220
|
-
expect(
|
|
235
|
+
test("should handle invalid crypto currency ID", async () => {
|
|
236
|
+
await expect(getTokenOrCryptoCurrencyById("invalid-crypto-id")).rejects.toThrow();
|
|
221
237
|
});
|
|
222
238
|
|
|
223
|
-
test("should handle invalid token ID", () => {
|
|
224
|
-
expect(
|
|
239
|
+
test("should handle invalid token ID", async () => {
|
|
240
|
+
await expect(getTokenOrCryptoCurrencyById("invalid/token/id")).rejects.toThrow();
|
|
225
241
|
});
|
|
226
242
|
|
|
227
|
-
test("should handle empty ID", () => {
|
|
228
|
-
expect(
|
|
243
|
+
test("should handle empty ID", async () => {
|
|
244
|
+
await expect(getTokenOrCryptoCurrencyById("")).rejects.toThrow();
|
|
229
245
|
});
|
|
230
246
|
});
|
|
231
247
|
|
|
@@ -315,7 +331,7 @@ describe("Deposit logic", () => {
|
|
|
315
331
|
});
|
|
316
332
|
|
|
317
333
|
describe("Token-only scenarios", () => {
|
|
318
|
-
it("should return only Polygon token while its currency is supported in the list", () => {
|
|
334
|
+
it("should return only Polygon token while its currency is supported in the list", async () => {
|
|
319
335
|
setSupportedCurrencies(["polygon"]);
|
|
320
336
|
|
|
321
337
|
const currencies = sortCurrenciesByIds(
|
|
@@ -326,10 +342,12 @@ describe("Deposit logic", () => {
|
|
|
326
342
|
MOCK_TOKENS_ONLY as MappedAsset[],
|
|
327
343
|
currencies,
|
|
328
344
|
);
|
|
329
|
-
expect(sortedCryptoCurrencies).toEqual([
|
|
345
|
+
expect(sortedCryptoCurrencies).toEqual([
|
|
346
|
+
await getCryptoAssetsStore().findTokenById("polygon/erc20/(pos)_tether_usd"),
|
|
347
|
+
]);
|
|
330
348
|
});
|
|
331
349
|
|
|
332
|
-
it("should return only BSC token while its currency is supported in the list", () => {
|
|
350
|
+
it("should return only BSC token while its currency is supported in the list", async () => {
|
|
333
351
|
setSupportedCurrencies(["bsc"]);
|
|
334
352
|
|
|
335
353
|
const currencies = sortCurrenciesByIds(
|
|
@@ -340,7 +358,9 @@ describe("Deposit logic", () => {
|
|
|
340
358
|
MOCK_TOKENS_ONLY as MappedAsset[],
|
|
341
359
|
currencies,
|
|
342
360
|
);
|
|
343
|
-
expect(sortedCryptoCurrencies).toEqual([
|
|
361
|
+
expect(sortedCryptoCurrencies).toEqual([
|
|
362
|
+
await getCryptoAssetsStore().findTokenById("bsc/bep20/binance-peg_bsc-usd"),
|
|
363
|
+
]);
|
|
344
364
|
});
|
|
345
365
|
|
|
346
366
|
it("should return tokens that are actually supported based on mock data", () => {
|
|
@@ -597,13 +617,13 @@ describe("Deposit logic", () => {
|
|
|
597
617
|
});
|
|
598
618
|
|
|
599
619
|
describe("Error handling", () => {
|
|
600
|
-
test("should handle malformed asset data by throwing error", () => {
|
|
620
|
+
test("should handle malformed asset data by throwing error", async () => {
|
|
601
621
|
const malformedAssets = [
|
|
602
622
|
{ ...TOKEN_ONLY_ASSETS[0], ledgerId: undefined as any },
|
|
603
623
|
{ ...TOKEN_ONLY_ASSETS[0], providerId: null as any },
|
|
604
624
|
] as MappedAsset[];
|
|
605
625
|
|
|
606
|
-
const token = findTokenById(TOKEN_ONLY_ASSETS[0].ledgerId);
|
|
626
|
+
const token = await getCryptoAssetsStore().findTokenById(TOKEN_ONLY_ASSETS[0].ledgerId);
|
|
607
627
|
if (!token) throw new Error("Token not found");
|
|
608
628
|
const currencies = [token];
|
|
609
629
|
|
|
@@ -612,12 +632,12 @@ describe("Deposit logic", () => {
|
|
|
612
632
|
}).toThrow();
|
|
613
633
|
});
|
|
614
634
|
|
|
615
|
-
test("should handle assets with null/undefined fields gracefully where possible", () => {
|
|
635
|
+
test("should handle assets with null/undefined fields gracefully where possible", async () => {
|
|
616
636
|
const partiallyMalformedAssets = [
|
|
617
637
|
{ ...TOKEN_ONLY_ASSETS[0], providerId: "" },
|
|
618
638
|
] as MappedAsset[];
|
|
619
639
|
|
|
620
|
-
const token = findTokenById(TOKEN_ONLY_ASSETS[0].ledgerId);
|
|
640
|
+
const token = await getCryptoAssetsStore().findTokenById(TOKEN_ONLY_ASSETS[0].ledgerId);
|
|
621
641
|
if (!token) throw new Error("Token not found");
|
|
622
642
|
const currencies = [token];
|
|
623
643
|
|
|
@@ -626,7 +646,7 @@ describe("Deposit logic", () => {
|
|
|
626
646
|
}).not.toThrow();
|
|
627
647
|
});
|
|
628
648
|
|
|
629
|
-
test("should handle very large datasets efficiently", () => {
|
|
649
|
+
test("should handle very large datasets efficiently", async () => {
|
|
630
650
|
const largeAssetList = Array(10000)
|
|
631
651
|
.fill(TOKEN_ONLY_ASSETS[0])
|
|
632
652
|
.map((asset, index) => ({
|
|
@@ -635,7 +655,7 @@ describe("Deposit logic", () => {
|
|
|
635
655
|
providerId: `provider_${index % 10}`,
|
|
636
656
|
})) as MappedAsset[];
|
|
637
657
|
|
|
638
|
-
const token = findTokenById(TOKEN_ONLY_ASSETS[0].ledgerId);
|
|
658
|
+
const token = await getCryptoAssetsStore().findTokenById(TOKEN_ONLY_ASSETS[0].ledgerId);
|
|
639
659
|
if (!token) throw new Error("Token not found");
|
|
640
660
|
const currencies = [token];
|
|
641
661
|
|
|
@@ -648,12 +668,12 @@ describe("Deposit logic", () => {
|
|
|
648
668
|
expect(result.sortedCryptoCurrencies).toBeDefined();
|
|
649
669
|
});
|
|
650
670
|
|
|
651
|
-
test("should handle case sensitivity in ledger IDs correctly", () => {
|
|
671
|
+
test("should handle case sensitivity in ledger IDs correctly", async () => {
|
|
652
672
|
const mixedCaseAssets = [
|
|
653
673
|
{ ...TOKEN_ONLY_ASSETS[0], ledgerId: TOKEN_ONLY_ASSETS[0].ledgerId.toUpperCase() },
|
|
654
674
|
] as MappedAsset[];
|
|
655
675
|
|
|
656
|
-
const token = findTokenById(TOKEN_ONLY_ASSETS[0].ledgerId);
|
|
676
|
+
const token = await getCryptoAssetsStore().findTokenById(TOKEN_ONLY_ASSETS[0].ledgerId);
|
|
657
677
|
if (!token) throw new Error("Token not found");
|
|
658
678
|
const currencies = [token];
|
|
659
679
|
const { currenciesByProvider } = groupCurrenciesByProvider(mixedCaseAssets, currencies);
|
package/src/deposit/helper.ts
CHANGED
|
@@ -1,11 +1,7 @@
|
|
|
1
1
|
import { CryptoOrTokenCurrency } from "@ledgerhq/types-cryptoassets";
|
|
2
2
|
import { MappedAsset, CurrenciesByProviderId, GroupedCurrencies } from "./type";
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
getCryptoCurrencyById,
|
|
6
|
-
findTokenById,
|
|
7
|
-
hasCryptoCurrencyId,
|
|
8
|
-
} from "../currencies";
|
|
3
|
+
import { currenciesByMarketcap, getCryptoCurrencyById, hasCryptoCurrencyId } from "../currencies";
|
|
4
|
+
import { getCryptoAssetsStore } from "../bridge/crypto-assets/index";
|
|
9
5
|
import { getMappedAssets } from "./api";
|
|
10
6
|
|
|
11
7
|
/**
|
|
@@ -135,11 +131,11 @@ export const searchByNameOrTicker = (list: MappedAsset[], nameOrTicker: string)
|
|
|
135
131
|
elem.ticker.toLowerCase().includes(nameOrTicker.toLowerCase()),
|
|
136
132
|
);
|
|
137
133
|
|
|
138
|
-
export const getTokenOrCryptoCurrencyById = (id: string): CryptoOrTokenCurrency => {
|
|
134
|
+
export const getTokenOrCryptoCurrencyById = async (id: string): Promise<CryptoOrTokenCurrency> => {
|
|
139
135
|
if (hasCryptoCurrencyId(id)) {
|
|
140
136
|
return getCryptoCurrencyById(id);
|
|
141
137
|
}
|
|
142
|
-
const token = findTokenById(id);
|
|
138
|
+
const token = await getCryptoAssetsStore().findTokenById(id);
|
|
143
139
|
if (!token) {
|
|
144
140
|
throw new Error(`token with id "${id}" not found`);
|
|
145
141
|
}
|
|
@@ -3,6 +3,10 @@ import { getCryptoCurrencyById } from "../currencies/index";
|
|
|
3
3
|
import { Account } from "@ledgerhq/types-live";
|
|
4
4
|
import BigNumber from "bignumber.js";
|
|
5
5
|
import { getTokensWithFunds } from "./getTokensWithFunds";
|
|
6
|
+
import { initializeLegacyTokens } from "@ledgerhq/cryptoassets/legacy/legacy-data";
|
|
7
|
+
import { addTokens } from "@ledgerhq/cryptoassets/legacy/legacy-utils";
|
|
8
|
+
|
|
9
|
+
initializeLegacyTokens(addTokens);
|
|
6
10
|
|
|
7
11
|
const ETH = getCryptoCurrencyById("ethereum");
|
|
8
12
|
|
|
@@ -40,9 +40,10 @@ const TOUCHSCREEN_DEVICE_CONFIG: LabelConfig = {
|
|
|
40
40
|
[AppInfos.BNB_CHAIN.name]: DeviceLabels.VERIFY_BSC,
|
|
41
41
|
[AppInfos.COSMOS.name]: DeviceLabels.VERIFY_COSMOS,
|
|
42
42
|
[AppInfos.ETHEREUM.name]: DeviceLabels.VERIFY_ETHEREUM,
|
|
43
|
-
[AppInfos.POLKADOT.name]: DeviceLabels.
|
|
43
|
+
[AppInfos.POLKADOT.name]: DeviceLabels.VERIFY_POLKADOT,
|
|
44
44
|
[AppInfos.POLYGON.name]: DeviceLabels.VERIFY_POLYGON,
|
|
45
45
|
[AppInfos.SOLANA.name]: DeviceLabels.VERIFY_SOLANA_ADDRESS,
|
|
46
|
+
[AppInfos.SUI.name]: DeviceLabels.PROVIDE_PUBLIC_KEY,
|
|
46
47
|
default: DeviceLabels.ADDRESS,
|
|
47
48
|
},
|
|
48
49
|
receiveConfirm: {
|
|
@@ -61,6 +61,7 @@ export enum DeviceLabels {
|
|
|
61
61
|
VERIFY_ETHEREUM = "Verify Ethereum",
|
|
62
62
|
VERIFY_POLYGON = "Verify Polygon",
|
|
63
63
|
VERIFY_COSMOS = "Verify Cosmos",
|
|
64
|
+
VERIFY_POLKADOT = "Verify Polkadot",
|
|
64
65
|
VERIFY_SOLANA_ADDRESS = "Verify Solana address",
|
|
65
66
|
VIEW_ACTION = "View action",
|
|
66
67
|
VIEW_HEADER = "View Header",
|
|
@@ -68,4 +69,7 @@ export enum DeviceLabels {
|
|
|
68
69
|
CONFIRM_HEADER = "Confirm header",
|
|
69
70
|
CONFIRM_CHANGE = "Confirm change",
|
|
70
71
|
TAP_TO_CONTINUE = "Tap to continue",
|
|
72
|
+
PROVIDE_PUBLIC_KEY = "Provide Public Key",
|
|
73
|
+
YES_REJECT = "Yes, reject",
|
|
74
|
+
CONTINUE_ANYWAY = "Continue anyway",
|
|
71
75
|
}
|
package/src/e2e/speculos.ts
CHANGED
|
@@ -887,19 +887,40 @@ export async function verifyAmountsAndAcceptSwap(swap: Swap, amount: string) {
|
|
|
887
887
|
}
|
|
888
888
|
}
|
|
889
889
|
|
|
890
|
-
export async function verifyAmountsAndAcceptSwapForDifferentSeed(
|
|
891
|
-
|
|
890
|
+
export async function verifyAmountsAndAcceptSwapForDifferentSeed(
|
|
891
|
+
swap: Swap,
|
|
892
|
+
amount: string,
|
|
893
|
+
errorMessage: string | null,
|
|
894
|
+
) {
|
|
895
|
+
if (errorMessage === null && isTouchDevice()) {
|
|
896
|
+
await waitFor(DeviceLabels.RECEIVE_ADDRESS_DOES_NOT_BELONG);
|
|
897
|
+
await pressAndRelease(DeviceLabels.CONTINUE_ANYWAY);
|
|
898
|
+
} else {
|
|
899
|
+
await waitFor(DeviceLabels.REVIEW_TRANSACTION);
|
|
900
|
+
}
|
|
892
901
|
const events = await pressUntilTextFound(DeviceLabels.SIGN_TRANSACTION);
|
|
893
902
|
verifySwapData(swap, events, amount);
|
|
894
|
-
|
|
903
|
+
if (isTouchDevice()) {
|
|
904
|
+
await longPressAndRelease(DeviceLabels.HOLD_TO_SIGN, 3);
|
|
905
|
+
} else {
|
|
906
|
+
await pressBoth();
|
|
907
|
+
}
|
|
895
908
|
}
|
|
896
909
|
|
|
897
910
|
export async function verifyAmountsAndRejectSwap(swap: Swap, amount: string) {
|
|
898
911
|
await waitFor(DeviceLabels.REVIEW_TRANSACTION);
|
|
899
|
-
|
|
912
|
+
let events: string[] = [];
|
|
913
|
+
if (isTouchDevice()) {
|
|
914
|
+
events = await pressUntilTextFound(DeviceLabels.HOLD_TO_SIGN);
|
|
915
|
+
} else {
|
|
916
|
+
events = await pressUntilTextFound(DeviceLabels.REJECT);
|
|
917
|
+
}
|
|
918
|
+
|
|
900
919
|
verifySwapData(swap, events, amount);
|
|
901
920
|
if (isTouchDevice()) {
|
|
902
|
-
await
|
|
921
|
+
await pressAndRelease(DeviceLabels.REJECT);
|
|
922
|
+
await waitFor(DeviceLabels.YES_REJECT);
|
|
923
|
+
await pressAndRelease(DeviceLabels.YES_REJECT);
|
|
903
924
|
} else {
|
|
904
925
|
await pressBoth();
|
|
905
926
|
}
|
|
@@ -911,7 +932,6 @@ function verifySwapData(swap: Swap, events: string[], amount: string) {
|
|
|
911
932
|
if (getSpeculosModel() !== DeviceModelId.nanoS) {
|
|
912
933
|
expectDeviceScreenContains(swapPair, events, "Swap pair not found on the device screen");
|
|
913
934
|
}
|
|
914
|
-
|
|
915
935
|
expectDeviceScreenContains(amount, events, `Amount ${amount} not found on the device screen`);
|
|
916
936
|
}
|
|
917
937
|
|
|
@@ -97,7 +97,7 @@ exports[`aptos currency bridge scanAccounts aptos seed 1 2`] = `
|
|
|
97
97
|
"senders": [
|
|
98
98
|
"0xa0d8abc262e3321f87d745bd5d687e8f3fb14c87d48f840b6b56867df0026ec8",
|
|
99
99
|
],
|
|
100
|
-
"transactionSequenceNumber": 10,
|
|
100
|
+
"transactionSequenceNumber": "10",
|
|
101
101
|
"type": "IN",
|
|
102
102
|
"value": "100000",
|
|
103
103
|
},
|
|
@@ -118,7 +118,7 @@ exports[`aptos currency bridge scanAccounts aptos seed 1 2`] = `
|
|
|
118
118
|
"senders": [
|
|
119
119
|
"0xa0d8abc262e3321f87d745bd5d687e8f3fb14c87d48f840b6b56867df0026ec8",
|
|
120
120
|
],
|
|
121
|
-
"transactionSequenceNumber": 9,
|
|
121
|
+
"transactionSequenceNumber": "9",
|
|
122
122
|
"type": "IN",
|
|
123
123
|
"value": "20000",
|
|
124
124
|
},
|
|
@@ -139,7 +139,7 @@ exports[`aptos currency bridge scanAccounts aptos seed 1 2`] = `
|
|
|
139
139
|
"senders": [
|
|
140
140
|
"0xa0d8abc262e3321f87d745bd5d687e8f3fb14c87d48f840b6b56867df0026ec8",
|
|
141
141
|
],
|
|
142
|
-
"transactionSequenceNumber": 7,
|
|
142
|
+
"transactionSequenceNumber": "7",
|
|
143
143
|
"type": "IN",
|
|
144
144
|
"value": "20000",
|
|
145
145
|
},
|
|
@@ -160,7 +160,7 @@ exports[`aptos currency bridge scanAccounts aptos seed 1 2`] = `
|
|
|
160
160
|
"senders": [
|
|
161
161
|
"0x445fa0013887abd1a0c14acdec6e48090e0ad3fed3e08202aac15ca14f3be26b",
|
|
162
162
|
],
|
|
163
|
-
"transactionSequenceNumber": 1,
|
|
163
|
+
"transactionSequenceNumber": "1",
|
|
164
164
|
"type": "OUT",
|
|
165
165
|
"value": "30100",
|
|
166
166
|
},
|
|
@@ -181,7 +181,7 @@ exports[`aptos currency bridge scanAccounts aptos seed 1 2`] = `
|
|
|
181
181
|
"senders": [
|
|
182
182
|
"0xa0d8abc262e3321f87d745bd5d687e8f3fb14c87d48f840b6b56867df0026ec8",
|
|
183
183
|
],
|
|
184
|
-
"transactionSequenceNumber": 8,
|
|
184
|
+
"transactionSequenceNumber": "8",
|
|
185
185
|
"type": "IN",
|
|
186
186
|
"value": "10000",
|
|
187
187
|
},
|
|
@@ -202,7 +202,7 @@ exports[`aptos currency bridge scanAccounts aptos seed 1 2`] = `
|
|
|
202
202
|
"senders": [
|
|
203
203
|
"0xa0d8abc262e3321f87d745bd5d687e8f3fb14c87d48f840b6b56867df0026ec8",
|
|
204
204
|
],
|
|
205
|
-
"transactionSequenceNumber": 86,
|
|
205
|
+
"transactionSequenceNumber": "86",
|
|
206
206
|
"type": "IN",
|
|
207
207
|
"value": "20000000",
|
|
208
208
|
},
|
|
@@ -223,7 +223,7 @@ exports[`aptos currency bridge scanAccounts aptos seed 1 2`] = `
|
|
|
223
223
|
"senders": [
|
|
224
224
|
"0x445fa0013887abd1a0c14acdec6e48090e0ad3fed3e08202aac15ca14f3be26b",
|
|
225
225
|
],
|
|
226
|
-
"transactionSequenceNumber": 0,
|
|
226
|
+
"transactionSequenceNumber": "0",
|
|
227
227
|
"type": "OUT",
|
|
228
228
|
"value": "119900",
|
|
229
229
|
},
|
|
@@ -246,7 +246,7 @@ exports[`aptos currency bridge scanAccounts aptos seed 1 2`] = `
|
|
|
246
246
|
"senders": [
|
|
247
247
|
"0xb69a68cc64f7aa193705193f4dd598320a0a74baf7e4b50c9980c5bd60a82390",
|
|
248
248
|
],
|
|
249
|
-
"transactionSequenceNumber": 179,
|
|
249
|
+
"transactionSequenceNumber": "179",
|
|
250
250
|
"type": "IN",
|
|
251
251
|
"value": "10000",
|
|
252
252
|
},
|
|
@@ -267,7 +267,7 @@ exports[`aptos currency bridge scanAccounts aptos seed 1 2`] = `
|
|
|
267
267
|
"senders": [
|
|
268
268
|
"0xa0d8abc262e3321f87d745bd5d687e8f3fb14c87d48f840b6b56867df0026ec8",
|
|
269
269
|
],
|
|
270
|
-
"transactionSequenceNumber": 87,
|
|
270
|
+
"transactionSequenceNumber": "87",
|
|
271
271
|
"type": "IN",
|
|
272
272
|
"value": "20000000",
|
|
273
273
|
},
|
|
@@ -288,7 +288,7 @@ exports[`aptos currency bridge scanAccounts aptos seed 1 2`] = `
|
|
|
288
288
|
"senders": [
|
|
289
289
|
"0xb69a68cc64f7aa193705193f4dd598320a0a74baf7e4b50c9980c5bd60a82390",
|
|
290
290
|
],
|
|
291
|
-
"transactionSequenceNumber": 182,
|
|
291
|
+
"transactionSequenceNumber": "182",
|
|
292
292
|
"type": "IN",
|
|
293
293
|
"value": "10000",
|
|
294
294
|
},
|
|
@@ -309,7 +309,7 @@ exports[`aptos currency bridge scanAccounts aptos seed 1 2`] = `
|
|
|
309
309
|
"senders": [
|
|
310
310
|
"0xb69a68cc64f7aa193705193f4dd598320a0a74baf7e4b50c9980c5bd60a82390",
|
|
311
311
|
],
|
|
312
|
-
"transactionSequenceNumber": 181,
|
|
312
|
+
"transactionSequenceNumber": "181",
|
|
313
313
|
"type": "IN",
|
|
314
314
|
"value": "10000",
|
|
315
315
|
},
|
|
@@ -330,7 +330,7 @@ exports[`aptos currency bridge scanAccounts aptos seed 1 2`] = `
|
|
|
330
330
|
"senders": [
|
|
331
331
|
"0x445fa0013887abd1a0c14acdec6e48090e0ad3fed3e08202aac15ca14f3be26b",
|
|
332
332
|
],
|
|
333
|
-
"transactionSequenceNumber": 0,
|
|
333
|
+
"transactionSequenceNumber": "0",
|
|
334
334
|
"type": "IN",
|
|
335
335
|
"value": "20000",
|
|
336
336
|
},
|