@ledgerhq/live-common 34.47.0-nightly.7 → 34.47.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/bridge/crypto-assets/index.d.ts.map +1 -1
- package/lib/bridge/crypto-assets/index.js +0 -4
- package/lib/bridge/crypto-assets/index.js.map +1 -1
- package/lib/bridge/crypto-assets/index.test.js +0 -36
- package/lib/bridge/crypto-assets/index.test.js.map +1 -1
- package/lib/bridge/generic-alpaca/alpaca/index.d.ts.map +1 -1
- package/lib/bridge/generic-alpaca/alpaca/index.js +1 -6
- package/lib/bridge/generic-alpaca/alpaca/index.js.map +1 -1
- package/lib/bridge/generic-alpaca/alpaca/network/network-alpaca.js +1 -1
- package/lib/bridge/generic-alpaca/alpaca/network/network-alpaca.js.map +1 -1
- package/lib/bridge/generic-alpaca/buildSubAccounts.d.ts +3 -2
- package/lib/bridge/generic-alpaca/buildSubAccounts.d.ts.map +1 -1
- package/lib/bridge/generic-alpaca/buildSubAccounts.js +12 -3
- package/lib/bridge/generic-alpaca/buildSubAccounts.js.map +1 -1
- package/lib/bridge/generic-alpaca/getAccountShape.d.ts.map +1 -1
- package/lib/bridge/generic-alpaca/getAccountShape.js +4 -4
- package/lib/bridge/generic-alpaca/getAccountShape.js.map +1 -1
- package/lib/bridge/generic-alpaca/tests/utils.test.d.ts.map +1 -0
- package/lib/bridge/generic-alpaca/tests/utils.test.js +20 -0
- package/lib/bridge/generic-alpaca/tests/utils.test.js.map +1 -0
- package/lib/bridge/generic-alpaca/utils.d.ts.map +1 -1
- package/lib/bridge/generic-alpaca/utils.js +2 -5
- package/lib/bridge/generic-alpaca/utils.js.map +1 -1
- package/lib/e2e/enum/DeviceLabels.d.ts +1 -3
- package/lib/e2e/enum/DeviceLabels.d.ts.map +1 -1
- package/lib/e2e/enum/DeviceLabels.js +0 -2
- package/lib/e2e/enum/DeviceLabels.js.map +1 -1
- package/lib/e2e/families/tezos.d.ts.map +1 -1
- package/lib/e2e/families/tezos.js +0 -2
- package/lib/e2e/families/tezos.js.map +1 -1
- package/lib/e2e/index.d.ts +4 -4
- package/lib/e2e/speculos.d.ts +0 -1
- package/lib/e2e/speculos.d.ts.map +1 -1
- package/lib/e2e/speculos.js +2 -12
- package/lib/e2e/speculos.js.map +1 -1
- package/lib/exchange/platform/transfer/completeExchange.d.ts.map +1 -1
- package/lib/exchange/platform/transfer/completeExchange.js +5 -3
- package/lib/exchange/platform/transfer/completeExchange.js.map +1 -1
- package/lib/exchange/swap/completeExchange.d.ts.map +1 -1
- package/lib/exchange/swap/completeExchange.js +2 -5
- package/lib/exchange/swap/completeExchange.js.map +1 -1
- package/lib/exchange/swap/initSwap.d.ts.map +1 -1
- package/lib/exchange/swap/initSwap.js +2 -5
- package/lib/exchange/swap/initSwap.js.map +1 -1
- package/lib/families/canton/config.d.ts.map +1 -1
- package/lib/families/canton/config.js +0 -4
- package/lib/families/canton/config.js.map +1 -1
- package/lib/families/solana/setup.d.ts.map +1 -1
- package/lib/families/solana/setup.js +0 -9
- package/lib/families/solana/setup.js.map +1 -1
- package/lib/featureFlags/defaultFeatures.js +1 -1
- package/lib/featureFlags/defaultFeatures.js.map +1 -1
- package/lib/featureFlags/useFeature.d.ts +1 -1
- package/lib/featureFlags/useFeature.d.ts.map +1 -1
- package/lib/modularDrawer/data/state-manager/api.d.ts +37 -727
- package/lib/modularDrawer/data/state-manager/api.d.ts.map +1 -1
- package/lib/modularDrawer/data/state-manager/api.js +17 -38
- package/lib/modularDrawer/data/state-manager/api.js.map +1 -1
- package/lib/modularDrawer/hooks/__test__/useAssetsData.test.js +78 -134
- package/lib/modularDrawer/hooks/__test__/useAssetsData.test.js.map +1 -1
- package/{lib-es/modularDrawer/hooks → lib/modularDrawer/hooks/modules}/useAssetAccountCounts.d.ts +1 -1
- package/lib/modularDrawer/hooks/modules/useAssetAccountCounts.d.ts.map +1 -0
- package/lib/modularDrawer/hooks/{useAssetAccountCounts.js → modules/useAssetAccountCounts.js} +1 -1
- package/lib/modularDrawer/hooks/modules/useAssetAccountCounts.js.map +1 -0
- package/lib/modularDrawer/hooks/modules/useLeftApyModule.d.ts +3 -3
- package/lib/modularDrawer/hooks/modules/useLeftApyModule.d.ts.map +1 -1
- package/lib/modularDrawer/hooks/modules/useLeftApyModule.js +10 -59
- package/lib/modularDrawer/hooks/modules/useLeftApyModule.js.map +1 -1
- package/lib/modularDrawer/hooks/useAssetsData.d.ts +6 -10
- package/lib/modularDrawer/hooks/useAssetsData.d.ts.map +1 -1
- package/lib/modularDrawer/hooks/useAssetsData.js +17 -40
- package/lib/modularDrawer/hooks/useAssetsData.js.map +1 -1
- package/lib/modularDrawer/types.d.ts +2 -0
- package/lib/modularDrawer/types.d.ts.map +1 -0
- package/lib/modularDrawer/types.js +3 -0
- package/lib/modularDrawer/types.js.map +1 -0
- package/lib/modularDrawer/utils/type.d.ts +1 -89
- package/lib/modularDrawer/utils/type.d.ts.map +1 -1
- package/lib/wallet-api/Exchange/server.js +2 -2
- package/lib/wallet-api/Exchange/server.js.map +1 -1
- package/lib/wallet-api/react.d.ts +0 -2
- package/lib/wallet-api/react.d.ts.map +1 -1
- package/lib/wallet-api/react.js +1 -3
- package/lib/wallet-api/react.js.map +1 -1
- package/lib-es/bridge/crypto-assets/index.d.ts.map +1 -1
- package/lib-es/bridge/crypto-assets/index.js +0 -4
- package/lib-es/bridge/crypto-assets/index.js.map +1 -1
- package/lib-es/bridge/crypto-assets/index.test.js +0 -36
- package/lib-es/bridge/crypto-assets/index.test.js.map +1 -1
- package/lib-es/bridge/generic-alpaca/alpaca/index.d.ts.map +1 -1
- package/lib-es/bridge/generic-alpaca/alpaca/index.js +1 -6
- package/lib-es/bridge/generic-alpaca/alpaca/index.js.map +1 -1
- package/lib-es/bridge/generic-alpaca/alpaca/network/network-alpaca.js +1 -1
- package/lib-es/bridge/generic-alpaca/alpaca/network/network-alpaca.js.map +1 -1
- package/lib-es/bridge/generic-alpaca/buildSubAccounts.d.ts +3 -2
- package/lib-es/bridge/generic-alpaca/buildSubAccounts.d.ts.map +1 -1
- package/lib-es/bridge/generic-alpaca/buildSubAccounts.js +9 -2
- package/lib-es/bridge/generic-alpaca/buildSubAccounts.js.map +1 -1
- package/lib-es/bridge/generic-alpaca/getAccountShape.d.ts.map +1 -1
- package/lib-es/bridge/generic-alpaca/getAccountShape.js +3 -3
- package/lib-es/bridge/generic-alpaca/getAccountShape.js.map +1 -1
- package/lib-es/bridge/generic-alpaca/tests/utils.test.d.ts.map +1 -0
- package/lib-es/bridge/generic-alpaca/tests/utils.test.js +18 -0
- package/lib-es/bridge/generic-alpaca/tests/utils.test.js.map +1 -0
- package/lib-es/bridge/generic-alpaca/utils.d.ts.map +1 -1
- package/lib-es/bridge/generic-alpaca/utils.js +2 -5
- package/lib-es/bridge/generic-alpaca/utils.js.map +1 -1
- package/lib-es/e2e/enum/DeviceLabels.d.ts +1 -3
- package/lib-es/e2e/enum/DeviceLabels.d.ts.map +1 -1
- package/lib-es/e2e/enum/DeviceLabels.js +0 -2
- package/lib-es/e2e/enum/DeviceLabels.js.map +1 -1
- package/lib-es/e2e/families/tezos.d.ts.map +1 -1
- package/lib-es/e2e/families/tezos.js +0 -2
- package/lib-es/e2e/families/tezos.js.map +1 -1
- package/lib-es/e2e/index.d.ts +4 -4
- package/lib-es/e2e/speculos.d.ts +0 -1
- package/lib-es/e2e/speculos.d.ts.map +1 -1
- package/lib-es/e2e/speculos.js +1 -10
- package/lib-es/e2e/speculos.js.map +1 -1
- package/lib-es/exchange/platform/transfer/completeExchange.d.ts.map +1 -1
- package/lib-es/exchange/platform/transfer/completeExchange.js +2 -3
- package/lib-es/exchange/platform/transfer/completeExchange.js.map +1 -1
- package/lib-es/exchange/swap/completeExchange.d.ts.map +1 -1
- package/lib-es/exchange/swap/completeExchange.js +2 -5
- package/lib-es/exchange/swap/completeExchange.js.map +1 -1
- package/lib-es/exchange/swap/initSwap.d.ts.map +1 -1
- package/lib-es/exchange/swap/initSwap.js +2 -5
- package/lib-es/exchange/swap/initSwap.js.map +1 -1
- package/lib-es/families/canton/config.d.ts.map +1 -1
- package/lib-es/families/canton/config.js +0 -4
- package/lib-es/families/canton/config.js.map +1 -1
- package/lib-es/families/solana/setup.d.ts.map +1 -1
- package/lib-es/families/solana/setup.js +0 -9
- package/lib-es/families/solana/setup.js.map +1 -1
- package/lib-es/featureFlags/defaultFeatures.js +1 -1
- package/lib-es/featureFlags/defaultFeatures.js.map +1 -1
- package/lib-es/featureFlags/useFeature.d.ts +1 -1
- package/lib-es/featureFlags/useFeature.d.ts.map +1 -1
- package/lib-es/modularDrawer/data/state-manager/api.d.ts +37 -727
- package/lib-es/modularDrawer/data/state-manager/api.d.ts.map +1 -1
- package/lib-es/modularDrawer/data/state-manager/api.js +14 -35
- package/lib-es/modularDrawer/data/state-manager/api.js.map +1 -1
- package/lib-es/modularDrawer/hooks/__test__/useAssetsData.test.js +79 -135
- package/lib-es/modularDrawer/hooks/__test__/useAssetsData.test.js.map +1 -1
- package/{lib/modularDrawer/hooks → lib-es/modularDrawer/hooks/modules}/useAssetAccountCounts.d.ts +1 -1
- package/lib-es/modularDrawer/hooks/modules/useAssetAccountCounts.d.ts.map +1 -0
- package/lib-es/modularDrawer/hooks/{useAssetAccountCounts.js → modules/useAssetAccountCounts.js} +1 -1
- package/lib-es/modularDrawer/hooks/modules/useAssetAccountCounts.js.map +1 -0
- package/lib-es/modularDrawer/hooks/modules/useLeftApyModule.d.ts +3 -3
- package/lib-es/modularDrawer/hooks/modules/useLeftApyModule.d.ts.map +1 -1
- package/lib-es/modularDrawer/hooks/modules/useLeftApyModule.js +8 -37
- package/lib-es/modularDrawer/hooks/modules/useLeftApyModule.js.map +1 -1
- package/lib-es/modularDrawer/hooks/useAssetsData.d.ts +6 -10
- package/lib-es/modularDrawer/hooks/useAssetsData.d.ts.map +1 -1
- package/lib-es/modularDrawer/hooks/useAssetsData.js +19 -42
- package/lib-es/modularDrawer/hooks/useAssetsData.js.map +1 -1
- package/lib-es/modularDrawer/types.d.ts +2 -0
- package/lib-es/modularDrawer/types.d.ts.map +1 -0
- package/lib-es/modularDrawer/types.js +2 -0
- package/lib-es/modularDrawer/types.js.map +1 -0
- package/lib-es/modularDrawer/utils/type.d.ts +1 -89
- package/lib-es/modularDrawer/utils/type.d.ts.map +1 -1
- package/lib-es/wallet-api/Exchange/server.js +2 -2
- package/lib-es/wallet-api/Exchange/server.js.map +1 -1
- package/lib-es/wallet-api/react.d.ts +0 -2
- package/lib-es/wallet-api/react.d.ts.map +1 -1
- package/lib-es/wallet-api/react.js +1 -3
- package/lib-es/wallet-api/react.js.map +1 -1
- package/package.json +77 -77
- package/src/bridge/crypto-assets/index.test.ts +0 -47
- package/src/bridge/crypto-assets/index.ts +0 -5
- package/src/bridge/generic-alpaca/alpaca/index.ts +1 -14
- package/src/bridge/generic-alpaca/alpaca/network/network-alpaca.ts +1 -1
- package/src/bridge/generic-alpaca/buildSubAccounts.ts +11 -3
- package/src/bridge/generic-alpaca/getAccountShape.ts +4 -3
- package/src/bridge/generic-alpaca/tests/utils.test.ts +19 -0
- package/src/bridge/generic-alpaca/utils.ts +2 -6
- package/src/e2e/enum/DeviceLabels.ts +0 -2
- package/src/e2e/families/tezos.ts +0 -2
- package/src/e2e/speculos.ts +1 -11
- package/src/exchange/platform/transfer/completeExchange.ts +2 -3
- package/src/exchange/swap/completeExchange.ts +2 -5
- package/src/exchange/swap/initSwap.ts +4 -5
- package/src/families/canton/config.ts +0 -5
- package/src/families/solana/setup.ts +0 -9
- package/src/featureFlags/defaultFeatures.ts +1 -1
- package/src/modularDrawer/data/state-manager/api.ts +27 -42
- package/src/modularDrawer/hooks/__test__/useAssetsData.test.ts +80 -141
- package/src/modularDrawer/hooks/{useAssetAccountCounts.tsx → modules/useAssetAccountCounts.tsx} +2 -2
- package/src/modularDrawer/hooks/modules/useLeftApyModule.tsx +9 -42
- package/src/modularDrawer/hooks/useAssetsData.ts +22 -59
- package/src/modularDrawer/types.ts +1 -0
- package/src/modularDrawer/utils/type.ts +0 -97
- package/src/wallet-api/Exchange/server.ts +2 -2
- package/src/wallet-api/react.ts +1 -5
- package/lib/bridge/crypto-assets/cal-integration.d.ts +0 -4
- package/lib/bridge/crypto-assets/cal-integration.d.ts.map +0 -1
- package/lib/bridge/crypto-assets/cal-integration.js +0 -26
- package/lib/bridge/crypto-assets/cal-integration.js.map +0 -1
- package/lib/bridge/crypto-assets/cal-integration.test.d.ts +0 -2
- package/lib/bridge/crypto-assets/cal-integration.test.d.ts.map +0 -1
- package/lib/bridge/crypto-assets/cal-integration.test.js +0 -45
- package/lib/bridge/crypto-assets/cal-integration.test.js.map +0 -1
- package/lib/bridge/crypto-assets/cal-store.d.ts +0 -14
- package/lib/bridge/crypto-assets/cal-store.d.ts.map +0 -1
- package/lib/bridge/crypto-assets/cal-store.js +0 -58
- package/lib/bridge/crypto-assets/cal-store.js.map +0 -1
- package/lib/bridge/crypto-assets/cal-store.test.d.ts +0 -2
- package/lib/bridge/crypto-assets/cal-store.test.d.ts.map +0 -1
- package/lib/bridge/crypto-assets/cal-store.test.js +0 -70
- package/lib/bridge/crypto-assets/cal-store.test.js.map +0 -1
- package/lib/bridge/generic-alpaca/alpaca/index.unit.test.d.ts +0 -2
- package/lib/bridge/generic-alpaca/alpaca/index.unit.test.d.ts.map +0 -1
- package/lib/bridge/generic-alpaca/alpaca/index.unit.test.js +0 -89
- package/lib/bridge/generic-alpaca/alpaca/index.unit.test.js.map +0 -1
- package/lib/bridge/generic-alpaca/utils.test.d.ts.map +0 -1
- package/lib/bridge/generic-alpaca/utils.test.js +0 -123
- package/lib/bridge/generic-alpaca/utils.test.js.map +0 -1
- package/lib/modularDrawer/__mocks__/dada.mock.d.ts +0 -3336
- package/lib/modularDrawer/__mocks__/dada.mock.d.ts.map +0 -1
- package/lib/modularDrawer/__mocks__/dada.mock.js +0 -3879
- package/lib/modularDrawer/__mocks__/dada.mock.js.map +0 -1
- package/lib/modularDrawer/data/entities/interestRateSelectors.d.ts +0 -16
- package/lib/modularDrawer/data/entities/interestRateSelectors.d.ts.map +0 -1
- package/lib/modularDrawer/data/entities/interestRateSelectors.js +0 -21
- package/lib/modularDrawer/data/entities/interestRateSelectors.js.map +0 -1
- package/lib/modularDrawer/data/state-manager/types.d.ts +0 -24
- package/lib/modularDrawer/data/state-manager/types.d.ts.map +0 -1
- package/lib/modularDrawer/data/state-manager/types.js +0 -13
- package/lib/modularDrawer/data/state-manager/types.js.map +0 -1
- package/lib/modularDrawer/hooks/useAssetAccountCounts.d.ts.map +0 -1
- package/lib/modularDrawer/hooks/useAssetAccountCounts.js.map +0 -1
- package/lib/modularDrawer/hooks/useLeftAccounts.d.ts +0 -13
- package/lib/modularDrawer/hooks/useLeftAccounts.d.ts.map +0 -1
- package/lib/modularDrawer/hooks/useLeftAccounts.js +0 -15
- package/lib/modularDrawer/hooks/useLeftAccounts.js.map +0 -1
- package/lib/modularDrawer/hooks/useLeftAccountsApy.d.ts +0 -6
- package/lib/modularDrawer/hooks/useLeftAccountsApy.d.ts.map +0 -1
- package/lib/modularDrawer/hooks/useLeftAccountsApy.js +0 -19
- package/lib/modularDrawer/hooks/useLeftAccountsApy.js.map +0 -1
- package/lib/modularDrawer/hooks/useLeftApy.d.ts +0 -54
- package/lib/modularDrawer/hooks/useLeftApy.d.ts.map +0 -1
- package/lib/modularDrawer/hooks/useLeftApy.js +0 -15
- package/lib/modularDrawer/hooks/useLeftApy.js.map +0 -1
- package/lib/modularDrawer/hooks/useRightBalanceAsset.d.ts +0 -57
- package/lib/modularDrawer/hooks/useRightBalanceAsset.d.ts.map +0 -1
- package/lib/modularDrawer/hooks/useRightBalanceAsset.js +0 -87
- package/lib/modularDrawer/hooks/useRightBalanceAsset.js.map +0 -1
- package/lib/modularDrawer/hooks/useRightBalanceNetwork.d.ts +0 -63
- package/lib/modularDrawer/hooks/useRightBalanceNetwork.d.ts.map +0 -1
- package/lib/modularDrawer/hooks/useRightBalanceNetwork.js +0 -66
- package/lib/modularDrawer/hooks/useRightBalanceNetwork.js.map +0 -1
- package/lib/modularDrawer/modules/createAssetConfiguration.d.ts +0 -4
- package/lib/modularDrawer/modules/createAssetConfiguration.d.ts.map +0 -1
- package/lib/modularDrawer/modules/createAssetConfiguration.js +0 -41
- package/lib/modularDrawer/modules/createAssetConfiguration.js.map +0 -1
- package/lib/modularDrawer/modules/createNetworkConfiguration.d.ts +0 -6
- package/lib/modularDrawer/modules/createNetworkConfiguration.d.ts.map +0 -1
- package/lib/modularDrawer/modules/createNetworkConfiguration.js +0 -56
- package/lib/modularDrawer/modules/createNetworkConfiguration.js.map +0 -1
- package/lib/modularDrawer/utils/buildProviderCurrenciesMap.d.ts +0 -9
- package/lib/modularDrawer/utils/buildProviderCurrenciesMap.d.ts.map +0 -1
- package/lib/modularDrawer/utils/buildProviderCurrenciesMap.js +0 -17
- package/lib/modularDrawer/utils/buildProviderCurrenciesMap.js.map +0 -1
- package/lib/modularDrawer/utils/getLoadingStatus.d.ts +0 -9
- package/lib/modularDrawer/utils/getLoadingStatus.d.ts.map +0 -1
- package/lib/modularDrawer/utils/getLoadingStatus.js +0 -18
- package/lib/modularDrawer/utils/getLoadingStatus.js.map +0 -1
- package/lib/modularDrawer/utils/sortByBalance.d.ts +0 -6
- package/lib/modularDrawer/utils/sortByBalance.d.ts.map +0 -1
- package/lib/modularDrawer/utils/sortByBalance.js +0 -32
- package/lib/modularDrawer/utils/sortByBalance.js.map +0 -1
- package/lib-es/bridge/crypto-assets/cal-integration.d.ts +0 -4
- package/lib-es/bridge/crypto-assets/cal-integration.d.ts.map +0 -1
- package/lib-es/bridge/crypto-assets/cal-integration.js +0 -21
- package/lib-es/bridge/crypto-assets/cal-integration.js.map +0 -1
- package/lib-es/bridge/crypto-assets/cal-integration.test.d.ts +0 -2
- package/lib-es/bridge/crypto-assets/cal-integration.test.d.ts.map +0 -1
- package/lib-es/bridge/crypto-assets/cal-integration.test.js +0 -43
- package/lib-es/bridge/crypto-assets/cal-integration.test.js.map +0 -1
- package/lib-es/bridge/crypto-assets/cal-store.d.ts +0 -14
- package/lib-es/bridge/crypto-assets/cal-store.d.ts.map +0 -1
- package/lib-es/bridge/crypto-assets/cal-store.js +0 -54
- package/lib-es/bridge/crypto-assets/cal-store.js.map +0 -1
- package/lib-es/bridge/crypto-assets/cal-store.test.d.ts +0 -2
- package/lib-es/bridge/crypto-assets/cal-store.test.d.ts.map +0 -1
- package/lib-es/bridge/crypto-assets/cal-store.test.js +0 -68
- package/lib-es/bridge/crypto-assets/cal-store.test.js.map +0 -1
- package/lib-es/bridge/generic-alpaca/alpaca/index.unit.test.d.ts +0 -2
- package/lib-es/bridge/generic-alpaca/alpaca/index.unit.test.d.ts.map +0 -1
- package/lib-es/bridge/generic-alpaca/alpaca/index.unit.test.js +0 -64
- package/lib-es/bridge/generic-alpaca/alpaca/index.unit.test.js.map +0 -1
- package/lib-es/bridge/generic-alpaca/utils.test.d.ts.map +0 -1
- package/lib-es/bridge/generic-alpaca/utils.test.js +0 -118
- package/lib-es/bridge/generic-alpaca/utils.test.js.map +0 -1
- package/lib-es/modularDrawer/__mocks__/dada.mock.d.ts +0 -3336
- package/lib-es/modularDrawer/__mocks__/dada.mock.d.ts.map +0 -1
- package/lib-es/modularDrawer/__mocks__/dada.mock.js +0 -3876
- package/lib-es/modularDrawer/__mocks__/dada.mock.js.map +0 -1
- package/lib-es/modularDrawer/data/entities/interestRateSelectors.d.ts +0 -16
- package/lib-es/modularDrawer/data/entities/interestRateSelectors.d.ts.map +0 -1
- package/lib-es/modularDrawer/data/entities/interestRateSelectors.js +0 -18
- package/lib-es/modularDrawer/data/entities/interestRateSelectors.js.map +0 -1
- package/lib-es/modularDrawer/data/state-manager/types.d.ts +0 -24
- package/lib-es/modularDrawer/data/state-manager/types.d.ts.map +0 -1
- package/lib-es/modularDrawer/data/state-manager/types.js +0 -10
- package/lib-es/modularDrawer/data/state-manager/types.js.map +0 -1
- package/lib-es/modularDrawer/hooks/useAssetAccountCounts.d.ts.map +0 -1
- package/lib-es/modularDrawer/hooks/useAssetAccountCounts.js.map +0 -1
- package/lib-es/modularDrawer/hooks/useLeftAccounts.d.ts +0 -13
- package/lib-es/modularDrawer/hooks/useLeftAccounts.d.ts.map +0 -1
- package/lib-es/modularDrawer/hooks/useLeftAccounts.js +0 -11
- package/lib-es/modularDrawer/hooks/useLeftAccounts.js.map +0 -1
- package/lib-es/modularDrawer/hooks/useLeftAccountsApy.d.ts +0 -6
- package/lib-es/modularDrawer/hooks/useLeftAccountsApy.d.ts.map +0 -1
- package/lib-es/modularDrawer/hooks/useLeftAccountsApy.js +0 -15
- package/lib-es/modularDrawer/hooks/useLeftAccountsApy.js.map +0 -1
- package/lib-es/modularDrawer/hooks/useLeftApy.d.ts +0 -54
- package/lib-es/modularDrawer/hooks/useLeftApy.d.ts.map +0 -1
- package/lib-es/modularDrawer/hooks/useLeftApy.js +0 -11
- package/lib-es/modularDrawer/hooks/useLeftApy.js.map +0 -1
- package/lib-es/modularDrawer/hooks/useRightBalanceAsset.d.ts +0 -57
- package/lib-es/modularDrawer/hooks/useRightBalanceAsset.d.ts.map +0 -1
- package/lib-es/modularDrawer/hooks/useRightBalanceAsset.js +0 -83
- package/lib-es/modularDrawer/hooks/useRightBalanceAsset.js.map +0 -1
- package/lib-es/modularDrawer/hooks/useRightBalanceNetwork.d.ts +0 -63
- package/lib-es/modularDrawer/hooks/useRightBalanceNetwork.d.ts.map +0 -1
- package/lib-es/modularDrawer/hooks/useRightBalanceNetwork.js +0 -62
- package/lib-es/modularDrawer/hooks/useRightBalanceNetwork.js.map +0 -1
- package/lib-es/modularDrawer/modules/createAssetConfiguration.d.ts +0 -4
- package/lib-es/modularDrawer/modules/createAssetConfiguration.d.ts.map +0 -1
- package/lib-es/modularDrawer/modules/createAssetConfiguration.js +0 -39
- package/lib-es/modularDrawer/modules/createAssetConfiguration.js.map +0 -1
- package/lib-es/modularDrawer/modules/createNetworkConfiguration.d.ts +0 -6
- package/lib-es/modularDrawer/modules/createNetworkConfiguration.d.ts.map +0 -1
- package/lib-es/modularDrawer/modules/createNetworkConfiguration.js +0 -50
- package/lib-es/modularDrawer/modules/createNetworkConfiguration.js.map +0 -1
- package/lib-es/modularDrawer/utils/buildProviderCurrenciesMap.d.ts +0 -9
- package/lib-es/modularDrawer/utils/buildProviderCurrenciesMap.d.ts.map +0 -1
- package/lib-es/modularDrawer/utils/buildProviderCurrenciesMap.js +0 -13
- package/lib-es/modularDrawer/utils/buildProviderCurrenciesMap.js.map +0 -1
- package/lib-es/modularDrawer/utils/getLoadingStatus.d.ts +0 -9
- package/lib-es/modularDrawer/utils/getLoadingStatus.d.ts.map +0 -1
- package/lib-es/modularDrawer/utils/getLoadingStatus.js +0 -14
- package/lib-es/modularDrawer/utils/getLoadingStatus.js.map +0 -1
- package/lib-es/modularDrawer/utils/sortByBalance.d.ts +0 -6
- package/lib-es/modularDrawer/utils/sortByBalance.d.ts.map +0 -1
- package/lib-es/modularDrawer/utils/sortByBalance.js +0 -25
- package/lib-es/modularDrawer/utils/sortByBalance.js.map +0 -1
- package/src/bridge/crypto-assets/cal-integration.test.ts +0 -53
- package/src/bridge/crypto-assets/cal-integration.ts +0 -23
- package/src/bridge/crypto-assets/cal-store.test.ts +0 -93
- package/src/bridge/crypto-assets/cal-store.ts +0 -63
- package/src/bridge/generic-alpaca/alpaca/index.unit.test.ts +0 -78
- package/src/bridge/generic-alpaca/utils.test.ts +0 -133
- package/src/modularDrawer/__mocks__/dada.mock.ts +0 -3890
- package/src/modularDrawer/data/entities/interestRateSelectors.ts +0 -39
- package/src/modularDrawer/data/state-manager/types.ts +0 -28
- package/src/modularDrawer/hooks/useLeftAccounts.tsx +0 -23
- package/src/modularDrawer/hooks/useLeftAccountsApy.tsx +0 -28
- package/src/modularDrawer/hooks/useLeftApy.tsx +0 -19
- package/src/modularDrawer/hooks/useRightBalanceAsset.tsx +0 -140
- package/src/modularDrawer/hooks/useRightBalanceNetwork.tsx +0 -116
- package/src/modularDrawer/modules/createAssetConfiguration.ts +0 -61
- package/src/modularDrawer/modules/createNetworkConfiguration.ts +0 -79
- package/src/modularDrawer/utils/buildProviderCurrenciesMap.tsx +0 -25
- package/src/modularDrawer/utils/getLoadingStatus.ts +0 -24
- package/src/modularDrawer/utils/sortByBalance.tsx +0 -32
- /package/lib/bridge/generic-alpaca/{utils.test.d.ts → tests/utils.test.d.ts} +0 -0
- /package/lib-es/bridge/generic-alpaca/{utils.test.d.ts → tests/utils.test.d.ts} +0 -0
@@ -4,27 +4,21 @@
|
|
4
4
|
|
5
5
|
import { renderHook } from "@testing-library/react";
|
6
6
|
import { useAssetsData } from "../useAssetsData";
|
7
|
-
import {
|
7
|
+
import { useGetAssetsDataQuery } from "../../data/state-manager/api";
|
8
8
|
|
9
9
|
jest.mock("../../data/state-manager/api", () => ({
|
10
|
-
|
10
|
+
useGetAssetsDataQuery: jest.fn(),
|
11
11
|
}));
|
12
12
|
|
13
|
-
const
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
isError: false,
|
23
|
-
fetchPreviousPage: jest.fn(),
|
24
|
-
isFetchingPreviousPage: false,
|
25
|
-
refetch: jest.fn(),
|
26
|
-
status: "success",
|
27
|
-
};
|
13
|
+
const mockSetCursor = jest.fn();
|
14
|
+
jest.mock("react", () => ({
|
15
|
+
...jest.requireActual("react"),
|
16
|
+
useState: jest.fn(() => [undefined, mockSetCursor]),
|
17
|
+
useCallback: jest.fn(fn => fn),
|
18
|
+
useMemo: jest.fn(fn => fn()),
|
19
|
+
}));
|
20
|
+
|
21
|
+
const mockUseGetAssetsDataQuery = jest.mocked(useGetAssetsDataQuery);
|
28
22
|
|
29
23
|
describe("useAssetsData", () => {
|
30
24
|
beforeEach(() => {
|
@@ -32,169 +26,114 @@ describe("useAssetsData", () => {
|
|
32
26
|
});
|
33
27
|
|
34
28
|
it("should return loading state when API is loading", () => {
|
35
|
-
|
36
|
-
|
29
|
+
mockUseGetAssetsDataQuery.mockReturnValue({
|
30
|
+
data: undefined,
|
37
31
|
isLoading: true,
|
38
|
-
|
32
|
+
error: undefined,
|
33
|
+
refetch: jest.fn(),
|
34
|
+
isFetching: false,
|
35
|
+
isSuccess: false,
|
36
|
+
isError: false,
|
37
|
+
currentData: undefined,
|
39
38
|
});
|
40
39
|
|
41
|
-
const { result } = renderHook(() => useAssetsData({
|
40
|
+
const { result } = renderHook(() => useAssetsData({}));
|
42
41
|
|
43
42
|
expect(result.current.isLoading).toBe(true);
|
44
43
|
expect(result.current.data).toBe(undefined);
|
44
|
+
expect(result.current.hasMore).toBe(false);
|
45
45
|
});
|
46
46
|
|
47
|
-
it("should return
|
48
|
-
const
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
pagination: { nextCursor: "cursor-2" },
|
62
|
-
},
|
63
|
-
{
|
64
|
-
cryptoAssets: { ethereum: { id: "ethereum", name: "Ethereum" } },
|
65
|
-
networks: { ethereum: { id: "ethereum", name: "Ethereum" } },
|
66
|
-
cryptoOrTokenCurrencies: { ethereum: { id: "ethereum" } },
|
67
|
-
interestRates: {},
|
68
|
-
markets: {},
|
69
|
-
currenciesOrder: {
|
70
|
-
currenciesIds: ["ethereum"],
|
71
|
-
metaCurrencyIds: ["ethereum"],
|
72
|
-
key: "marketCap",
|
73
|
-
order: "desc",
|
74
|
-
},
|
75
|
-
pagination: { nextCursor: undefined },
|
76
|
-
},
|
77
|
-
];
|
78
|
-
|
79
|
-
mockuseGetAssetsDataInfiniteQuery.mockReturnValue({
|
80
|
-
...defaultMockValues,
|
81
|
-
data: { pages: mockPages, pageParams: [{ cursor: "" }, { cursor: "cursor-2" }] },
|
47
|
+
it("should return data and hasMore when API returns data", () => {
|
48
|
+
const mockData = {
|
49
|
+
assetsData: [],
|
50
|
+
pagination: { nextCursor: "test-cursor" },
|
51
|
+
};
|
52
|
+
mockUseGetAssetsDataQuery.mockReturnValue({
|
53
|
+
data: mockData,
|
54
|
+
isLoading: false,
|
55
|
+
error: undefined,
|
56
|
+
refetch: jest.fn(),
|
57
|
+
isFetching: false,
|
58
|
+
isSuccess: true,
|
59
|
+
isError: false,
|
60
|
+
currentData: mockData,
|
82
61
|
});
|
83
62
|
|
84
|
-
const { result } = renderHook(() => useAssetsData({
|
63
|
+
const { result } = renderHook(() => useAssetsData({}));
|
85
64
|
|
86
|
-
expect(result.current.data).
|
87
|
-
cryptoAssets: {
|
88
|
-
bitcoin: { id: "bitcoin", name: "Bitcoin" },
|
89
|
-
ethereum: { id: "ethereum", name: "Ethereum" },
|
90
|
-
},
|
91
|
-
networks: {
|
92
|
-
bitcoin: { id: "bitcoin", name: "Bitcoin" },
|
93
|
-
ethereum: { id: "ethereum", name: "Ethereum" },
|
94
|
-
},
|
95
|
-
cryptoOrTokenCurrencies: {
|
96
|
-
bitcoin: { id: "bitcoin" },
|
97
|
-
ethereum: { id: "ethereum" },
|
98
|
-
},
|
99
|
-
interestRates: {},
|
100
|
-
markets: {},
|
101
|
-
currenciesOrder: {
|
102
|
-
currenciesIds: ["bitcoin", "ethereum"],
|
103
|
-
metaCurrencyIds: ["bitcoin", "ethereum"],
|
104
|
-
key: "marketCap",
|
105
|
-
order: "desc",
|
106
|
-
},
|
107
|
-
pagination: { nextCursor: undefined },
|
108
|
-
});
|
65
|
+
expect(result.current.data).toBe(mockData);
|
109
66
|
expect(result.current.isLoading).toBe(false);
|
67
|
+
expect(result.current.hasMore).toBe(true);
|
110
68
|
});
|
111
69
|
|
112
70
|
it("should return error when API has error", () => {
|
113
71
|
const mockError = new Error("API Error");
|
114
|
-
|
115
|
-
...defaultMockValues,
|
72
|
+
mockUseGetAssetsDataQuery.mockReturnValue({
|
116
73
|
data: undefined,
|
74
|
+
isLoading: false,
|
117
75
|
error: mockError,
|
76
|
+
refetch: jest.fn(),
|
77
|
+
isFetching: false,
|
118
78
|
isSuccess: false,
|
119
79
|
isError: true,
|
120
|
-
|
80
|
+
currentData: undefined,
|
121
81
|
});
|
122
82
|
|
123
|
-
const { result } = renderHook(() => useAssetsData({
|
83
|
+
const { result } = renderHook(() => useAssetsData({}));
|
124
84
|
|
125
85
|
expect(result.current.error).toBe(mockError);
|
126
86
|
expect(result.current.isLoading).toBe(false);
|
127
87
|
});
|
128
88
|
|
129
|
-
it("should
|
130
|
-
const
|
131
|
-
|
132
|
-
{
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
pagination: { nextCursor
|
89
|
+
it("should call setCursor when loadNext is called and there's a nextCursor", () => {
|
90
|
+
const nextCursor = "next-cursor-456";
|
91
|
+
mockUseGetAssetsDataQuery.mockReturnValue({
|
92
|
+
data: {
|
93
|
+
assetsData: [],
|
94
|
+
pagination: { nextCursor },
|
95
|
+
},
|
96
|
+
isLoading: false,
|
97
|
+
error: undefined,
|
98
|
+
refetch: jest.fn(),
|
99
|
+
isFetching: false,
|
100
|
+
isSuccess: true,
|
101
|
+
isError: false,
|
102
|
+
currentData: {
|
103
|
+
assetsData: [],
|
104
|
+
pagination: { nextCursor },
|
145
105
|
},
|
146
|
-
];
|
147
|
-
|
148
|
-
mockuseGetAssetsDataInfiniteQuery.mockReturnValue({
|
149
|
-
...defaultMockValues,
|
150
|
-
data: { pages: mockPages, pageParams: [{ cursor: "" }] },
|
151
|
-
fetchNextPage: mockFetchNextPage,
|
152
106
|
});
|
153
107
|
|
154
|
-
const { result } = renderHook(() => useAssetsData({
|
108
|
+
const { result } = renderHook(() => useAssetsData({}));
|
155
109
|
|
156
|
-
|
157
|
-
result.current.loadNext?.();
|
110
|
+
result.current.loadNext();
|
158
111
|
|
159
|
-
expect(
|
112
|
+
expect(mockSetCursor).toHaveBeenCalledWith(nextCursor);
|
160
113
|
});
|
161
114
|
|
162
|
-
it("should not
|
163
|
-
|
164
|
-
{
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
115
|
+
it("should not call setCursor when there's no nextCursor", () => {
|
116
|
+
mockUseGetAssetsDataQuery.mockReturnValue({
|
117
|
+
data: {
|
118
|
+
assetsData: [],
|
119
|
+
pagination: { nextCursor: undefined },
|
120
|
+
},
|
121
|
+
isLoading: false,
|
122
|
+
error: undefined,
|
123
|
+
refetch: jest.fn(),
|
124
|
+
isFetching: false,
|
125
|
+
isSuccess: true,
|
126
|
+
isError: false,
|
127
|
+
currentData: {
|
128
|
+
assetsData: [],
|
176
129
|
pagination: { nextCursor: undefined },
|
177
130
|
},
|
178
|
-
];
|
179
|
-
|
180
|
-
mockuseGetAssetsDataInfiniteQuery.mockReturnValue({
|
181
|
-
...defaultMockValues,
|
182
|
-
data: { pages: mockPages, pageParams: [{ cursor: "" }] },
|
183
131
|
});
|
184
132
|
|
185
|
-
const { result } = renderHook(() => useAssetsData({
|
186
|
-
|
187
|
-
expect(result.current.loadNext).toBeUndefined();
|
188
|
-
});
|
189
|
-
|
190
|
-
it("should return undefined data when no pages exist", () => {
|
191
|
-
mockuseGetAssetsDataInfiniteQuery.mockReturnValue({
|
192
|
-
...defaultMockValues,
|
193
|
-
});
|
133
|
+
const { result } = renderHook(() => useAssetsData({}));
|
194
134
|
|
195
|
-
|
135
|
+
result.current.loadNext();
|
196
136
|
|
197
|
-
expect(
|
198
|
-
expect(result.current.loadNext).toBeUndefined();
|
137
|
+
expect(mockSetCursor).not.toHaveBeenCalled();
|
199
138
|
});
|
200
139
|
});
|
package/src/modularDrawer/hooks/{useAssetAccountCounts.tsx → modules/useAssetAccountCounts.tsx}
RENAMED
@@ -1,8 +1,8 @@
|
|
1
1
|
import { Observable } from "rxjs";
|
2
2
|
import { CryptoOrTokenCurrency } from "@ledgerhq/types-cryptoassets";
|
3
|
-
import { getAccountTuplesForCurrency } from "
|
3
|
+
import { getAccountTuplesForCurrency } from "../../../utils/getAccountTuplesForCurrency";
|
4
4
|
import type { Account } from "@ledgerhq/types-live";
|
5
|
-
import { WalletAPIAccount } from "
|
5
|
+
import { WalletAPIAccount } from "../../../wallet-api/types";
|
6
6
|
|
7
7
|
type AccountModuleParams = {
|
8
8
|
assets: CryptoOrTokenCurrency[];
|
@@ -1,11 +1,6 @@
|
|
1
|
-
import React
|
2
|
-
import { useSelector } from "react-redux";
|
1
|
+
import React from "react";
|
3
2
|
import { CryptoOrTokenCurrency } from "@ledgerhq/types-cryptoassets";
|
4
|
-
import {
|
5
|
-
import { ApyType } from "../../utils/type";
|
6
|
-
|
7
|
-
const isValidApyType = (type: string): type is ApyType =>
|
8
|
-
type === "NRR" || type === "APY" || type === "APR";
|
3
|
+
import { ApyType } from "../../types";
|
9
4
|
|
10
5
|
const createApyItem = ({
|
11
6
|
value,
|
@@ -18,42 +13,14 @@ const createApyItem = ({
|
|
18
13
|
}) => <ApyIndicator value={value} type={type} />;
|
19
14
|
|
20
15
|
export const useLeftApyModule = (
|
21
|
-
|
16
|
+
assets: CryptoOrTokenCurrency[],
|
22
17
|
ApyIndicator: React.ComponentType<{ value: number; type: ApyType }>,
|
23
18
|
) => {
|
24
|
-
const
|
25
|
-
|
26
|
-
currencies.forEach(currency => {
|
27
|
-
const apiRate = selectInterestRateByCurrency(state, currency.id);
|
28
|
-
if (apiRate && isValidApyType(apiRate.type)) {
|
29
|
-
rates[currency.id] = {
|
30
|
-
value: apiRate.rate,
|
31
|
-
type: apiRate.type,
|
32
|
-
};
|
33
|
-
}
|
34
|
-
});
|
35
|
-
return rates;
|
36
|
-
});
|
37
|
-
|
38
|
-
return useMemo(() => {
|
39
|
-
return currencies.map(currency => {
|
40
|
-
const interestRate = interestRates[currency.id];
|
41
|
-
const interestRatePercentageRounded = interestRate
|
42
|
-
? Math.round(interestRate.value * 100 * 100) / 100
|
43
|
-
: 0;
|
44
|
-
|
45
|
-
if (!interestRate || interestRatePercentageRounded <= 0) {
|
46
|
-
return currency;
|
47
|
-
}
|
19
|
+
const value = 5.11; // TODO to be retrieved from DADA
|
20
|
+
const type = "APY"; // TODO to be retrieved from DADA
|
48
21
|
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
type: interestRate.type,
|
54
|
-
ApyIndicator,
|
55
|
-
}),
|
56
|
-
};
|
57
|
-
});
|
58
|
-
}, [currencies, interestRates, ApyIndicator]);
|
22
|
+
return assets.map(asset => ({
|
23
|
+
...asset,
|
24
|
+
leftElement: createApyItem({ value, type, ApyIndicator }),
|
25
|
+
}));
|
59
26
|
};
|
@@ -1,73 +1,36 @@
|
|
1
|
-
import {
|
2
|
-
import {
|
3
|
-
import { AssetsDataWithPagination } from "../data/state-manager/types";
|
4
|
-
|
5
|
-
const emptyData = () => ({
|
6
|
-
cryptoAssets: {},
|
7
|
-
networks: {},
|
8
|
-
cryptoOrTokenCurrencies: {},
|
9
|
-
interestRates: {},
|
10
|
-
markets: {},
|
11
|
-
currenciesOrder: {
|
12
|
-
currenciesIds: [],
|
13
|
-
metaCurrencyIds: [],
|
14
|
-
key: "",
|
15
|
-
order: "",
|
16
|
-
},
|
17
|
-
pagination: { nextCursor: "" },
|
18
|
-
});
|
1
|
+
import { useState, useCallback } from "react";
|
2
|
+
import { useGetAssetsDataQuery } from "../data/state-manager/api";
|
19
3
|
|
20
4
|
export function useAssetsData({
|
21
5
|
search,
|
22
6
|
currencyIds,
|
23
|
-
useCase,
|
24
|
-
areCurrenciesFiltered,
|
25
|
-
product,
|
26
|
-
version,
|
27
7
|
}: {
|
28
8
|
search?: string;
|
29
9
|
currencyIds?: string[];
|
30
|
-
useCase?: string;
|
31
|
-
areCurrenciesFiltered?: boolean;
|
32
|
-
product: "llm" | "lld";
|
33
|
-
version: string;
|
34
10
|
}) {
|
35
|
-
const
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
Object.assign(acc.markets, page.markets);
|
51
|
-
|
52
|
-
acc.currenciesOrder.currenciesIds.push(...page.currenciesOrder.currenciesIds);
|
53
|
-
acc.currenciesOrder.metaCurrencyIds.push(...page.currenciesOrder.metaCurrencyIds);
|
54
|
-
|
55
|
-
acc.currenciesOrder.key = page.currenciesOrder.key;
|
56
|
-
acc.currenciesOrder.order = page.currenciesOrder.order;
|
57
|
-
acc.pagination.nextCursor = page.pagination.nextCursor;
|
58
|
-
|
59
|
-
return acc;
|
60
|
-
}, emptyData());
|
61
|
-
}, [data]);
|
62
|
-
|
63
|
-
const hasMore = Boolean(joinedPages?.pagination.nextCursor);
|
11
|
+
const [cursor, setCursor] = useState<string | undefined>(undefined);
|
12
|
+
const { data, error, isLoading, isSuccess } = useGetAssetsDataQuery({
|
13
|
+
cursor,
|
14
|
+
search,
|
15
|
+
currencyIds,
|
16
|
+
});
|
17
|
+
|
18
|
+
const loadNext = useCallback(() => {
|
19
|
+
const nextCursor = data?.pagination?.nextCursor;
|
20
|
+
if (nextCursor) {
|
21
|
+
setCursor(nextCursor);
|
22
|
+
}
|
23
|
+
}, [data?.pagination?.nextCursor]);
|
24
|
+
|
25
|
+
const hasMore = Boolean(data?.pagination?.nextCursor);
|
64
26
|
|
65
27
|
return {
|
66
|
-
data
|
67
|
-
isLoading,
|
28
|
+
data,
|
68
29
|
error,
|
69
|
-
|
30
|
+
isLoading,
|
70
31
|
isSuccess,
|
71
|
-
|
32
|
+
hasMore,
|
33
|
+
cursor,
|
34
|
+
loadNext,
|
72
35
|
};
|
73
36
|
}
|
@@ -0,0 +1 @@
|
|
1
|
+
export type ApyType = "NRR" | "APY" | "APR";
|
@@ -1,14 +1,3 @@
|
|
1
|
-
import { CounterValuesState } from "@ledgerhq/live-countervalues/lib/types";
|
2
|
-
import { CryptoOrTokenCurrency, Currency } from "@ledgerhq/types-cryptoassets";
|
3
|
-
import { AccountLike } from "@ledgerhq/types-live";
|
4
|
-
import { ReactNode } from "react";
|
5
|
-
import { Observable } from "rxjs";
|
6
|
-
import { WalletAPIAccount } from "../../wallet-api/types";
|
7
|
-
import { CurrenciesByProviderId } from "../../deposit/type";
|
8
|
-
import { EnhancedModularDrawerConfiguration } from "../../wallet-api/ModularDrawer/types";
|
9
|
-
|
10
|
-
export type ApyType = "NRR" | "APY" | "APR";
|
11
|
-
|
12
1
|
export type AssetType = {
|
13
2
|
name: string;
|
14
3
|
ticker: string;
|
@@ -31,89 +20,3 @@ export type ProviderBalanceResultsMap = Map<string, ProviderBalanceAsset>;
|
|
31
20
|
export type AssetWithBalance = AssetType & {
|
32
21
|
sortValue?: number;
|
33
22
|
};
|
34
|
-
|
35
|
-
export type UseBalanceDeps = () => {
|
36
|
-
flattenedAccounts: AccountLike[];
|
37
|
-
discreet: boolean;
|
38
|
-
state: CounterValuesState;
|
39
|
-
counterValueCurrency: Currency;
|
40
|
-
locale: string;
|
41
|
-
};
|
42
|
-
|
43
|
-
export type BalanceUI = { balance?: string; fiatValue?: string };
|
44
|
-
export type CreateBalanceItem = (x: BalanceUI) => React.ReactNode;
|
45
|
-
|
46
|
-
export type CreateAccountsCountAndApy = (args: {
|
47
|
-
label: string;
|
48
|
-
value: number;
|
49
|
-
type: ApyType;
|
50
|
-
}) => ReactNode;
|
51
|
-
|
52
|
-
export type NetworkWithCount = CryptoOrTokenCurrency & {
|
53
|
-
leftElement?: ReactNode;
|
54
|
-
count: number;
|
55
|
-
};
|
56
|
-
|
57
|
-
export type AccountDataItem = {
|
58
|
-
asset: CryptoOrTokenCurrency;
|
59
|
-
label: string;
|
60
|
-
count: number;
|
61
|
-
};
|
62
|
-
|
63
|
-
export type AccountModuleParams = {
|
64
|
-
assets: CryptoOrTokenCurrency[];
|
65
|
-
accounts$?: Observable<WalletAPIAccount[]>;
|
66
|
-
};
|
67
|
-
|
68
|
-
export type CreateAccountsCount = (args: { label: string }) => ReactNode;
|
69
|
-
|
70
|
-
export type UseAccountData = (params: AccountModuleParams) => AccountDataItem[];
|
71
|
-
|
72
|
-
export type NetworkHookParams = {
|
73
|
-
assets: CryptoOrTokenCurrency[];
|
74
|
-
selectedAssetId: string;
|
75
|
-
currenciesByProvider: CurrenciesByProviderId[];
|
76
|
-
accounts$?: Observable<WalletAPIAccount[]>;
|
77
|
-
};
|
78
|
-
export type NetworkHook = (params: NetworkHookParams) => Array<CryptoOrTokenCurrency & Network>;
|
79
|
-
|
80
|
-
export type NetworkConfigurationDeps = {
|
81
|
-
useAccountData: UseAccountData;
|
82
|
-
accountsCount: CreateAccountsCount;
|
83
|
-
accountsCountAndApy: CreateAccountsCountAndApy;
|
84
|
-
useBalanceDeps: UseBalanceDeps;
|
85
|
-
balanceItem: CreateBalanceItem;
|
86
|
-
};
|
87
|
-
|
88
|
-
export type LeftElementKind = "numberOfAccounts" | "numberOfAccountsAndApy" | "undefined";
|
89
|
-
export type RightElementKind = "balance" | "undefined";
|
90
|
-
|
91
|
-
export type Network = {
|
92
|
-
name: string;
|
93
|
-
id: string;
|
94
|
-
ticker: string;
|
95
|
-
leftElement?: React.ReactNode;
|
96
|
-
rightElement?: React.ReactNode;
|
97
|
-
};
|
98
|
-
|
99
|
-
export type CreateNetworkConfigurationHookProps = {
|
100
|
-
networksConfig: EnhancedModularDrawerConfiguration["networks"];
|
101
|
-
currenciesByProvider?: CurrenciesByProviderId[];
|
102
|
-
selectedAssetId: string;
|
103
|
-
accounts$?: Observable<WalletAPIAccount[]>;
|
104
|
-
};
|
105
|
-
|
106
|
-
type Props = {
|
107
|
-
assetsConfiguration: EnhancedModularDrawerConfiguration["assets"];
|
108
|
-
currenciesByProvider?: CurrenciesByProviderId[];
|
109
|
-
};
|
110
|
-
|
111
|
-
export type AssetConfigurationDeps = {
|
112
|
-
ApyIndicator: (args: { value: number; type: ApyType }) => ReactNode;
|
113
|
-
useBalanceDeps: UseBalanceDeps;
|
114
|
-
balanceItem: (asset: { fiatValue?: string; balance?: string }) => ReactNode;
|
115
|
-
};
|
116
|
-
|
117
|
-
export type CreateAssetConfigurationHook = (
|
118
|
-
AssetConfigurationDeps: AssetConfigurationDeps,
|
119
|
-
) => (props: Props) => (assets: CryptoOrTokenCurrency[]) => (CryptoOrTokenCurrency & AssetType)[];
|
@@ -666,8 +666,8 @@ function extractSwapStartParam(
|
|
666
666
|
fromParentAccount,
|
667
667
|
fromCurrency: getCurrencyForAccount(fromAccount),
|
668
668
|
toAccount: newTokenAccount ? newTokenAccount : toAccount,
|
669
|
-
toParentAccount: toParentAccount,
|
670
|
-
toCurrency: getCurrencyForAccount(
|
669
|
+
toParentAccount: newTokenAccount ? toAccount : toParentAccount,
|
670
|
+
toCurrency: getCurrencyForAccount(toAccount),
|
671
671
|
},
|
672
672
|
};
|
673
673
|
}
|
package/src/wallet-api/react.ts
CHANGED
@@ -130,8 +130,6 @@ export interface UiHook {
|
|
130
130
|
"account.request": (params: {
|
131
131
|
accounts$?: Observable<WalletAPIAccount[]>;
|
132
132
|
currencies: CryptoOrTokenCurrency[];
|
133
|
-
areCurrenciesFiltered?: boolean;
|
134
|
-
useCase?: string;
|
135
133
|
drawerConfiguration?: ModularDrawerConfiguration;
|
136
134
|
onSuccess: (account: AccountLike, parentAccount: Account | undefined) => void;
|
137
135
|
onCancel: () => void;
|
@@ -360,7 +358,7 @@ export function useWalletAPIServer({
|
|
360
358
|
|
361
359
|
server.setHandler(
|
362
360
|
"account.request",
|
363
|
-
async ({ accounts$, currencies$, drawerConfiguration
|
361
|
+
async ({ accounts$, currencies$, drawerConfiguration }) => {
|
364
362
|
tracking.requestAccountRequested(manifest);
|
365
363
|
const currencies = await firstValueFrom(currencies$);
|
366
364
|
|
@@ -379,8 +377,6 @@ export function useWalletAPIServer({
|
|
379
377
|
accounts$,
|
380
378
|
currencies: currencyList,
|
381
379
|
drawerConfiguration,
|
382
|
-
areCurrenciesFiltered,
|
383
|
-
useCase,
|
384
380
|
onSuccess: (account: AccountLike, parentAccount: Account | undefined) => {
|
385
381
|
if (done) return;
|
386
382
|
done = true;
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"cal-integration.d.ts","sourceRoot":"","sources":["../../../src/bridge/crypto-assets/cal-integration.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAM9D,wBAAgB,uBAAuB,IAAI,OAAO,CAOjD;AAED,wBAAgB,WAAW,IAAI,iBAAiB,CAK/C"}
|
@@ -1,26 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.getCALStore = exports.isCALIntegrationEnabled = void 0;
|
4
|
-
const live_env_1 = require("@ledgerhq/live-env");
|
5
|
-
const logs_1 = require("@ledgerhq/logs");
|
6
|
-
const cal_store_1 = require("./cal-store");
|
7
|
-
const firebaseFeatureFlags_1 = require("../../featureFlags/firebaseFeatureFlags");
|
8
|
-
let calStoreInstance;
|
9
|
-
function isCALIntegrationEnabled() {
|
10
|
-
try {
|
11
|
-
return !(0, live_env_1.getEnv)("MOCK") && (0, firebaseFeatureFlags_1.isFeature)("calLedgerService");
|
12
|
-
}
|
13
|
-
catch (error) {
|
14
|
-
(0, logs_1.log)("cal", "Error checking CAL integration:", error);
|
15
|
-
return false;
|
16
|
-
}
|
17
|
-
}
|
18
|
-
exports.isCALIntegrationEnabled = isCALIntegrationEnabled;
|
19
|
-
function getCALStore() {
|
20
|
-
if (!calStoreInstance) {
|
21
|
-
calStoreInstance = new cal_store_1.CALStore();
|
22
|
-
}
|
23
|
-
return calStoreInstance;
|
24
|
-
}
|
25
|
-
exports.getCALStore = getCALStore;
|
26
|
-
//# sourceMappingURL=cal-integration.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"cal-integration.js","sourceRoot":"","sources":["../../../src/bridge/crypto-assets/cal-integration.ts"],"names":[],"mappings":";;;AAAA,iDAA4C;AAC5C,yCAAqC;AAErC,2CAAuC;AACvC,kFAAoE;AAEpE,IAAI,gBAAsC,CAAC;AAE3C,SAAgB,uBAAuB;IACrC,IAAI;QACF,OAAO,CAAC,IAAA,iBAAM,EAAC,MAAM,CAAC,IAAI,IAAA,gCAAS,EAAC,kBAAkB,CAAC,CAAC;KACzD;IAAC,OAAO,KAAK,EAAE;QACd,IAAA,UAAG,EAAC,KAAK,EAAE,iCAAiC,EAAE,KAAK,CAAC,CAAC;QACrD,OAAO,KAAK,CAAC;KACd;AACH,CAAC;AAPD,0DAOC;AAED,SAAgB,WAAW;IACzB,IAAI,CAAC,gBAAgB,EAAE;QACrB,gBAAgB,GAAG,IAAI,oBAAQ,EAAE,CAAC;KACnC;IACD,OAAO,gBAAgB,CAAC;AAC1B,CAAC;AALD,kCAKC"}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"cal-integration.test.d.ts","sourceRoot":"","sources":["../../../src/bridge/crypto-assets/cal-integration.test.ts"],"names":[],"mappings":""}
|