@ledgerhq/live-common 34.49.0 → 34.50.0-nightly.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/__tests__/test-helpers/bridge.js +1 -1
- package/lib/__tests__/test-helpers/bridge.js.map +1 -1
- package/lib/__tests__/test-helpers/environment.js +2 -0
- package/lib/__tests__/test-helpers/environment.js.map +1 -1
- package/lib/apps/config.js +1 -1
- package/lib/bridge/generic-alpaca/alpaca/index.d.ts.map +1 -1
- package/lib/bridge/generic-alpaca/alpaca/index.js +3 -0
- package/lib/bridge/generic-alpaca/alpaca/index.js.map +1 -1
- package/lib/bridge/generic-alpaca/createTransaction.d.ts.map +1 -1
- package/lib/bridge/generic-alpaca/createTransaction.js +11 -0
- package/lib/bridge/generic-alpaca/createTransaction.js.map +1 -1
- package/lib/bridge/generic-alpaca/estimateMaxSpendable.d.ts.map +1 -1
- package/lib/bridge/generic-alpaca/estimateMaxSpendable.js +2 -3
- package/lib/bridge/generic-alpaca/estimateMaxSpendable.js.map +1 -1
- package/lib/bridge/generic-alpaca/getAccountShape.d.ts.map +1 -1
- package/lib/bridge/generic-alpaca/getAccountShape.js +11 -3
- package/lib/bridge/generic-alpaca/getAccountShape.js.map +1 -1
- package/lib/bridge/generic-alpaca/getTransactionStatus.d.ts.map +1 -1
- package/lib/bridge/generic-alpaca/getTransactionStatus.js +6 -4
- 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 +32 -4
- 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 -2
- package/lib/bridge/generic-alpaca/signOperation.js.map +1 -1
- package/lib/bridge/generic-alpaca/signer/index.d.ts.map +1 -1
- package/lib/bridge/generic-alpaca/signer/index.js +37 -0
- package/lib/bridge/generic-alpaca/signer/index.js.map +1 -1
- package/lib/bridge/generic-alpaca/signer/signTransaction.d.ts +2 -0
- package/lib/bridge/generic-alpaca/signer/signTransaction.d.ts.map +1 -1
- package/lib/bridge/generic-alpaca/signer/signTransaction.js +8 -1
- package/lib/bridge/generic-alpaca/signer/signTransaction.js.map +1 -1
- package/lib/bridge/generic-alpaca/tests/estimateMaxSpendable.test.js +15 -1
- package/lib/bridge/generic-alpaca/tests/estimateMaxSpendable.test.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/tests/signOperation.test.js +2 -2
- package/lib/bridge/generic-alpaca/tests/signOperation.test.js.map +1 -1
- package/lib/bridge/generic-alpaca/types.d.ts +7 -1
- package/lib/bridge/generic-alpaca/types.d.ts.map +1 -1
- package/lib/bridge/generic-alpaca/utils.d.ts +7 -1
- package/lib/bridge/generic-alpaca/utils.d.ts.map +1 -1
- package/lib/bridge/generic-alpaca/utils.js +31 -29
- package/lib/bridge/generic-alpaca/utils.js.map +1 -1
- package/lib/bridge/generic-alpaca/utils.test.js +32 -0
- package/lib/bridge/generic-alpaca/utils.test.js.map +1 -1
- package/lib/bridge/impl.d.ts.map +1 -1
- package/lib/bridge/impl.js +1 -0
- package/lib/bridge/impl.js.map +1 -1
- package/lib/bridge/react/BridgeSync.d.ts.map +1 -1
- package/lib/bridge/react/BridgeSync.js +17 -4
- package/lib/bridge/react/BridgeSync.js.map +1 -1
- package/lib/bridge/syncSessionManager/index.d.ts +18 -0
- package/lib/bridge/syncSessionManager/index.d.ts.map +1 -0
- package/lib/bridge/syncSessionManager/index.js +75 -0
- package/lib/bridge/syncSessionManager/index.js.map +1 -0
- package/lib/bridge/syncSessionManager/index.test.d.ts +2 -0
- package/lib/bridge/syncSessionManager/index.test.d.ts.map +1 -0
- package/lib/bridge/syncSessionManager/index.test.js +118 -0
- package/lib/bridge/syncSessionManager/index.test.js.map +1 -0
- package/lib/deposit/deposit.integration.test.js +60 -1
- package/lib/deposit/deposit.integration.test.js.map +1 -1
- package/lib/e2e/data/deviceLabelsData.js +2 -2
- package/lib/e2e/data/deviceLabelsData.js.map +1 -1
- package/lib/e2e/enum/Account.d.ts +2 -0
- package/lib/e2e/enum/Account.d.ts.map +1 -1
- package/lib/e2e/enum/Account.js +3 -1
- package/lib/e2e/enum/Account.js.map +1 -1
- package/lib/e2e/enum/DeviceLabels.d.ts +3 -9
- package/lib/e2e/enum/DeviceLabels.d.ts.map +1 -1
- package/lib/e2e/enum/DeviceLabels.js +2 -8
- package/lib/e2e/enum/DeviceLabels.js.map +1 -1
- package/lib/e2e/enum/Network.d.ts +1 -0
- package/lib/e2e/enum/Network.d.ts.map +1 -1
- package/lib/e2e/enum/Network.js +1 -0
- package/lib/e2e/enum/Network.js.map +1 -1
- package/lib/e2e/families/bitcoin.d.ts +1 -0
- package/lib/e2e/families/bitcoin.d.ts.map +1 -1
- package/lib/e2e/families/bitcoin.js +28 -1
- package/lib/e2e/families/bitcoin.js.map +1 -1
- package/lib/e2e/families/tezos.d.ts.map +1 -1
- package/lib/e2e/families/tezos.js +5 -3
- package/lib/e2e/families/tezos.js.map +1 -1
- package/lib/e2e/index.d.ts +8 -0
- package/lib/e2e/index.d.ts.map +1 -1
- package/lib/e2e/models/Swap.d.ts +2 -0
- package/lib/e2e/models/Swap.d.ts.map +1 -1
- package/lib/e2e/models/Swap.js +6 -0
- package/lib/e2e/models/Swap.js.map +1 -1
- package/lib/e2e/speculos.d.ts +8 -0
- package/lib/e2e/speculos.d.ts.map +1 -1
- package/lib/e2e/speculos.js +23 -31
- package/lib/e2e/speculos.js.map +1 -1
- package/lib/exchange/providers/swap.js +2 -2
- package/lib/exchange/providers/swap.js.map +1 -1
- package/lib/families/canton/bridge/mock.d.ts.map +1 -1
- package/lib/families/canton/bridge/mock.js +1 -0
- package/lib/families/canton/bridge/mock.js.map +1 -1
- package/lib/families/canton/config.d.ts.map +1 -1
- package/lib/families/canton/config.js +2 -0
- package/lib/families/canton/config.js.map +1 -1
- package/lib/families/celo/bridge.integration.test.js +4 -1
- package/lib/families/celo/bridge.integration.test.js.map +1 -1
- package/lib/families/cosmos/datasets/axelar.integration.test.js +4 -1
- package/lib/families/cosmos/datasets/axelar.integration.test.js.map +1 -1
- package/lib/families/cosmos/datasets/desmos.integration.test.js +4 -1
- package/lib/families/cosmos/datasets/desmos.integration.test.js.map +1 -1
- package/lib/families/cosmos/datasets/onomy.integration.test.js +4 -1
- package/lib/families/cosmos/datasets/onomy.integration.test.js.map +1 -1
- package/lib/families/evm/config.d.ts.map +1 -1
- package/lib/families/evm/config.js +26 -0
- package/lib/families/evm/config.js.map +1 -1
- package/lib/families/filecoin/bridge.integration.test.js +4 -1
- package/lib/families/filecoin/bridge.integration.test.js.map +1 -1
- package/lib/families/mina/bridge.integration.test.js +4 -1
- package/lib/families/mina/bridge.integration.test.js.map +1 -1
- package/lib/families/multiversx/synchronisation.integration.test.js +4 -1
- package/lib/families/multiversx/synchronisation.integration.test.js.map +1 -1
- package/lib/families/tezos/react.d.ts +2 -1
- package/lib/families/tezos/react.d.ts.map +1 -1
- package/lib/families/tezos/react.js +19 -1
- package/lib/families/tezos/react.js.map +1 -1
- package/lib/families/tezos/setup.d.ts +1 -4
- package/lib/families/tezos/setup.d.ts.map +1 -1
- package/lib/families/tezos/setup.js +3 -11
- package/lib/families/tezos/setup.js.map +1 -1
- package/lib/families/ton/bridge.integration.test.js +4 -1
- package/lib/families/ton/bridge.integration.test.js.map +1 -1
- package/lib/featureFlags/defaultFeatures.d.ts +2 -0
- package/lib/featureFlags/defaultFeatures.d.ts.map +1 -1
- package/lib/featureFlags/defaultFeatures.js +4 -0
- 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 +0 -1
- package/lib/generated/bridge/js.d.ts.map +1 -1
- package/lib/generated/bridge/js.js +10 -12
- package/lib/generated/bridge/js.js.map +1 -1
- package/lib/modularDrawer/hooks/modules/useLeftApyModule.d.ts +1 -0
- package/lib/modularDrawer/hooks/modules/useLeftApyModule.d.ts.map +1 -1
- package/lib/modularDrawer/hooks/modules/useLeftMarketTrendModule.d.ts +1 -0
- package/lib/modularDrawer/hooks/modules/useLeftMarketTrendModule.d.ts.map +1 -1
- package/lib/modularDrawer/hooks/modules/useRightMarketTrendModule.d.ts +1 -0
- package/lib/modularDrawer/hooks/modules/useRightMarketTrendModule.d.ts.map +1 -1
- package/lib/modularDrawer/hooks/useRightBalanceAsset.d.ts +6 -1
- package/lib/modularDrawer/hooks/useRightBalanceAsset.d.ts.map +1 -1
- package/lib/modularDrawer/hooks/useRightBalanceAsset.js +11 -14
- package/lib/modularDrawer/hooks/useRightBalanceAsset.js.map +1 -1
- package/lib/modularDrawer/hooks/useRightBalanceNetwork.d.ts +3 -1
- package/lib/modularDrawer/hooks/useRightBalanceNetwork.d.ts.map +1 -1
- package/lib/modularDrawer/hooks/useRightBalanceNetwork.js +3 -3
- package/lib/modularDrawer/hooks/useRightBalanceNetwork.js.map +1 -1
- package/lib/modularDrawer/modules/createAssetConfiguration.d.ts.map +1 -1
- package/lib/modularDrawer/modules/createAssetConfiguration.js +1 -0
- package/lib/modularDrawer/modules/createAssetConfiguration.js.map +1 -1
- package/lib/modularDrawer/utils/groupCurrenciesByProvider.d.ts +7 -0
- package/lib/modularDrawer/utils/groupCurrenciesByProvider.d.ts.map +1 -0
- package/lib/modularDrawer/utils/groupCurrenciesByProvider.js +21 -0
- package/lib/modularDrawer/utils/groupCurrenciesByProvider.js.map +1 -0
- package/lib/modularDrawer/utils/index.d.ts +2 -1
- package/lib/modularDrawer/utils/index.d.ts.map +1 -1
- package/lib/modularDrawer/utils/index.js +3 -1
- package/lib/modularDrawer/utils/index.js.map +1 -1
- package/lib/modularDrawer/utils/type.d.ts +18 -0
- package/lib/modularDrawer/utils/type.d.ts.map +1 -1
- package/lib/notifications/ServiceStatusProvider/entry-points.d.ts +3 -0
- package/lib/notifications/ServiceStatusProvider/entry-points.d.ts.map +1 -0
- package/lib/notifications/ServiceStatusProvider/entry-points.js +3 -0
- package/lib/notifications/ServiceStatusProvider/entry-points.js.map +1 -0
- package/lib/notifications/ServiceStatusProvider/index.d.ts +18 -1
- package/lib/notifications/ServiceStatusProvider/index.d.ts.map +1 -1
- package/lib/notifications/ServiceStatusProvider/index.js +47 -9
- package/lib/notifications/ServiceStatusProvider/index.js.map +1 -1
- package/lib/notifications/ServiceStatusProvider/index.test.d.ts +2 -0
- package/lib/notifications/ServiceStatusProvider/index.test.d.ts.map +1 -0
- package/lib/notifications/ServiceStatusProvider/index.test.js +88 -0
- package/lib/notifications/ServiceStatusProvider/index.test.js.map +1 -0
- package/lib/notifications/ServiceStatusProvider/ledger-components.d.ts +2 -0
- package/lib/notifications/ServiceStatusProvider/ledger-components.d.ts.map +1 -0
- package/lib/notifications/ServiceStatusProvider/ledger-components.js +17 -0
- package/lib/notifications/ServiceStatusProvider/ledger-components.js.map +1 -0
- package/lib/notifications/ServiceStatusProvider/mocks/ledgerStatus.d.ts +154 -0
- package/lib/notifications/ServiceStatusProvider/mocks/ledgerStatus.d.ts.map +1 -0
- package/lib/notifications/ServiceStatusProvider/mocks/ledgerStatus.js +1192 -0
- package/lib/notifications/ServiceStatusProvider/mocks/ledgerStatus.js.map +1 -0
- package/lib/notifications/ServiceStatusProvider/types.d.ts +3 -1
- package/lib/notifications/ServiceStatusProvider/types.d.ts.map +1 -1
- package/lib/wallet-api/react.d.ts +1 -1
- package/lib/wallet-api/react.d.ts.map +1 -1
- package/lib/wallet-api/react.js +1 -1
- package/lib/wallet-api/react.js.map +1 -1
- package/lib-es/__tests__/test-helpers/bridge.js +1 -1
- package/lib-es/__tests__/test-helpers/bridge.js.map +1 -1
- package/lib-es/__tests__/test-helpers/environment.js +2 -0
- package/lib-es/__tests__/test-helpers/environment.js.map +1 -1
- package/lib-es/apps/config.js +1 -1
- package/lib-es/bridge/generic-alpaca/alpaca/index.d.ts.map +1 -1
- package/lib-es/bridge/generic-alpaca/alpaca/index.js +3 -0
- package/lib-es/bridge/generic-alpaca/alpaca/index.js.map +1 -1
- package/lib-es/bridge/generic-alpaca/createTransaction.d.ts.map +1 -1
- package/lib-es/bridge/generic-alpaca/createTransaction.js +11 -0
- package/lib-es/bridge/generic-alpaca/createTransaction.js.map +1 -1
- package/lib-es/bridge/generic-alpaca/estimateMaxSpendable.d.ts.map +1 -1
- package/lib-es/bridge/generic-alpaca/estimateMaxSpendable.js +2 -3
- package/lib-es/bridge/generic-alpaca/estimateMaxSpendable.js.map +1 -1
- package/lib-es/bridge/generic-alpaca/getAccountShape.d.ts.map +1 -1
- package/lib-es/bridge/generic-alpaca/getAccountShape.js +11 -3
- package/lib-es/bridge/generic-alpaca/getAccountShape.js.map +1 -1
- package/lib-es/bridge/generic-alpaca/getTransactionStatus.d.ts.map +1 -1
- package/lib-es/bridge/generic-alpaca/getTransactionStatus.js +6 -4
- 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 +32 -4
- 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 -2
- package/lib-es/bridge/generic-alpaca/signOperation.js.map +1 -1
- package/lib-es/bridge/generic-alpaca/signer/index.d.ts.map +1 -1
- package/lib-es/bridge/generic-alpaca/signer/index.js +38 -1
- package/lib-es/bridge/generic-alpaca/signer/index.js.map +1 -1
- package/lib-es/bridge/generic-alpaca/signer/signTransaction.d.ts +2 -0
- package/lib-es/bridge/generic-alpaca/signer/signTransaction.d.ts.map +1 -1
- package/lib-es/bridge/generic-alpaca/signer/signTransaction.js +6 -0
- package/lib-es/bridge/generic-alpaca/signer/signTransaction.js.map +1 -1
- package/lib-es/bridge/generic-alpaca/tests/estimateMaxSpendable.test.js +15 -1
- package/lib-es/bridge/generic-alpaca/tests/estimateMaxSpendable.test.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/tests/signOperation.test.js +2 -2
- package/lib-es/bridge/generic-alpaca/tests/signOperation.test.js.map +1 -1
- package/lib-es/bridge/generic-alpaca/types.d.ts +7 -1
- package/lib-es/bridge/generic-alpaca/types.d.ts.map +1 -1
- package/lib-es/bridge/generic-alpaca/utils.d.ts +7 -1
- package/lib-es/bridge/generic-alpaca/utils.d.ts.map +1 -1
- package/lib-es/bridge/generic-alpaca/utils.js +31 -29
- package/lib-es/bridge/generic-alpaca/utils.js.map +1 -1
- package/lib-es/bridge/generic-alpaca/utils.test.js +33 -1
- package/lib-es/bridge/generic-alpaca/utils.test.js.map +1 -1
- package/lib-es/bridge/impl.d.ts.map +1 -1
- package/lib-es/bridge/impl.js +1 -0
- package/lib-es/bridge/impl.js.map +1 -1
- package/lib-es/bridge/react/BridgeSync.d.ts.map +1 -1
- package/lib-es/bridge/react/BridgeSync.js +17 -4
- package/lib-es/bridge/react/BridgeSync.js.map +1 -1
- package/lib-es/bridge/syncSessionManager/index.d.ts +18 -0
- package/lib-es/bridge/syncSessionManager/index.d.ts.map +1 -0
- package/lib-es/bridge/syncSessionManager/index.js +68 -0
- package/lib-es/bridge/syncSessionManager/index.js.map +1 -0
- package/lib-es/bridge/syncSessionManager/index.test.d.ts +2 -0
- package/lib-es/bridge/syncSessionManager/index.test.d.ts.map +1 -0
- package/lib-es/bridge/syncSessionManager/index.test.js +116 -0
- package/lib-es/bridge/syncSessionManager/index.test.js.map +1 -0
- package/lib-es/deposit/deposit.integration.test.js +37 -1
- package/lib-es/deposit/deposit.integration.test.js.map +1 -1
- package/lib-es/e2e/data/deviceLabelsData.js +2 -2
- package/lib-es/e2e/data/deviceLabelsData.js.map +1 -1
- package/lib-es/e2e/enum/Account.d.ts +2 -0
- package/lib-es/e2e/enum/Account.d.ts.map +1 -1
- package/lib-es/e2e/enum/Account.js +3 -1
- package/lib-es/e2e/enum/Account.js.map +1 -1
- package/lib-es/e2e/enum/DeviceLabels.d.ts +3 -9
- package/lib-es/e2e/enum/DeviceLabels.d.ts.map +1 -1
- package/lib-es/e2e/enum/DeviceLabels.js +2 -8
- package/lib-es/e2e/enum/DeviceLabels.js.map +1 -1
- package/lib-es/e2e/enum/Network.d.ts +1 -0
- package/lib-es/e2e/enum/Network.d.ts.map +1 -1
- package/lib-es/e2e/enum/Network.js +1 -0
- package/lib-es/e2e/enum/Network.js.map +1 -1
- package/lib-es/e2e/families/bitcoin.d.ts +1 -0
- package/lib-es/e2e/families/bitcoin.d.ts.map +1 -1
- package/lib-es/e2e/families/bitcoin.js +27 -1
- package/lib-es/e2e/families/bitcoin.js.map +1 -1
- package/lib-es/e2e/families/tezos.d.ts.map +1 -1
- package/lib-es/e2e/families/tezos.js +6 -4
- package/lib-es/e2e/families/tezos.js.map +1 -1
- package/lib-es/e2e/index.d.ts +8 -0
- package/lib-es/e2e/index.d.ts.map +1 -1
- package/lib-es/e2e/models/Swap.d.ts +2 -0
- package/lib-es/e2e/models/Swap.d.ts.map +1 -1
- package/lib-es/e2e/models/Swap.js +6 -0
- package/lib-es/e2e/models/Swap.js.map +1 -1
- package/lib-es/e2e/speculos.d.ts +8 -0
- package/lib-es/e2e/speculos.d.ts.map +1 -1
- package/lib-es/e2e/speculos.js +23 -32
- package/lib-es/e2e/speculos.js.map +1 -1
- package/lib-es/exchange/providers/swap.js +2 -2
- package/lib-es/exchange/providers/swap.js.map +1 -1
- package/lib-es/families/canton/bridge/mock.d.ts.map +1 -1
- package/lib-es/families/canton/bridge/mock.js +1 -0
- package/lib-es/families/canton/bridge/mock.js.map +1 -1
- package/lib-es/families/canton/config.d.ts.map +1 -1
- package/lib-es/families/canton/config.js +2 -0
- package/lib-es/families/canton/config.js.map +1 -1
- package/lib-es/families/celo/bridge.integration.test.js +4 -1
- package/lib-es/families/celo/bridge.integration.test.js.map +1 -1
- package/lib-es/families/cosmos/datasets/axelar.integration.test.js +4 -1
- package/lib-es/families/cosmos/datasets/axelar.integration.test.js.map +1 -1
- package/lib-es/families/cosmos/datasets/desmos.integration.test.js +4 -1
- package/lib-es/families/cosmos/datasets/desmos.integration.test.js.map +1 -1
- package/lib-es/families/cosmos/datasets/onomy.integration.test.js +4 -1
- package/lib-es/families/cosmos/datasets/onomy.integration.test.js.map +1 -1
- package/lib-es/families/evm/config.d.ts.map +1 -1
- package/lib-es/families/evm/config.js +26 -0
- package/lib-es/families/evm/config.js.map +1 -1
- package/lib-es/families/filecoin/bridge.integration.test.js +4 -1
- package/lib-es/families/filecoin/bridge.integration.test.js.map +1 -1
- package/lib-es/families/mina/bridge.integration.test.js +4 -1
- package/lib-es/families/mina/bridge.integration.test.js.map +1 -1
- package/lib-es/families/multiversx/synchronisation.integration.test.js +4 -1
- package/lib-es/families/multiversx/synchronisation.integration.test.js.map +1 -1
- package/lib-es/families/tezos/react.d.ts +2 -1
- package/lib-es/families/tezos/react.d.ts.map +1 -1
- package/lib-es/families/tezos/react.js +17 -0
- package/lib-es/families/tezos/react.js.map +1 -1
- package/lib-es/families/tezos/setup.d.ts +1 -4
- package/lib-es/families/tezos/setup.d.ts.map +1 -1
- package/lib-es/families/tezos/setup.js +2 -9
- package/lib-es/families/tezos/setup.js.map +1 -1
- package/lib-es/families/ton/bridge.integration.test.js +4 -1
- package/lib-es/families/ton/bridge.integration.test.js.map +1 -1
- package/lib-es/featureFlags/defaultFeatures.d.ts +2 -0
- package/lib-es/featureFlags/defaultFeatures.d.ts.map +1 -1
- package/lib-es/featureFlags/defaultFeatures.js +4 -0
- 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 +0 -1
- package/lib-es/generated/bridge/js.d.ts.map +1 -1
- package/lib-es/generated/bridge/js.js +0 -2
- package/lib-es/generated/bridge/js.js.map +1 -1
- package/lib-es/modularDrawer/hooks/modules/useLeftApyModule.d.ts +1 -0
- package/lib-es/modularDrawer/hooks/modules/useLeftApyModule.d.ts.map +1 -1
- package/lib-es/modularDrawer/hooks/modules/useLeftMarketTrendModule.d.ts +1 -0
- package/lib-es/modularDrawer/hooks/modules/useLeftMarketTrendModule.d.ts.map +1 -1
- package/lib-es/modularDrawer/hooks/modules/useRightMarketTrendModule.d.ts +1 -0
- package/lib-es/modularDrawer/hooks/modules/useRightMarketTrendModule.d.ts.map +1 -1
- package/lib-es/modularDrawer/hooks/useRightBalanceAsset.d.ts +6 -1
- package/lib-es/modularDrawer/hooks/useRightBalanceAsset.d.ts.map +1 -1
- package/lib-es/modularDrawer/hooks/useRightBalanceAsset.js +11 -14
- package/lib-es/modularDrawer/hooks/useRightBalanceAsset.js.map +1 -1
- package/lib-es/modularDrawer/hooks/useRightBalanceNetwork.d.ts +3 -1
- package/lib-es/modularDrawer/hooks/useRightBalanceNetwork.d.ts.map +1 -1
- package/lib-es/modularDrawer/hooks/useRightBalanceNetwork.js +3 -3
- package/lib-es/modularDrawer/hooks/useRightBalanceNetwork.js.map +1 -1
- package/lib-es/modularDrawer/modules/createAssetConfiguration.d.ts.map +1 -1
- package/lib-es/modularDrawer/modules/createAssetConfiguration.js +1 -0
- package/lib-es/modularDrawer/modules/createAssetConfiguration.js.map +1 -1
- package/lib-es/modularDrawer/utils/groupCurrenciesByProvider.d.ts +7 -0
- package/lib-es/modularDrawer/utils/groupCurrenciesByProvider.d.ts.map +1 -0
- package/lib-es/modularDrawer/utils/groupCurrenciesByProvider.js +17 -0
- package/lib-es/modularDrawer/utils/groupCurrenciesByProvider.js.map +1 -0
- package/lib-es/modularDrawer/utils/index.d.ts +2 -1
- package/lib-es/modularDrawer/utils/index.d.ts.map +1 -1
- package/lib-es/modularDrawer/utils/index.js +2 -1
- package/lib-es/modularDrawer/utils/index.js.map +1 -1
- package/lib-es/modularDrawer/utils/type.d.ts +18 -0
- package/lib-es/modularDrawer/utils/type.d.ts.map +1 -1
- package/lib-es/notifications/ServiceStatusProvider/entry-points.d.ts +3 -0
- package/lib-es/notifications/ServiceStatusProvider/entry-points.d.ts.map +1 -0
- package/lib-es/notifications/ServiceStatusProvider/entry-points.js +2 -0
- package/lib-es/notifications/ServiceStatusProvider/entry-points.js.map +1 -0
- package/lib-es/notifications/ServiceStatusProvider/index.d.ts +18 -1
- package/lib-es/notifications/ServiceStatusProvider/index.d.ts.map +1 -1
- package/lib-es/notifications/ServiceStatusProvider/index.js +47 -9
- package/lib-es/notifications/ServiceStatusProvider/index.js.map +1 -1
- package/lib-es/notifications/ServiceStatusProvider/index.test.d.ts +2 -0
- package/lib-es/notifications/ServiceStatusProvider/index.test.d.ts.map +1 -0
- package/lib-es/notifications/ServiceStatusProvider/index.test.js +86 -0
- package/lib-es/notifications/ServiceStatusProvider/index.test.js.map +1 -0
- package/lib-es/notifications/ServiceStatusProvider/ledger-components.d.ts +2 -0
- package/lib-es/notifications/ServiceStatusProvider/ledger-components.d.ts.map +1 -0
- package/lib-es/notifications/ServiceStatusProvider/ledger-components.js +14 -0
- package/lib-es/notifications/ServiceStatusProvider/ledger-components.js.map +1 -0
- package/lib-es/notifications/ServiceStatusProvider/mocks/ledgerStatus.d.ts +154 -0
- package/lib-es/notifications/ServiceStatusProvider/mocks/ledgerStatus.d.ts.map +1 -0
- package/lib-es/notifications/ServiceStatusProvider/mocks/ledgerStatus.js +1189 -0
- package/lib-es/notifications/ServiceStatusProvider/mocks/ledgerStatus.js.map +1 -0
- package/lib-es/notifications/ServiceStatusProvider/types.d.ts +3 -1
- package/lib-es/notifications/ServiceStatusProvider/types.d.ts.map +1 -1
- package/lib-es/wallet-api/react.d.ts +1 -1
- package/lib-es/wallet-api/react.d.ts.map +1 -1
- package/lib-es/wallet-api/react.js +1 -1
- package/lib-es/wallet-api/react.js.map +1 -1
- package/package.json +45 -45
- package/src/__tests__/test-helpers/bridge.ts +1 -1
- package/src/__tests__/test-helpers/environment.ts +2 -0
- package/src/apps/config.ts +1 -1
- package/src/bridge/generic-alpaca/alpaca/index.ts +4 -0
- package/src/bridge/generic-alpaca/createTransaction.ts +11 -0
- package/src/bridge/generic-alpaca/estimateMaxSpendable.ts +6 -3
- package/src/bridge/generic-alpaca/getAccountShape.ts +13 -3
- package/src/bridge/generic-alpaca/getTransactionStatus.ts +6 -4
- package/src/bridge/generic-alpaca/prepareTransaction.ts +59 -6
- package/src/bridge/generic-alpaca/signOperation.ts +8 -2
- package/src/bridge/generic-alpaca/signer/index.ts +44 -1
- package/src/bridge/generic-alpaca/signer/signTransaction.ts +10 -0
- package/src/bridge/generic-alpaca/tests/estimateMaxSpendable.test.ts +15 -1
- package/src/bridge/generic-alpaca/tests/prepareTransaction.test.ts +1 -0
- package/src/bridge/generic-alpaca/tests/signOperation.test.ts +2 -2
- package/src/bridge/generic-alpaca/types.ts +13 -2
- package/src/bridge/generic-alpaca/utils.test.ts +65 -0
- package/src/bridge/generic-alpaca/utils.ts +42 -30
- package/src/bridge/impl.ts +1 -0
- package/src/bridge/react/BridgeSync.tsx +17 -3
- package/src/bridge/syncSessionManager/index.test.ts +151 -0
- package/src/bridge/syncSessionManager/index.ts +93 -0
- package/src/deposit/deposit.integration.test.ts +41 -2
- package/src/e2e/data/deviceLabelsData.ts +2 -2
- package/src/e2e/enum/Account.ts +13 -0
- package/src/e2e/enum/DeviceLabels.ts +2 -8
- package/src/e2e/enum/Network.ts +1 -0
- package/src/e2e/families/bitcoin.ts +33 -1
- package/src/e2e/families/tezos.ts +13 -4
- package/src/e2e/models/Swap.ts +8 -0
- package/src/e2e/speculos.ts +26 -35
- package/src/exchange/providers/swap.ts +2 -2
- package/src/families/canton/bridge/mock.ts +1 -0
- package/src/families/canton/config.ts +2 -0
- package/src/families/celo/bridge.integration.test.ts +4 -1
- package/src/families/cosmos/datasets/__snapshots__/babylon.integration.test.ts.snap +2 -2
- package/src/families/cosmos/datasets/__snapshots__/cosmos.integration.test.ts.snap +299 -4
- package/src/families/cosmos/datasets/__snapshots__/cryptoOrg.integration.test.ts.snap +2 -2
- package/src/families/cosmos/datasets/__snapshots__/injective.integration.test.ts.snap +2 -2
- package/src/families/cosmos/datasets/__snapshots__/mantra.integration.test.ts.snap +2 -2
- package/src/families/cosmos/datasets/__snapshots__/osmosis.integration.test.ts.snap +2 -2
- package/src/families/cosmos/datasets/__snapshots__/persistence.integration.test.ts.snap +4 -4
- package/src/families/cosmos/datasets/__snapshots__/stargaze.integration.test.ts.snap +2 -2
- package/src/families/cosmos/datasets/__snapshots__/xion.integration.test.ts.snap +2 -2
- package/src/families/cosmos/datasets/axelar.integration.test.ts +4 -1
- package/src/families/cosmos/datasets/desmos.integration.test.ts +4 -1
- package/src/families/cosmos/datasets/onomy.integration.test.ts +4 -1
- package/src/families/evm/config.ts +26 -0
- package/src/families/filecoin/bridge.integration.test.ts +4 -1
- package/src/families/internet_computer/__snapshots__/bridge.integration.test.ts.snap +60 -3
- package/src/families/mina/bridge.integration.test.ts +4 -1
- package/src/families/multiversx/synchronisation.integration.test.ts +5 -1
- package/src/families/polkadot/__snapshots__/bridge.integration.test.ts.snap +50 -4
- package/src/families/stacks/__snapshots__/bridge.integration.test.ts.snap +23 -3
- package/src/families/stellar/__snapshots__/bridge.integration.test.ts.snap +1490 -60
- package/src/families/tezos/react.ts +20 -1
- package/src/families/tezos/setup.ts +3 -22
- package/src/families/ton/bridge.integration.test.ts +4 -1
- package/src/featureFlags/defaultFeatures.ts +4 -0
- package/src/generated/bridge/js.ts +0 -2
- package/src/modularDrawer/hooks/useRightBalanceAsset.tsx +26 -21
- package/src/modularDrawer/hooks/useRightBalanceNetwork.tsx +4 -2
- package/src/modularDrawer/modules/createAssetConfiguration.ts +1 -0
- package/src/modularDrawer/utils/groupCurrenciesByProvider.ts +27 -0
- package/src/modularDrawer/utils/index.ts +2 -0
- package/src/modularDrawer/utils/type.ts +19 -0
- package/src/notifications/ServiceStatusProvider/entry-points.ts +3 -0
- package/src/notifications/ServiceStatusProvider/index.test.ts +102 -0
- package/src/notifications/ServiceStatusProvider/index.tsx +61 -13
- package/src/notifications/ServiceStatusProvider/ledger-components.ts +13 -0
- package/src/notifications/ServiceStatusProvider/mocks/ledgerStatus.ts +1188 -0
- package/src/notifications/ServiceStatusProvider/types.ts +4 -1
- package/src/wallet-api/react.ts +3 -3
- package/src/families/celo/__snapshots__/bridge.integration.test.ts.snap +0 -285
- package/src/families/cosmos/datasets/__snapshots__/axelar.integration.test.ts.snap +0 -45
- package/src/families/cosmos/datasets/__snapshots__/desmos.integration.test.ts.snap +0 -45
- package/src/families/cosmos/datasets/__snapshots__/onomy.integration.test.ts.snap +0 -45
- package/src/families/filecoin/__snapshots__/bridge.integration.test.ts.snap +0 -242
- package/src/families/mina/__snapshots__/bridge.integration.test.ts.snap +0 -169
- package/src/families/ton/__snapshots__/bridge.integration.test.ts.snap +0 -338
@@ -1,6 +1,6 @@
|
|
1
1
|
import type { AccountLike } from "@ledgerhq/types-live";
|
2
2
|
import { useEffect, useMemo, useState } from "react";
|
3
|
-
import { Baker, Delegation } from "@ledgerhq/coin-tezos/types/index";
|
3
|
+
import { Baker, Delegation, StakingPosition } from "@ledgerhq/coin-tezos/types/index";
|
4
4
|
import { bakers } from "@ledgerhq/coin-tezos/network/index";
|
5
5
|
|
6
6
|
export function useBakers(whitelistAddresses: string[]): Baker[] {
|
@@ -55,3 +55,22 @@ export function useRandomBaker(bakers: Baker[]): Baker {
|
|
55
55
|
}, [bakers.length]);
|
56
56
|
return bakers[randomBakerIndex];
|
57
57
|
}
|
58
|
+
|
59
|
+
export function useStakingPositions(account: AccountLike): StakingPosition[] {
|
60
|
+
const delegation = useDelegation(account);
|
61
|
+
|
62
|
+
return useMemo(() => {
|
63
|
+
if (account.type !== "Account" || !delegation?.address) return [];
|
64
|
+
|
65
|
+
return [
|
66
|
+
{
|
67
|
+
uid: account.freshAddress,
|
68
|
+
address: account.freshAddress,
|
69
|
+
delegate: delegation.address,
|
70
|
+
state: "active" as const,
|
71
|
+
asset: { type: "native" as const },
|
72
|
+
amount: BigInt(account.balance.toString()),
|
73
|
+
},
|
74
|
+
];
|
75
|
+
}, [account, delegation]);
|
76
|
+
}
|
@@ -1,24 +1,14 @@
|
|
1
1
|
// Goal of this file is to inject all necessary device/signer dependency to coin-modules
|
2
2
|
|
3
3
|
import { DerivationType, LedgerSigner } from "@taquito/ledger-signer";
|
4
|
-
import {
|
5
|
-
import { TezosCoinConfig } from "@ledgerhq/coin-tezos/config";
|
6
|
-
import { createBridges } from "@ledgerhq/coin-tezos/bridge/index";
|
7
|
-
import type {
|
8
|
-
Transaction,
|
9
|
-
TezosSigner,
|
10
|
-
TransactionStatus,
|
11
|
-
TezosAccount,
|
12
|
-
} from "@ledgerhq/coin-tezos/types/index";
|
4
|
+
import type { TezosSigner } from "@ledgerhq/coin-tezos/types/index";
|
13
5
|
import makeCliTools from "@ledgerhq/coin-tezos/test/cli";
|
14
6
|
import type { CliTools } from "@ledgerhq/coin-tezos/test/cli";
|
15
7
|
import tezosResolver from "@ledgerhq/coin-tezos/signer/index";
|
16
8
|
import Xtz, { Curve } from "@ledgerhq/hw-app-tezos";
|
17
9
|
import Transport from "@ledgerhq/hw-transport";
|
18
|
-
import
|
19
|
-
import { CreateSigner, createResolver, executeWithSigner } from "../../bridge/setup";
|
10
|
+
import { createResolver, CreateSigner } from "../../bridge/setup";
|
20
11
|
import { Resolver } from "../../hw/getAddress/types";
|
21
|
-
import { getCurrencyConfiguration } from "../../config";
|
22
12
|
|
23
13
|
const createSigner: CreateSigner<TezosSigner> = (transport: Transport) => {
|
24
14
|
const xtz = new Xtz(transport);
|
@@ -46,17 +36,8 @@ const createSigner: CreateSigner<TezosSigner> = (transport: Transport) => {
|
|
46
36
|
};
|
47
37
|
};
|
48
38
|
|
49
|
-
const getCurrencyConfig = (): TezosCoinConfig => {
|
50
|
-
return getCurrencyConfiguration(getCryptoCurrencyById("tezos"));
|
51
|
-
};
|
52
|
-
|
53
|
-
const bridge: Bridge<Transaction, TezosAccount, TransactionStatus> = createBridges(
|
54
|
-
executeWithSigner(createSigner),
|
55
|
-
getCurrencyConfig,
|
56
|
-
);
|
57
|
-
|
58
39
|
const resolver: Resolver = createResolver(createSigner, tezosResolver);
|
59
40
|
|
60
41
|
const cliTools: CliTools = makeCliTools();
|
61
42
|
|
62
|
-
export {
|
43
|
+
export { cliTools, resolver };
|
@@ -2,4 +2,7 @@ import { dataset } from "@ledgerhq/coin-ton/__tests__/integration/bridge.integra
|
|
2
2
|
import { testBridge } from "../../__tests__/test-helpers/bridge";
|
3
3
|
import "../../__tests__/test-helpers/setup";
|
4
4
|
|
5
|
-
|
5
|
+
// FIXME: Disabled due to TypeError in Send max transaction (ts.amount undefined)
|
6
|
+
describe.skip("ton integration", () => {
|
7
|
+
testBridge(dataset);
|
8
|
+
});
|
@@ -97,6 +97,8 @@ export const CURRENCY_DEFAULT_FEATURES = {
|
|
97
97
|
currencyHyperevm: DEFAULT_FEATURE,
|
98
98
|
currencyCantonNetwork: DEFAULT_FEATURE,
|
99
99
|
currencyKaspa: DEFAULT_FEATURE,
|
100
|
+
currencyEthereumHoodi: DEFAULT_FEATURE,
|
101
|
+
currencyCore: DEFAULT_FEATURE,
|
100
102
|
};
|
101
103
|
|
102
104
|
/**
|
@@ -111,6 +113,7 @@ export const DEFAULT_FEATURES: Features = {
|
|
111
113
|
ptxServiceCtaExchangeDrawer: DEFAULT_FEATURE,
|
112
114
|
ptxServiceCtaScreens: DEFAULT_FEATURE,
|
113
115
|
ptxSwapReceiveTRC20WithoutTrx: DEFAULT_FEATURE,
|
116
|
+
ptxSwapDetailedView: DEFAULT_FEATURE,
|
114
117
|
disableNftLedgerMarket: DEFAULT_FEATURE,
|
115
118
|
disableNftRaribleOpensea: DEFAULT_FEATURE,
|
116
119
|
disableNftSend: DEFAULT_FEATURE,
|
@@ -669,6 +672,7 @@ export const DEFAULT_FEATURES: Features = {
|
|
669
672
|
},
|
670
673
|
supportDeviceApex: DEFAULT_FEATURE,
|
671
674
|
llmSyncOnboardingIncr1: DEFAULT_FEATURE,
|
675
|
+
noah: DEFAULT_FEATURE,
|
672
676
|
};
|
673
677
|
|
674
678
|
// Firebase SDK treat JSON values as strings
|
@@ -17,7 +17,6 @@ import { bridge as near } from "../../families/near/setup";
|
|
17
17
|
import { bridge as polkadot } from "../../families/polkadot/setup";
|
18
18
|
import { bridge as solana } from "../../families/solana/setup";
|
19
19
|
import { bridge as stacks } from "../../families/stacks/setup";
|
20
|
-
import { bridge as tezos } from "../../families/tezos/setup";
|
21
20
|
import { bridge as ton } from "../../families/ton/setup";
|
22
21
|
import { bridge as tron } from "../../families/tron/setup";
|
23
22
|
import { bridge as vechain } from "../../families/vechain/setup";
|
@@ -44,7 +43,6 @@ export default {
|
|
44
43
|
polkadot,
|
45
44
|
solana,
|
46
45
|
stacks,
|
47
|
-
tezos,
|
48
46
|
ton,
|
49
47
|
tron,
|
50
48
|
vechain,
|
@@ -10,15 +10,18 @@ import { buildProviderCurrenciesMap } from "../utils/buildProviderCurrenciesMap"
|
|
10
10
|
import { CurrenciesByProviderId } from "../../deposit/type";
|
11
11
|
import { calculateProviderTotals } from "../utils/calculateProviderTotal";
|
12
12
|
import { getProviderCurrency } from "../utils/getProviderCurrency";
|
13
|
-
import { getBalanceAndFiatValueByAssets } from "../utils/getBalanceAndFiatValueByAssets";
|
14
13
|
import { groupAccountsByAsset } from "../utils/groupAccountsByAsset";
|
15
14
|
|
16
15
|
export type AssetDeps = {
|
17
16
|
useBalanceDeps: UseBalanceDeps;
|
18
17
|
balanceItem: (asset: { fiatValue?: string; balance?: string }) => ReactNode;
|
18
|
+
assetsMap: Map<
|
19
|
+
string,
|
20
|
+
{ mainCurrency: CryptoOrTokenCurrency; currencies: CryptoOrTokenCurrency[] }
|
21
|
+
>;
|
19
22
|
};
|
20
23
|
|
21
|
-
export function createUseRightBalanceAsset({ useBalanceDeps, balanceItem }: AssetDeps) {
|
24
|
+
export function createUseRightBalanceAsset({ useBalanceDeps, balanceItem, assetsMap }: AssetDeps) {
|
22
25
|
const formatProviderResult = (
|
23
26
|
providerCurrency: CryptoOrTokenCurrency,
|
24
27
|
totalBalance: BigNumber,
|
@@ -58,15 +61,26 @@ export function createUseRightBalanceAsset({ useBalanceDeps, balanceItem }: Asse
|
|
58
61
|
|
59
62
|
return useMemo(() => {
|
60
63
|
if (!providerMap) {
|
61
|
-
const
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
64
|
+
const balanceMap = new Map();
|
65
|
+
|
66
|
+
for (const [, { currencies, mainCurrency }] of assetsMap) {
|
67
|
+
const { totalBalance, totalFiatValue } = calculateProviderTotals(currencies, grouped);
|
68
|
+
|
69
|
+
const { balance, fiatValue } = formatProviderResult(
|
70
|
+
mainCurrency,
|
71
|
+
totalBalance,
|
72
|
+
totalFiatValue,
|
73
|
+
counterValueCurrency,
|
74
|
+
locale,
|
75
|
+
discreet,
|
76
|
+
);
|
77
|
+
|
78
|
+
balanceMap.set(mainCurrency.id, {
|
79
|
+
balance: balance,
|
80
|
+
fiatValue: fiatValue,
|
81
|
+
});
|
82
|
+
}
|
83
|
+
|
70
84
|
const assetsWithBalanceData = assets.map(asset => {
|
71
85
|
const balanceData = balanceMap.get(asset.id) || {};
|
72
86
|
return {
|
@@ -126,15 +140,6 @@ export function createUseRightBalanceAsset({ useBalanceDeps, balanceItem }: Asse
|
|
126
140
|
...asset,
|
127
141
|
rightElement: balanceItem(balanceData),
|
128
142
|
}));
|
129
|
-
}, [
|
130
|
-
assets,
|
131
|
-
providerMap,
|
132
|
-
flattenedAccounts,
|
133
|
-
state,
|
134
|
-
counterValueCurrency,
|
135
|
-
discreet,
|
136
|
-
locale,
|
137
|
-
grouped,
|
138
|
-
]);
|
143
|
+
}, [providerMap, assets, grouped, counterValueCurrency, locale, discreet]);
|
139
144
|
};
|
140
145
|
}
|
@@ -12,6 +12,7 @@ export type NetworkDeps = {
|
|
12
12
|
|
13
13
|
type Params = {
|
14
14
|
assets: CryptoOrTokenCurrency[];
|
15
|
+
networks: CryptoOrTokenCurrency[];
|
15
16
|
selectedAssetId: string;
|
16
17
|
currenciesByProvider: CurrenciesByProviderId[];
|
17
18
|
};
|
@@ -21,6 +22,7 @@ export function createUseRightBalanceNetwork({ useBalanceDeps, balanceItem }: Ne
|
|
21
22
|
assets: networks,
|
22
23
|
selectedAssetId,
|
23
24
|
currenciesByProvider,
|
25
|
+
networks: actualNetworks,
|
24
26
|
}: Params) {
|
25
27
|
const { flattenedAccounts, discreet, state, counterValueCurrency, locale } = useBalanceDeps();
|
26
28
|
|
@@ -77,7 +79,7 @@ export function createUseRightBalanceNetwork({ useBalanceDeps, balanceItem }: Ne
|
|
77
79
|
|
78
80
|
const networkBalanceData = getBalanceAndFiatValueByAssets(
|
79
81
|
flattenedAccounts,
|
80
|
-
|
82
|
+
actualNetworks,
|
81
83
|
state,
|
82
84
|
counterValueCurrency,
|
83
85
|
discreet,
|
@@ -86,7 +88,7 @@ export function createUseRightBalanceNetwork({ useBalanceDeps, balanceItem }: Ne
|
|
86
88
|
|
87
89
|
const balanceMap = new Map(networkBalanceData.map(b => [b.id, b]));
|
88
90
|
|
89
|
-
const networksWithBalance =
|
91
|
+
const networksWithBalance = actualNetworks.map(network => {
|
90
92
|
const balanceData = balanceMap.get(network.id) || {};
|
91
93
|
return {
|
92
94
|
network,
|
@@ -0,0 +1,27 @@
|
|
1
|
+
import { CryptoOrTokenCurrency } from "@ledgerhq/types-cryptoassets";
|
2
|
+
import { AssetData } from "./type";
|
3
|
+
|
4
|
+
export const groupCurrenciesByProvider = (assetsSorted: AssetData[]) => {
|
5
|
+
const assetMap = new Map<
|
6
|
+
string,
|
7
|
+
{ mainCurrency: CryptoOrTokenCurrency; currencies: CryptoOrTokenCurrency[] }
|
8
|
+
>();
|
9
|
+
|
10
|
+
if (assetsSorted) {
|
11
|
+
for (const item of assetsSorted) {
|
12
|
+
const {
|
13
|
+
asset: { id: providerId },
|
14
|
+
networks = [],
|
15
|
+
} = item;
|
16
|
+
if (networks.length > 0) {
|
17
|
+
const mainCurrency = networks.find(c => c.id === providerId) ?? networks[0];
|
18
|
+
assetMap.set(providerId, {
|
19
|
+
mainCurrency,
|
20
|
+
currencies: networks,
|
21
|
+
});
|
22
|
+
}
|
23
|
+
}
|
24
|
+
}
|
25
|
+
|
26
|
+
return assetMap;
|
27
|
+
};
|
@@ -2,6 +2,7 @@ import { CryptoOrTokenCurrency } from "@ledgerhq/types-cryptoassets";
|
|
2
2
|
import { CurrenciesByProviderId } from "../../deposit/type";
|
3
3
|
import { haveOneCommonProvider } from "./haveOneCommonProvider";
|
4
4
|
import { getBalanceAndFiatValue } from "./getBalanceAndFiatValue";
|
5
|
+
import { groupCurrenciesByProvider } from "./groupCurrenciesByProvider";
|
5
6
|
|
6
7
|
function isCorrespondingCurrency(
|
7
8
|
elem: CryptoOrTokenCurrency,
|
@@ -33,4 +34,5 @@ export {
|
|
33
34
|
getEffectiveCurrency,
|
34
35
|
haveOneCommonProvider,
|
35
36
|
getBalanceAndFiatValue,
|
37
|
+
groupCurrenciesByProvider,
|
36
38
|
};
|
@@ -6,6 +6,8 @@ import { Observable } from "rxjs";
|
|
6
6
|
import { WalletAPIAccount } from "../../wallet-api/types";
|
7
7
|
import { CurrenciesByProviderId } from "../../deposit/type";
|
8
8
|
import { EnhancedModularDrawerConfiguration } from "../../wallet-api/ModularDrawer/types";
|
9
|
+
import { InterestRate } from "../data/entities";
|
10
|
+
import { MarketItemResponse } from "../../market/utils/types";
|
9
11
|
|
10
12
|
export type ApyType = "NRR" | "APY" | "APR";
|
11
13
|
|
@@ -115,8 +117,25 @@ export type AssetConfigurationDeps = {
|
|
115
117
|
MarketPriceIndicator: (args: { price: string; percent: number }) => ReactNode;
|
116
118
|
useBalanceDeps: UseBalanceDeps;
|
117
119
|
balanceItem: (asset: { fiatValue?: string; balance?: string }) => ReactNode;
|
120
|
+
assetsMap: Map<
|
121
|
+
string,
|
122
|
+
{ mainCurrency: CryptoOrTokenCurrency; currencies: CryptoOrTokenCurrency[] }
|
123
|
+
>;
|
118
124
|
};
|
119
125
|
|
120
126
|
export type CreateAssetConfigurationHook = (
|
121
127
|
AssetConfigurationDeps: AssetConfigurationDeps,
|
122
128
|
) => (props: Props) => (assets: CryptoOrTokenCurrency[]) => (CryptoOrTokenCurrency & AssetType)[];
|
129
|
+
|
130
|
+
export type AssetData = {
|
131
|
+
asset: {
|
132
|
+
id: string;
|
133
|
+
ticker: string;
|
134
|
+
name: string;
|
135
|
+
assetsIds: Record<string, string>;
|
136
|
+
metaCurrencyId?: string;
|
137
|
+
};
|
138
|
+
networks: CryptoOrTokenCurrency[];
|
139
|
+
interestRates?: InterestRate;
|
140
|
+
market?: Partial<MarketItemResponse>;
|
141
|
+
};
|
@@ -0,0 +1,102 @@
|
|
1
|
+
import { filterServiceStatusIncidents } from "./index";
|
2
|
+
import { LEDGER_COMPONENTS } from "./ledger-components";
|
3
|
+
import type { Incident } from "./types";
|
4
|
+
|
5
|
+
const makeIncident = (overrides: Partial<Incident> = {}): Incident => ({
|
6
|
+
created_at: "2025-01-01T00:00:00Z",
|
7
|
+
id: Math.random().toString(16).slice(2),
|
8
|
+
impact: "minor",
|
9
|
+
incident_updates: [],
|
10
|
+
monitoring_at: null,
|
11
|
+
name: "Test incident",
|
12
|
+
page_id: null,
|
13
|
+
resolved_at: null,
|
14
|
+
shortlink: null,
|
15
|
+
status: "investigating",
|
16
|
+
updated_at: null,
|
17
|
+
...overrides,
|
18
|
+
});
|
19
|
+
|
20
|
+
describe("filterServiceStatusIncidents", () => {
|
21
|
+
it("returns empty when no tickers or no incidents", () => {
|
22
|
+
expect(filterServiceStatusIncidents([], ["BTC"]).length).toBe(0);
|
23
|
+
expect(filterServiceStatusIncidents([makeIncident()], []).length).toBe(0);
|
24
|
+
});
|
25
|
+
|
26
|
+
it("matches incidents with known Ledger components (case-insensitive)", () => {
|
27
|
+
const incidents: Incident[] = [
|
28
|
+
makeIncident({ components: [{ id: "1", name: "Ledger Application Store" }] }),
|
29
|
+
makeIncident({ components: [{ id: "2", name: "ledger appliCAtion store" }] }),
|
30
|
+
makeIncident({ components: [{ id: "3", name: "Unknown Component" }] }),
|
31
|
+
];
|
32
|
+
|
33
|
+
const result = filterServiceStatusIncidents(incidents, ["BTC"], "notifications");
|
34
|
+
expect(result.map(i => i.components?.[0].id)).toEqual(["1", "2"]);
|
35
|
+
});
|
36
|
+
|
37
|
+
it("matches incidents if a component contains a tracked ticker as a whole word (case-insensitive)", () => {
|
38
|
+
const incidents: Incident[] = [
|
39
|
+
makeIncident({ components: [{ id: "1", name: "BTC Node" }] }),
|
40
|
+
makeIncident({ components: [{ id: "2", name: "eth Node" }] }),
|
41
|
+
makeIncident({ components: [{ id: "3", name: "TETHER Service" }] }),
|
42
|
+
makeIncident({ components: [{ id: "4", name: "NOTBTCService" }] }),
|
43
|
+
];
|
44
|
+
|
45
|
+
const result = filterServiceStatusIncidents(incidents, ["BTC", "ETH"]);
|
46
|
+
expect(result.map(i => i.components?.[0].id)).toEqual(["1", "2"]);
|
47
|
+
});
|
48
|
+
|
49
|
+
it("includes incidents with no components array or empty array", () => {
|
50
|
+
const incidents: Incident[] = [
|
51
|
+
makeIncident({ components: undefined }),
|
52
|
+
makeIncident({ components: [] }),
|
53
|
+
];
|
54
|
+
|
55
|
+
const result = filterServiceStatusIncidents(incidents, ["BTC"]);
|
56
|
+
expect(result.length).toBe(2);
|
57
|
+
});
|
58
|
+
|
59
|
+
it("escapes tickers so special regex characters do not break matching", () => {
|
60
|
+
const incidents: Incident[] = [
|
61
|
+
makeIncident({ components: [{ id: "1", name: "USDT Node" }] }),
|
62
|
+
makeIncident({ components: [{ id: "2", name: "US.DT Node" }] }),
|
63
|
+
makeIncident({ components: [{ id: "3", name: "(USDT) Node" }] }),
|
64
|
+
makeIncident({ components: [{ id: "4", name: "Ethereum Node" }] }),
|
65
|
+
makeIncident({ components: [{ id: "5", name: "Ethereum (ETH) swap issue" }] }),
|
66
|
+
];
|
67
|
+
|
68
|
+
const result = filterServiceStatusIncidents(incidents, ["USDT", "ETH"]);
|
69
|
+
expect(result.map(i => i.components?.[0].id)).toEqual(["1", "3", "5"]);
|
70
|
+
expect(result.length).toBe(3);
|
71
|
+
});
|
72
|
+
|
73
|
+
it("matches incidents for all known Ledger components", () => {
|
74
|
+
const incidents: Incident[] = LEDGER_COMPONENTS.map((name, index) =>
|
75
|
+
makeIncident({ components: [{ id: `${index + 1}`, name }] }),
|
76
|
+
);
|
77
|
+
|
78
|
+
const result = filterServiceStatusIncidents(incidents, ["BTC"], "notifications");
|
79
|
+
expect(result.length).toBe(LEDGER_COMPONENTS.length);
|
80
|
+
});
|
81
|
+
|
82
|
+
it("filters correctly with common tickers", () => {
|
83
|
+
const tickers = ["XRP", "SOL", "ETH", "BTC", "ADA", "USDC", "USDT"];
|
84
|
+
const incidents: Incident[] = [
|
85
|
+
makeIncident({ components: [{ id: "1", name: "BTC Node" }] }),
|
86
|
+
makeIncident({ components: [{ id: "2", name: "eth Node" }] }),
|
87
|
+
makeIncident({ components: [{ id: "3", name: "ADA-Service" }] }),
|
88
|
+
makeIncident({ components: [{ id: "4", name: "usdc gateway" }] }),
|
89
|
+
makeIncident({ components: [{ id: "5", name: "NOTUSDTService" }] }),
|
90
|
+
makeIncident({ components: [{ id: "6", name: "USDT" }] }),
|
91
|
+
makeIncident({ components: [{ id: "7", name: "xrp relayer" }] }),
|
92
|
+
makeIncident({ components: [{ id: "8", name: "SOL Node" }] }),
|
93
|
+
makeIncident({ components: [{ id: "9", name: "SOLANA Node" }] }),
|
94
|
+
makeIncident({ components: [{ id: "10", name: "Random Service" }] }),
|
95
|
+
makeIncident({ components: [] }),
|
96
|
+
];
|
97
|
+
|
98
|
+
const result = filterServiceStatusIncidents(incidents, tickers);
|
99
|
+
expect(result.map(i => i.components?.[0]?.id)).toEqual(["1", "2", "3", "4", "6", "7", "8"]);
|
100
|
+
expect(result.length).toBe(8);
|
101
|
+
});
|
102
|
+
});
|
@@ -4,6 +4,9 @@ import defaultNetworkApi from "./api";
|
|
4
4
|
import { fromPromise } from "xstate";
|
5
5
|
import { useMachine } from "@xstate/react";
|
6
6
|
import { serviceStatusMachine } from "./machine";
|
7
|
+
import { LEDGER_COMPONENTS } from "./ledger-components";
|
8
|
+
import { EntryPoint } from "./entry-points";
|
9
|
+
|
7
10
|
type Props = {
|
8
11
|
children: React.ReactNode;
|
9
12
|
autoUpdateDelay: number;
|
@@ -33,21 +36,61 @@ function escapeRegExp(string) {
|
|
33
36
|
return string.replace(/[.*+?^${}()[\]\\]/g, "\\$&"); // $& means the whole matched string
|
34
37
|
}
|
35
38
|
|
39
|
+
function sanitizeName(name: string): string {
|
40
|
+
return name.toLowerCase().trim().replace(/\s+/g, " "); // collapse multiple spaces
|
41
|
+
}
|
42
|
+
|
43
|
+
/**
|
44
|
+
* Filters service status incidents based on related tickers or Ledger components.
|
45
|
+
*
|
46
|
+
* ## Behavior:
|
47
|
+
* - If there are no `tickers` or no `incidents`, returns an empty list.
|
48
|
+
* - For each incident:
|
49
|
+
* 1. ✅ If the incident has no components → keep it (always relevant).
|
50
|
+
* 2. ✅ If at least one component name matches a known **Ledger component** → keep it.
|
51
|
+
* 3. ✅ If at least one component name contains a **currency ticker** → keep it.
|
52
|
+
* 4. ❌ Otherwise, the incident is discarded.
|
53
|
+
*
|
54
|
+
* @param {Incident[]} [incidents=[]] - List of incidents to filter.
|
55
|
+
* @param {string[]} [tickers=[]] - List of currency tickers to match against incident components.
|
56
|
+
* @param {EntryPoint} [entryPoint] - Entry point where the incidents are displayed (specifically for Ledger components)
|
57
|
+
* @returns {Incident[]} The list of incidents relevant to the provided tickers or Ledger components.
|
58
|
+
*/
|
59
|
+
|
36
60
|
export function filterServiceStatusIncidents(
|
37
61
|
incidents: Incident[],
|
38
62
|
tickers: string[] = [],
|
63
|
+
entryPoint?: EntryPoint,
|
39
64
|
): Incident[] {
|
40
|
-
if (!
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
65
|
+
if (!incidents.length) return [];
|
66
|
+
if (!tickers.length) return [];
|
67
|
+
|
68
|
+
const tickerRegex = tickers.length
|
69
|
+
? new RegExp(`\\b(${tickers.map(escapeRegExp).join("|")})\\b`, "i")
|
70
|
+
: null;
|
71
|
+
|
72
|
+
const ledgerComponentsSet = new Set(LEDGER_COMPONENTS.map(component => sanitizeName(component)));
|
73
|
+
|
74
|
+
return incidents.filter(({ components }) => {
|
75
|
+
// Keep global incidents with no components
|
76
|
+
if (!components?.length) return true;
|
77
|
+
|
78
|
+
return components.some(({ name }) => {
|
79
|
+
const sanitizedName = sanitizeName(name);
|
80
|
+
|
81
|
+
// Show Ledger components only for Notification Center
|
82
|
+
if (entryPoint === "notifications" && ledgerComponentsSet.has(sanitizedName)) {
|
83
|
+
return true;
|
84
|
+
}
|
85
|
+
|
86
|
+
// Show coin/ticker-specific components for flows
|
87
|
+
if (tickerRegex && tickerRegex.test(sanitizedName)) {
|
88
|
+
return true;
|
89
|
+
}
|
90
|
+
|
91
|
+
return false;
|
92
|
+
});
|
93
|
+
});
|
51
94
|
}
|
52
95
|
|
53
96
|
// filter out service status incidents by given currencies or fallback on context currencies
|
@@ -55,8 +98,12 @@ export function useFilteredServiceStatus(filters?: ServiceStatusUserSettings): S
|
|
55
98
|
const stateData = useContext(ServiceStatusContext);
|
56
99
|
const { incidents, context } = stateData;
|
57
100
|
const filteredIncidents = useMemo(() => {
|
58
|
-
return filterServiceStatusIncidents(
|
59
|
-
|
101
|
+
return filterServiceStatusIncidents(
|
102
|
+
incidents,
|
103
|
+
filters?.tickers || context?.tickers,
|
104
|
+
filters?.entryPoint,
|
105
|
+
);
|
106
|
+
}, [incidents, filters?.tickers, context?.tickers, filters?.entryPoint]);
|
60
107
|
|
61
108
|
return { ...stateData, incidents: filteredIncidents };
|
62
109
|
}
|
@@ -69,6 +116,7 @@ export const ServiceStatusProvider = ({
|
|
69
116
|
}: Props): ReactElement => {
|
70
117
|
const fetchData = useCallback(async () => {
|
71
118
|
const serviceStatusSummary = await networkApi.fetchStatusSummary();
|
119
|
+
|
72
120
|
return {
|
73
121
|
incidents: serviceStatusSummary.incidents,
|
74
122
|
updateTime: Date.now(),
|
@@ -0,0 +1,13 @@
|
|
1
|
+
export const LEDGER_COMPONENTS = [
|
2
|
+
"Ledger Application Store",
|
3
|
+
"Ledger Live Security Services",
|
4
|
+
"Swap API",
|
5
|
+
"Buy",
|
6
|
+
"Earn Dashboard",
|
7
|
+
"Crypto Assets Service",
|
8
|
+
"Cloud Sync",
|
9
|
+
"Trustchain",
|
10
|
+
"Loyalty Program",
|
11
|
+
"Card Program",
|
12
|
+
"Countervalue API",
|
13
|
+
] as const;
|