@ledgerhq/live-common 34.50.0 → 34.51.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 +1 -1
- package/lib/__tests__/test-helpers/environment.js.map +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/buildSubAccounts.d.ts +4 -4
- package/lib/bridge/generic-alpaca/buildSubAccounts.d.ts.map +1 -1
- package/lib/bridge/generic-alpaca/buildSubAccounts.js +7 -9
- package/lib/bridge/generic-alpaca/buildSubAccounts.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/getAccountShape.d.ts.map +1 -1
- package/lib/bridge/generic-alpaca/getAccountShape.js +15 -9
- package/lib/bridge/generic-alpaca/getAccountShape.js.map +1 -1
- package/lib/bridge/generic-alpaca/getTransactionStatus.js +1 -1
- 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 +29 -4
- package/lib/bridge/generic-alpaca/prepareTransaction.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/getAccountShape.test.js +5 -3
- package/lib/bridge/generic-alpaca/tests/getAccountShape.test.js.map +1 -1
- package/lib/bridge/generic-alpaca/tests/prepareTransaction.test.js +60 -0
- package/lib/bridge/generic-alpaca/tests/prepareTransaction.test.js.map +1 -1
- package/lib/bridge/generic-alpaca/tests/signOperation.test.js +1 -1
- package/lib/bridge/generic-alpaca/tests/signOperation.test.js.map +1 -1
- package/lib/bridge/generic-alpaca/types.d.ts +1 -2
- package/lib/bridge/generic-alpaca/types.d.ts.map +1 -1
- package/lib/bridge/generic-alpaca/utils.d.ts +2 -2
- package/lib/bridge/generic-alpaca/utils.d.ts.map +1 -1
- package/lib/bridge/generic-alpaca/utils.js +23 -4
- package/lib/bridge/generic-alpaca/utils.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/dada-client/entities/index.d.ts.map +1 -0
- package/lib/dada-client/entities/index.js.map +1 -0
- package/lib/{modularDrawer/data → dada-client}/entities/interestRateSelectors.d.ts +1 -1
- package/lib/dada-client/entities/interestRateSelectors.d.ts.map +1 -0
- package/lib/dada-client/entities/interestRateSelectors.js.map +1 -0
- package/lib/{modularDrawer/data → dada-client}/entities/marketSelectors.d.ts +1 -1
- package/lib/dada-client/entities/marketSelectors.d.ts.map +1 -0
- package/lib/dada-client/entities/marketSelectors.js.map +1 -0
- package/lib/dada-client/entities/selectorUtils.d.ts.map +1 -0
- package/lib/dada-client/entities/selectorUtils.js.map +1 -0
- package/lib/dada-client/hooks/__tests__/useAssetsData.test.d.ts.map +1 -0
- package/lib/{modularDrawer/hooks/__test__ → dada-client/hooks/__tests__}/useAssetsData.test.js +2 -2
- package/lib/dada-client/hooks/__tests__/useAssetsData.test.js.map +1 -0
- package/lib/dada-client/hooks/useAssetData.d.ts +10 -0
- package/lib/dada-client/hooks/useAssetData.d.ts.map +1 -0
- package/lib/dada-client/hooks/useAssetData.js +23 -0
- package/lib/dada-client/hooks/useAssetData.js.map +1 -0
- package/lib/dada-client/hooks/useAssetsData.d.ts +19 -0
- package/lib/dada-client/hooks/useAssetsData.d.ts.map +1 -0
- package/lib/{modularDrawer → dada-client}/hooks/useAssetsData.js +1 -1
- package/lib/dada-client/hooks/useAssetsData.js.map +1 -0
- package/lib/dada-client/hooks/useInterestRatesByCurrencies.d.ts.map +1 -0
- package/lib/{modularDrawer → dada-client}/hooks/useInterestRatesByCurrencies.js +3 -3
- package/lib/dada-client/hooks/useInterestRatesByCurrencies.js.map +1 -0
- package/lib/dada-client/hooks/useMarketByCurrencies.d.ts.map +1 -0
- package/lib/{modularDrawer → dada-client}/hooks/useMarketByCurrencies.js +5 -6
- package/lib/dada-client/hooks/useMarketByCurrencies.js.map +1 -0
- package/lib/{modularDrawer/data → dada-client}/state-manager/api.d.ts +134 -1
- package/lib/{modularDrawer/data → dada-client}/state-manager/api.d.ts.map +1 -1
- package/lib/{modularDrawer/data → dada-client}/state-manager/api.js +21 -2
- package/lib/dada-client/state-manager/api.js.map +1 -0
- package/lib/dada-client/state-manager/types.d.ts.map +1 -0
- package/lib/dada-client/state-manager/types.js.map +1 -0
- package/lib/dada-client/types/trend.d.ts +2 -0
- package/lib/dada-client/types/trend.d.ts.map +1 -0
- package/lib/dada-client/types/trend.js +3 -0
- package/lib/dada-client/types/trend.js.map +1 -0
- package/lib/deposit/useGroupedCurrenciesByProvider.hook.d.ts.map +1 -1
- package/lib/deposit/useGroupedCurrenciesByProvider.hook.js +6 -1
- package/lib/deposit/useGroupedCurrenciesByProvider.hook.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 +4 -0
- package/lib/e2e/enum/Account.js.map +1 -1
- package/lib/e2e/enum/AppInfos.d.ts +1 -0
- package/lib/e2e/enum/AppInfos.d.ts.map +1 -1
- package/lib/e2e/enum/AppInfos.js +1 -0
- package/lib/e2e/enum/AppInfos.js.map +1 -1
- package/lib/e2e/enum/Currency.d.ts +2 -0
- package/lib/e2e/enum/Currency.d.ts.map +1 -1
- package/lib/e2e/enum/Currency.js +4 -0
- package/lib/e2e/enum/Currency.js.map +1 -1
- package/lib/e2e/enum/Network.d.ts +2 -1
- 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/enum/Provider.d.ts +1 -0
- package/lib/e2e/enum/Provider.d.ts.map +1 -1
- package/lib/e2e/enum/Provider.js +1 -0
- package/lib/e2e/enum/Provider.js.map +1 -1
- package/lib/e2e/families/hedera.d.ts +2 -0
- package/lib/e2e/families/hedera.d.ts.map +1 -0
- package/lib/e2e/families/hedera.js +11 -0
- package/lib/e2e/families/hedera.js.map +1 -0
- package/lib/e2e/speculos.d.ts.map +1 -1
- package/lib/e2e/speculos.js +12 -0
- package/lib/e2e/speculos.js.map +1 -1
- package/lib/e2e/swap.d.ts +1 -1
- package/lib/e2e/swap.d.ts.map +1 -1
- package/lib/e2e/swap.js +6 -5
- package/lib/e2e/swap.js.map +1 -1
- package/lib/exchange/platform/types.d.ts +2 -0
- package/lib/exchange/platform/types.d.ts.map +1 -1
- package/lib/exchange/swap/completeExchange.d.ts.map +1 -1
- package/lib/exchange/swap/completeExchange.js +22 -1
- package/lib/exchange/swap/completeExchange.js.map +1 -1
- package/lib/exchange/swap/getIncompatibleCurrencyKeys.d.ts.map +1 -1
- package/lib/exchange/swap/getIncompatibleCurrencyKeys.js +8 -0
- package/lib/exchange/swap/getIncompatibleCurrencyKeys.js.map +1 -1
- package/lib/exchange/swap/postSwapState.d.ts.map +1 -1
- package/lib/exchange/swap/postSwapState.js +19 -23
- package/lib/exchange/swap/postSwapState.js.map +1 -1
- package/lib/exchange/swap/setBroadcastTransaction.d.ts +4 -4
- package/lib/exchange/swap/setBroadcastTransaction.js +7 -7
- package/lib/exchange/swap/setBroadcastTransaction.js.map +1 -1
- package/lib/exchange/swap/types.d.ts +3 -3
- package/lib/exchange/swap/types.d.ts.map +1 -1
- package/lib/exchange/swap/updateAccountSwapStatus.d.ts.map +1 -1
- package/lib/exchange/swap/updateAccountSwapStatus.js +6 -4
- package/lib/exchange/swap/updateAccountSwapStatus.js.map +1 -1
- package/lib/families/canton/config.js +10 -10
- package/lib/families/canton/config.js.map +1 -1
- package/lib/families/evm/shouldUseReceiveOptions.d.ts +3 -0
- package/lib/families/evm/shouldUseReceiveOptions.d.ts.map +1 -0
- package/lib/families/evm/shouldUseReceiveOptions.js +5 -0
- package/lib/families/evm/shouldUseReceiveOptions.js.map +1 -0
- package/lib/families/evm/shouldUseReceiveOptions.test.d.ts +2 -0
- package/lib/families/evm/shouldUseReceiveOptions.test.d.ts.map +1 -0
- package/lib/families/evm/shouldUseReceiveOptions.test.js +26 -0
- package/lib/families/evm/shouldUseReceiveOptions.test.js.map +1 -0
- package/lib/families/hedera/exchange.d.ts +9 -0
- package/lib/families/hedera/exchange.d.ts.map +1 -0
- package/lib/families/hedera/exchange.js +36 -0
- package/lib/families/hedera/exchange.js.map +1 -0
- package/lib/families/tezos/config.js +2 -2
- 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/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/hw/actions/completeExchange.d.ts +2 -0
- package/lib/hw/actions/completeExchange.d.ts.map +1 -1
- package/lib/hw/actions/completeExchange.js +1 -0
- package/lib/hw/actions/completeExchange.js.map +1 -1
- package/lib/hw/signMessage/index.d.ts.map +1 -1
- package/lib/hw/signMessage/index.js +7 -0
- package/lib/hw/signMessage/index.js.map +1 -1
- package/lib/modularDrawer/hooks/modules/useLeftApyModule.d.ts +1 -1
- package/lib/modularDrawer/hooks/modules/useLeftApyModule.d.ts.map +1 -1
- package/lib/modularDrawer/hooks/modules/useLeftApyModule.js +1 -1
- package/lib/modularDrawer/hooks/modules/useLeftApyModule.js.map +1 -1
- package/lib/modularDrawer/hooks/modules/useLeftMarketTrendModule.js +1 -1
- package/lib/modularDrawer/hooks/modules/useLeftMarketTrendModule.js.map +1 -1
- package/lib/modularDrawer/hooks/modules/useRightMarketTrendModule.js +6 -3
- package/lib/modularDrawer/hooks/modules/useRightMarketTrendModule.js.map +1 -1
- package/lib/modularDrawer/hooks/useAssetAccountCounts.d.ts.map +1 -1
- package/lib/modularDrawer/hooks/useAssetAccountCounts.js +2 -4
- package/lib/modularDrawer/hooks/useAssetAccountCounts.js.map +1 -1
- package/lib/modularDrawer/hooks/useCurrenciesUnderFeatureFlag.d.ts +7 -0
- package/lib/modularDrawer/hooks/useCurrenciesUnderFeatureFlag.d.ts.map +1 -0
- package/lib/modularDrawer/hooks/useCurrenciesUnderFeatureFlag.js +224 -0
- package/lib/modularDrawer/hooks/useCurrenciesUnderFeatureFlag.js.map +1 -0
- package/lib/modularDrawer/hooks/useLeftAccountsApy.js +1 -1
- package/lib/modularDrawer/hooks/useLeftAccountsApy.js.map +1 -1
- package/lib/modularDrawer/hooks/useRightBalanceAsset.d.ts +8 -10
- package/lib/modularDrawer/hooks/useRightBalanceAsset.d.ts.map +1 -1
- package/lib/modularDrawer/hooks/useRightBalanceAsset.js +21 -64
- package/lib/modularDrawer/hooks/useRightBalanceAsset.js.map +1 -1
- package/lib/modularDrawer/hooks/useRightBalanceNetwork.d.ts +7 -28
- package/lib/modularDrawer/hooks/useRightBalanceNetwork.d.ts.map +1 -1
- package/lib/modularDrawer/hooks/useRightBalanceNetwork.js +12 -56
- 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 +2 -2
- package/lib/modularDrawer/modules/createAssetConfiguration.js.map +1 -1
- package/lib/modularDrawer/modules/createNetworkConfiguration.d.ts +1 -1
- package/lib/modularDrawer/modules/createNetworkConfiguration.d.ts.map +1 -1
- package/lib/modularDrawer/modules/createNetworkConfiguration.js +15 -4
- package/lib/modularDrawer/modules/createNetworkConfiguration.js.map +1 -1
- package/lib/modularDrawer/utils/__tests__/calculateProviderTotal.test.d.ts +2 -0
- package/lib/modularDrawer/utils/__tests__/calculateProviderTotal.test.d.ts.map +1 -0
- package/lib/modularDrawer/utils/__tests__/calculateProviderTotal.test.js +212 -0
- package/lib/modularDrawer/utils/__tests__/calculateProviderTotal.test.js.map +1 -0
- package/lib/modularDrawer/utils/__tests__/groupAccountsByAsset.test.d.ts +2 -0
- package/lib/modularDrawer/utils/__tests__/groupAccountsByAsset.test.d.ts.map +1 -0
- package/lib/modularDrawer/utils/__tests__/groupAccountsByAsset.test.js +202 -0
- package/lib/modularDrawer/utils/__tests__/groupAccountsByAsset.test.js.map +1 -0
- package/lib/modularDrawer/utils/calculateProviderTotal.d.ts +1 -0
- package/lib/modularDrawer/utils/calculateProviderTotal.d.ts.map +1 -1
- package/lib/modularDrawer/utils/calculateProviderTotal.js +10 -2
- package/lib/modularDrawer/utils/calculateProviderTotal.js.map +1 -1
- package/lib/modularDrawer/utils/currencyUtils.d.ts.map +1 -1
- package/lib/modularDrawer/utils/currencyUtils.js.map +1 -1
- package/lib/modularDrawer/utils/getBalanceAndFiatValueByAssets.d.ts +6 -4
- package/lib/modularDrawer/utils/getBalanceAndFiatValueByAssets.d.ts.map +1 -1
- package/lib/modularDrawer/utils/getBalanceAndFiatValueByAssets.js +9 -22
- package/lib/modularDrawer/utils/getBalanceAndFiatValueByAssets.js.map +1 -1
- package/lib/modularDrawer/utils/getInterestRateForAsset.d.ts +1 -1
- package/lib/modularDrawer/utils/getInterestRateForAsset.d.ts.map +1 -1
- package/lib/modularDrawer/utils/groupAccountsByAsset.d.ts +4 -3
- package/lib/modularDrawer/utils/groupAccountsByAsset.d.ts.map +1 -1
- package/lib/modularDrawer/utils/groupAccountsByAsset.js +27 -11
- package/lib/modularDrawer/utils/groupAccountsByAsset.js.map +1 -1
- package/lib/modularDrawer/utils/index.d.ts +2 -6
- package/lib/modularDrawer/utils/index.d.ts.map +1 -1
- package/lib/modularDrawer/utils/index.js +2 -13
- package/lib/modularDrawer/utils/index.js.map +1 -1
- package/lib/modularDrawer/utils/index.test.js +0 -26
- package/lib/modularDrawer/utils/index.test.js.map +1 -1
- package/lib/modularDrawer/utils/sortByBalance.d.ts +1 -3
- package/lib/modularDrawer/utils/sortByBalance.d.ts.map +1 -1
- package/lib/modularDrawer/utils/sortByBalance.js +6 -18
- package/lib/modularDrawer/utils/sortByBalance.js.map +1 -1
- package/lib/modularDrawer/utils/type.d.ts +15 -17
- package/lib/modularDrawer/utils/type.d.ts.map +1 -1
- package/lib/wallet-api/CustomDeeplink/server.d.ts +16 -0
- package/lib/wallet-api/CustomDeeplink/server.d.ts.map +1 -0
- package/lib/wallet-api/CustomDeeplink/server.js +10 -0
- package/lib/wallet-api/CustomDeeplink/server.js.map +1 -0
- package/lib/wallet-api/Exchange/server.js +6 -6
- package/lib/wallet-api/Exchange/server.js.map +1 -1
- package/lib/wallet-api/constants.d.ts +1 -1
- package/lib/wallet-api/constants.d.ts.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 +1 -1
- package/lib-es/__tests__/test-helpers/environment.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 +3 -0
- package/lib-es/bridge/generic-alpaca/alpaca/index.js.map +1 -1
- package/lib-es/bridge/generic-alpaca/buildSubAccounts.d.ts +4 -4
- package/lib-es/bridge/generic-alpaca/buildSubAccounts.d.ts.map +1 -1
- package/lib-es/bridge/generic-alpaca/buildSubAccounts.js +7 -9
- package/lib-es/bridge/generic-alpaca/buildSubAccounts.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/getAccountShape.d.ts.map +1 -1
- package/lib-es/bridge/generic-alpaca/getAccountShape.js +15 -9
- package/lib-es/bridge/generic-alpaca/getAccountShape.js.map +1 -1
- package/lib-es/bridge/generic-alpaca/getTransactionStatus.js +1 -1
- 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 +29 -4
- package/lib-es/bridge/generic-alpaca/prepareTransaction.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/getAccountShape.test.js +5 -3
- package/lib-es/bridge/generic-alpaca/tests/getAccountShape.test.js.map +1 -1
- package/lib-es/bridge/generic-alpaca/tests/prepareTransaction.test.js +60 -0
- package/lib-es/bridge/generic-alpaca/tests/prepareTransaction.test.js.map +1 -1
- package/lib-es/bridge/generic-alpaca/tests/signOperation.test.js +1 -1
- package/lib-es/bridge/generic-alpaca/tests/signOperation.test.js.map +1 -1
- package/lib-es/bridge/generic-alpaca/types.d.ts +1 -2
- package/lib-es/bridge/generic-alpaca/types.d.ts.map +1 -1
- package/lib-es/bridge/generic-alpaca/utils.d.ts +2 -2
- package/lib-es/bridge/generic-alpaca/utils.d.ts.map +1 -1
- package/lib-es/bridge/generic-alpaca/utils.js +23 -4
- package/lib-es/bridge/generic-alpaca/utils.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/dada-client/entities/index.d.ts.map +1 -0
- package/lib-es/dada-client/entities/index.js.map +1 -0
- package/lib-es/{modularDrawer/data → dada-client}/entities/interestRateSelectors.d.ts +1 -1
- package/lib-es/dada-client/entities/interestRateSelectors.d.ts.map +1 -0
- package/lib-es/dada-client/entities/interestRateSelectors.js.map +1 -0
- package/lib-es/{modularDrawer/data → dada-client}/entities/marketSelectors.d.ts +1 -1
- package/lib-es/dada-client/entities/marketSelectors.d.ts.map +1 -0
- package/lib-es/dada-client/entities/marketSelectors.js.map +1 -0
- package/lib-es/dada-client/entities/selectorUtils.d.ts.map +1 -0
- package/lib-es/dada-client/entities/selectorUtils.js.map +1 -0
- package/lib-es/dada-client/hooks/__tests__/useAssetsData.test.d.ts.map +1 -0
- package/lib-es/{modularDrawer/hooks/__test__ → dada-client/hooks/__tests__}/useAssetsData.test.js +2 -2
- package/lib-es/dada-client/hooks/__tests__/useAssetsData.test.js.map +1 -0
- package/lib-es/dada-client/hooks/useAssetData.d.ts +10 -0
- package/lib-es/dada-client/hooks/useAssetData.d.ts.map +1 -0
- package/lib-es/dada-client/hooks/useAssetData.js +19 -0
- package/lib-es/dada-client/hooks/useAssetData.js.map +1 -0
- package/lib-es/dada-client/hooks/useAssetsData.d.ts +19 -0
- package/lib-es/dada-client/hooks/useAssetsData.d.ts.map +1 -0
- package/lib-es/{modularDrawer → dada-client}/hooks/useAssetsData.js +1 -1
- package/lib-es/dada-client/hooks/useAssetsData.js.map +1 -0
- package/lib-es/dada-client/hooks/useInterestRatesByCurrencies.d.ts.map +1 -0
- package/lib-es/{modularDrawer → dada-client}/hooks/useInterestRatesByCurrencies.js +3 -3
- package/lib-es/dada-client/hooks/useInterestRatesByCurrencies.js.map +1 -0
- package/lib-es/dada-client/hooks/useMarketByCurrencies.d.ts.map +1 -0
- package/lib-es/{modularDrawer → dada-client}/hooks/useMarketByCurrencies.js +5 -6
- package/lib-es/dada-client/hooks/useMarketByCurrencies.js.map +1 -0
- package/lib-es/{modularDrawer/data → dada-client}/state-manager/api.d.ts +134 -1
- package/lib-es/{modularDrawer/data → dada-client}/state-manager/api.d.ts.map +1 -1
- package/lib-es/{modularDrawer/data → dada-client}/state-manager/api.js +20 -1
- package/lib-es/dada-client/state-manager/api.js.map +1 -0
- package/lib-es/dada-client/state-manager/types.d.ts.map +1 -0
- package/lib-es/dada-client/state-manager/types.js.map +1 -0
- package/lib-es/dada-client/types/trend.d.ts +2 -0
- package/lib-es/dada-client/types/trend.d.ts.map +1 -0
- package/lib-es/dada-client/types/trend.js +2 -0
- package/lib-es/dada-client/types/trend.js.map +1 -0
- package/lib-es/deposit/useGroupedCurrenciesByProvider.hook.d.ts.map +1 -1
- package/lib-es/deposit/useGroupedCurrenciesByProvider.hook.js +6 -1
- package/lib-es/deposit/useGroupedCurrenciesByProvider.hook.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 +4 -0
- package/lib-es/e2e/enum/Account.js.map +1 -1
- package/lib-es/e2e/enum/AppInfos.d.ts +1 -0
- package/lib-es/e2e/enum/AppInfos.d.ts.map +1 -1
- package/lib-es/e2e/enum/AppInfos.js +1 -0
- package/lib-es/e2e/enum/AppInfos.js.map +1 -1
- package/lib-es/e2e/enum/Currency.d.ts +2 -0
- package/lib-es/e2e/enum/Currency.d.ts.map +1 -1
- package/lib-es/e2e/enum/Currency.js +4 -0
- package/lib-es/e2e/enum/Currency.js.map +1 -1
- package/lib-es/e2e/enum/Network.d.ts +2 -1
- 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/enum/Provider.d.ts +1 -0
- package/lib-es/e2e/enum/Provider.d.ts.map +1 -1
- package/lib-es/e2e/enum/Provider.js +1 -0
- package/lib-es/e2e/enum/Provider.js.map +1 -1
- package/lib-es/e2e/families/hedera.d.ts +2 -0
- package/lib-es/e2e/families/hedera.d.ts.map +1 -0
- package/lib-es/e2e/families/hedera.js +7 -0
- package/lib-es/e2e/families/hedera.js.map +1 -0
- package/lib-es/e2e/speculos.d.ts.map +1 -1
- package/lib-es/e2e/speculos.js +12 -0
- package/lib-es/e2e/speculos.js.map +1 -1
- package/lib-es/e2e/swap.d.ts +1 -1
- package/lib-es/e2e/swap.d.ts.map +1 -1
- package/lib-es/e2e/swap.js +6 -5
- package/lib-es/e2e/swap.js.map +1 -1
- package/lib-es/exchange/platform/types.d.ts +2 -0
- package/lib-es/exchange/platform/types.d.ts.map +1 -1
- package/lib-es/exchange/swap/completeExchange.d.ts.map +1 -1
- package/lib-es/exchange/swap/completeExchange.js +22 -1
- package/lib-es/exchange/swap/completeExchange.js.map +1 -1
- package/lib-es/exchange/swap/getIncompatibleCurrencyKeys.d.ts.map +1 -1
- package/lib-es/exchange/swap/getIncompatibleCurrencyKeys.js +8 -0
- package/lib-es/exchange/swap/getIncompatibleCurrencyKeys.js.map +1 -1
- package/lib-es/exchange/swap/postSwapState.d.ts.map +1 -1
- package/lib-es/exchange/swap/postSwapState.js +19 -23
- package/lib-es/exchange/swap/postSwapState.js.map +1 -1
- package/lib-es/exchange/swap/setBroadcastTransaction.d.ts +4 -4
- package/lib-es/exchange/swap/setBroadcastTransaction.js +7 -7
- package/lib-es/exchange/swap/setBroadcastTransaction.js.map +1 -1
- package/lib-es/exchange/swap/types.d.ts +3 -3
- package/lib-es/exchange/swap/types.d.ts.map +1 -1
- package/lib-es/exchange/swap/updateAccountSwapStatus.d.ts.map +1 -1
- package/lib-es/exchange/swap/updateAccountSwapStatus.js +6 -4
- package/lib-es/exchange/swap/updateAccountSwapStatus.js.map +1 -1
- package/lib-es/families/canton/config.js +10 -10
- package/lib-es/families/canton/config.js.map +1 -1
- package/lib-es/families/evm/shouldUseReceiveOptions.d.ts +3 -0
- package/lib-es/families/evm/shouldUseReceiveOptions.d.ts.map +1 -0
- package/lib-es/families/evm/shouldUseReceiveOptions.js +3 -0
- package/lib-es/families/evm/shouldUseReceiveOptions.js.map +1 -0
- package/lib-es/families/evm/shouldUseReceiveOptions.test.d.ts +2 -0
- package/lib-es/families/evm/shouldUseReceiveOptions.test.d.ts.map +1 -0
- package/lib-es/families/evm/shouldUseReceiveOptions.test.js +21 -0
- package/lib-es/families/evm/shouldUseReceiveOptions.test.js.map +1 -0
- package/lib-es/families/hedera/exchange.d.ts +9 -0
- package/lib-es/families/hedera/exchange.d.ts.map +1 -0
- package/lib-es/families/hedera/exchange.js +29 -0
- package/lib-es/families/hedera/exchange.js.map +1 -0
- package/lib-es/families/tezos/config.js +2 -2
- 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/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/hw/actions/completeExchange.d.ts +2 -0
- package/lib-es/hw/actions/completeExchange.d.ts.map +1 -1
- package/lib-es/hw/actions/completeExchange.js +1 -0
- package/lib-es/hw/actions/completeExchange.js.map +1 -1
- package/lib-es/hw/signMessage/index.d.ts.map +1 -1
- package/lib-es/hw/signMessage/index.js +7 -0
- package/lib-es/hw/signMessage/index.js.map +1 -1
- package/lib-es/modularDrawer/hooks/modules/useLeftApyModule.d.ts +1 -1
- package/lib-es/modularDrawer/hooks/modules/useLeftApyModule.d.ts.map +1 -1
- package/lib-es/modularDrawer/hooks/modules/useLeftApyModule.js +1 -1
- package/lib-es/modularDrawer/hooks/modules/useLeftApyModule.js.map +1 -1
- package/lib-es/modularDrawer/hooks/modules/useLeftMarketTrendModule.js +1 -1
- package/lib-es/modularDrawer/hooks/modules/useLeftMarketTrendModule.js.map +1 -1
- package/lib-es/modularDrawer/hooks/modules/useRightMarketTrendModule.js +2 -2
- package/lib-es/modularDrawer/hooks/modules/useRightMarketTrendModule.js.map +1 -1
- package/lib-es/modularDrawer/hooks/useAssetAccountCounts.d.ts.map +1 -1
- package/lib-es/modularDrawer/hooks/useAssetAccountCounts.js +2 -4
- package/lib-es/modularDrawer/hooks/useAssetAccountCounts.js.map +1 -1
- package/lib-es/modularDrawer/hooks/useCurrenciesUnderFeatureFlag.d.ts +7 -0
- package/lib-es/modularDrawer/hooks/useCurrenciesUnderFeatureFlag.d.ts.map +1 -0
- package/lib-es/modularDrawer/hooks/useCurrenciesUnderFeatureFlag.js +217 -0
- package/lib-es/modularDrawer/hooks/useCurrenciesUnderFeatureFlag.js.map +1 -0
- package/lib-es/modularDrawer/hooks/useLeftAccountsApy.js +1 -1
- package/lib-es/modularDrawer/hooks/useLeftAccountsApy.js.map +1 -1
- package/lib-es/modularDrawer/hooks/useRightBalanceAsset.d.ts +8 -10
- package/lib-es/modularDrawer/hooks/useRightBalanceAsset.d.ts.map +1 -1
- package/lib-es/modularDrawer/hooks/useRightBalanceAsset.js +21 -64
- package/lib-es/modularDrawer/hooks/useRightBalanceAsset.js.map +1 -1
- package/lib-es/modularDrawer/hooks/useRightBalanceNetwork.d.ts +7 -28
- package/lib-es/modularDrawer/hooks/useRightBalanceNetwork.d.ts.map +1 -1
- package/lib-es/modularDrawer/hooks/useRightBalanceNetwork.js +12 -56
- 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 +2 -2
- package/lib-es/modularDrawer/modules/createAssetConfiguration.js.map +1 -1
- package/lib-es/modularDrawer/modules/createNetworkConfiguration.d.ts +1 -1
- package/lib-es/modularDrawer/modules/createNetworkConfiguration.d.ts.map +1 -1
- package/lib-es/modularDrawer/modules/createNetworkConfiguration.js +15 -4
- package/lib-es/modularDrawer/modules/createNetworkConfiguration.js.map +1 -1
- package/lib-es/modularDrawer/utils/__tests__/calculateProviderTotal.test.d.ts +2 -0
- package/lib-es/modularDrawer/utils/__tests__/calculateProviderTotal.test.d.ts.map +1 -0
- package/lib-es/modularDrawer/utils/__tests__/calculateProviderTotal.test.js +207 -0
- package/lib-es/modularDrawer/utils/__tests__/calculateProviderTotal.test.js.map +1 -0
- package/lib-es/modularDrawer/utils/__tests__/currencyUtils.test.js +1 -1
- package/lib-es/modularDrawer/utils/__tests__/currencyUtils.test.js.map +1 -1
- package/lib-es/modularDrawer/utils/__tests__/groupAccountsByAsset.test.d.ts +2 -0
- package/lib-es/modularDrawer/utils/__tests__/groupAccountsByAsset.test.d.ts.map +1 -0
- package/lib-es/modularDrawer/utils/__tests__/groupAccountsByAsset.test.js +197 -0
- package/lib-es/modularDrawer/utils/__tests__/groupAccountsByAsset.test.js.map +1 -0
- package/lib-es/modularDrawer/utils/calculateProviderTotal.d.ts +1 -0
- package/lib-es/modularDrawer/utils/calculateProviderTotal.d.ts.map +1 -1
- package/lib-es/modularDrawer/utils/calculateProviderTotal.js +10 -2
- package/lib-es/modularDrawer/utils/calculateProviderTotal.js.map +1 -1
- package/lib-es/modularDrawer/utils/currencyUtils.d.ts.map +1 -1
- package/lib-es/modularDrawer/utils/currencyUtils.js.map +1 -1
- package/lib-es/modularDrawer/utils/getBalanceAndFiatValueByAssets.d.ts +6 -4
- package/lib-es/modularDrawer/utils/getBalanceAndFiatValueByAssets.d.ts.map +1 -1
- package/lib-es/modularDrawer/utils/getBalanceAndFiatValueByAssets.js +9 -22
- package/lib-es/modularDrawer/utils/getBalanceAndFiatValueByAssets.js.map +1 -1
- package/lib-es/modularDrawer/utils/getInterestRateForAsset.d.ts +1 -1
- package/lib-es/modularDrawer/utils/getInterestRateForAsset.d.ts.map +1 -1
- package/lib-es/modularDrawer/utils/groupAccountsByAsset.d.ts +4 -3
- package/lib-es/modularDrawer/utils/groupAccountsByAsset.d.ts.map +1 -1
- package/lib-es/modularDrawer/utils/groupAccountsByAsset.js +27 -11
- package/lib-es/modularDrawer/utils/groupAccountsByAsset.js.map +1 -1
- package/lib-es/modularDrawer/utils/index.d.ts +2 -6
- package/lib-es/modularDrawer/utils/index.d.ts.map +1 -1
- package/lib-es/modularDrawer/utils/index.js +2 -10
- package/lib-es/modularDrawer/utils/index.js.map +1 -1
- package/lib-es/modularDrawer/utils/index.test.js +1 -27
- package/lib-es/modularDrawer/utils/index.test.js.map +1 -1
- package/lib-es/modularDrawer/utils/sortByBalance.d.ts +1 -3
- package/lib-es/modularDrawer/utils/sortByBalance.d.ts.map +1 -1
- package/lib-es/modularDrawer/utils/sortByBalance.js +5 -15
- package/lib-es/modularDrawer/utils/sortByBalance.js.map +1 -1
- package/lib-es/modularDrawer/utils/type.d.ts +15 -17
- package/lib-es/modularDrawer/utils/type.d.ts.map +1 -1
- package/lib-es/wallet-api/CustomDeeplink/server.d.ts +16 -0
- package/lib-es/wallet-api/CustomDeeplink/server.d.ts.map +1 -0
- package/lib-es/wallet-api/CustomDeeplink/server.js +6 -0
- package/lib-es/wallet-api/CustomDeeplink/server.js.map +1 -0
- package/lib-es/wallet-api/Exchange/server.js +6 -6
- package/lib-es/wallet-api/Exchange/server.js.map +1 -1
- package/lib-es/wallet-api/constants.d.ts +1 -1
- package/lib-es/wallet-api/constants.d.ts.map +1 -1
- package/package.json +11 -9
- package/src/__tests__/test-helpers/bridge.ts +1 -1
- package/src/__tests__/test-helpers/environment.ts +1 -1
- package/src/bridge/generic-alpaca/alpaca/index.ts +4 -0
- package/src/bridge/generic-alpaca/buildSubAccounts.ts +28 -28
- package/src/bridge/generic-alpaca/createTransaction.ts +11 -0
- package/src/bridge/generic-alpaca/getAccountShape.ts +22 -15
- package/src/bridge/generic-alpaca/getTransactionStatus.ts +1 -1
- package/src/bridge/generic-alpaca/prepareTransaction.ts +47 -5
- 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/getAccountShape.test.ts +5 -3
- package/src/bridge/generic-alpaca/tests/prepareTransaction.test.ts +78 -0
- package/src/bridge/generic-alpaca/tests/signOperation.test.ts +1 -1
- package/src/bridge/generic-alpaca/types.ts +10 -2
- package/src/bridge/generic-alpaca/utils.ts +25 -6
- package/src/bridge/impl.ts +1 -0
- package/src/dada-client/README.md +93 -0
- package/src/{modularDrawer/data → dada-client}/entities/interestRateSelectors.ts +1 -1
- package/src/{modularDrawer/data → dada-client}/entities/marketSelectors.ts +1 -1
- package/src/{modularDrawer/hooks/__test__ → dada-client/hooks/__tests__}/useAssetsData.test.ts +2 -2
- package/src/dada-client/hooks/useAssetData.ts +22 -0
- package/src/{modularDrawer → dada-client}/hooks/useAssetsData.ts +2 -2
- package/src/{modularDrawer → dada-client}/hooks/useInterestRatesByCurrencies.ts +4 -4
- package/src/{modularDrawer → dada-client}/hooks/useMarketByCurrencies.ts +5 -6
- package/src/{modularDrawer/data → dada-client}/state-manager/api.ts +22 -1
- package/src/dada-client/types/trend.ts +1 -0
- package/src/deposit/useGroupedCurrenciesByProvider.hook.ts +8 -2
- package/src/e2e/enum/Account.ts +10 -0
- package/src/e2e/enum/AppInfos.ts +2 -0
- package/src/e2e/enum/Currency.ts +11 -0
- package/src/e2e/enum/Network.ts +1 -0
- package/src/e2e/enum/Provider.ts +1 -0
- package/src/e2e/families/hedera.ts +7 -0
- package/src/e2e/speculos.ts +12 -0
- package/src/e2e/swap.ts +6 -6
- package/src/exchange/platform/types.ts +2 -0
- package/src/exchange/swap/completeExchange.ts +32 -2
- package/src/exchange/swap/getIncompatibleCurrencyKeys.ts +8 -0
- package/src/exchange/swap/postSwapState.ts +28 -32
- package/src/exchange/swap/setBroadcastTransaction.ts +12 -12
- package/src/exchange/swap/types.ts +3 -3
- package/src/exchange/swap/updateAccountSwapStatus.ts +8 -6
- package/src/families/canton/config.ts +10 -10
- package/src/families/evm/shouldUseReceiveOptions.test.ts +25 -0
- package/src/families/evm/shouldUseReceiveOptions.ts +4 -0
- package/src/families/hedera/exchange.ts +48 -0
- package/src/families/tezos/config.ts +2 -2
- package/src/families/tezos/react.ts +20 -1
- package/src/families/tezos/setup.ts +3 -22
- package/src/generated/bridge/js.ts +0 -2
- package/src/hw/actions/completeExchange.ts +3 -0
- package/src/hw/signMessage/index.ts +10 -0
- package/src/modularDrawer/hooks/modules/useLeftApyModule.tsx +2 -2
- package/src/modularDrawer/hooks/modules/useLeftMarketTrendModule.tsx +1 -1
- package/src/modularDrawer/hooks/modules/useRightMarketTrendModule.tsx +2 -2
- package/src/modularDrawer/hooks/useAssetAccountCounts.tsx +8 -10
- package/src/modularDrawer/hooks/useCurrenciesUnderFeatureFlag.ts +231 -0
- package/src/modularDrawer/hooks/useLeftAccountsApy.tsx +1 -1
- package/src/modularDrawer/hooks/useRightBalanceAsset.tsx +26 -102
- package/src/modularDrawer/hooks/useRightBalanceNetwork.tsx +19 -100
- package/src/modularDrawer/modules/createAssetConfiguration.ts +3 -11
- package/src/modularDrawer/modules/createNetworkConfiguration.ts +26 -10
- package/src/modularDrawer/utils/__tests__/calculateProviderTotal.test.ts +237 -0
- package/src/modularDrawer/utils/__tests__/currencyUtils.test.ts +1 -1
- package/src/modularDrawer/utils/__tests__/getInterestRateForAsset.test.ts +1 -1
- package/src/modularDrawer/utils/__tests__/groupAccountsByAsset.test.ts +228 -0
- package/src/modularDrawer/utils/calculateProviderTotal.ts +13 -2
- package/src/modularDrawer/utils/currencyUtils.ts +0 -1
- package/src/modularDrawer/utils/getBalanceAndFiatValueByAssets.ts +13 -37
- package/src/modularDrawer/utils/getInterestRateForAsset.ts +1 -1
- package/src/modularDrawer/utils/groupAccountsByAsset.ts +38 -19
- package/src/modularDrawer/utils/index.test.ts +1 -32
- package/src/modularDrawer/utils/index.ts +2 -23
- package/src/modularDrawer/utils/sortByBalance.tsx +5 -18
- package/src/modularDrawer/utils/type.ts +18 -14
- package/src/wallet-api/CustomDeeplink/server.ts +23 -0
- package/src/wallet-api/Exchange/server.ts +6 -6
- package/lib/modularDrawer/data/entities/index.d.ts.map +0 -1
- package/lib/modularDrawer/data/entities/index.js.map +0 -1
- package/lib/modularDrawer/data/entities/interestRateSelectors.d.ts.map +0 -1
- package/lib/modularDrawer/data/entities/interestRateSelectors.js.map +0 -1
- package/lib/modularDrawer/data/entities/marketSelectors.d.ts.map +0 -1
- package/lib/modularDrawer/data/entities/marketSelectors.js.map +0 -1
- package/lib/modularDrawer/data/entities/selectorUtils.d.ts.map +0 -1
- package/lib/modularDrawer/data/entities/selectorUtils.js.map +0 -1
- package/lib/modularDrawer/data/state-manager/api.js.map +0 -1
- package/lib/modularDrawer/data/state-manager/types.d.ts.map +0 -1
- package/lib/modularDrawer/data/state-manager/types.js.map +0 -1
- package/lib/modularDrawer/hooks/__test__/useAssetsData.test.d.ts.map +0 -1
- package/lib/modularDrawer/hooks/__test__/useAssetsData.test.js.map +0 -1
- package/lib/modularDrawer/hooks/useAssetsData.d.ts +0 -19
- package/lib/modularDrawer/hooks/useAssetsData.d.ts.map +0 -1
- package/lib/modularDrawer/hooks/useAssetsData.js.map +0 -1
- package/lib/modularDrawer/hooks/useInterestRatesByCurrencies.d.ts.map +0 -1
- package/lib/modularDrawer/hooks/useInterestRatesByCurrencies.js.map +0 -1
- package/lib/modularDrawer/hooks/useMarketByCurrencies.d.ts.map +0 -1
- package/lib/modularDrawer/hooks/useMarketByCurrencies.js.map +0 -1
- package/lib/modularDrawer/utils/__tests__/counterValueFormatter.test.d.ts +0 -2
- package/lib/modularDrawer/utils/__tests__/counterValueFormatter.test.d.ts.map +0 -1
- package/lib/modularDrawer/utils/__tests__/counterValueFormatter.test.js +0 -496
- package/lib/modularDrawer/utils/__tests__/counterValueFormatter.test.js.map +0 -1
- package/lib/modularDrawer/utils/__tests__/haveOneCommonProvider.test.d.ts +0 -2
- package/lib/modularDrawer/utils/__tests__/haveOneCommonProvider.test.d.ts.map +0 -1
- package/lib/modularDrawer/utils/__tests__/haveOneCommonProvider.test.js +0 -28
- package/lib/modularDrawer/utils/__tests__/haveOneCommonProvider.test.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/counterValueFormatter.d.ts +0 -14
- package/lib/modularDrawer/utils/counterValueFormatter.d.ts.map +0 -1
- package/lib/modularDrawer/utils/counterValueFormatter.js +0 -107
- package/lib/modularDrawer/utils/counterValueFormatter.js.map +0 -1
- package/lib/modularDrawer/utils/getBalanceAndFiatValue.d.ts +0 -20
- package/lib/modularDrawer/utils/getBalanceAndFiatValue.d.ts.map +0 -1
- package/lib/modularDrawer/utils/getBalanceAndFiatValue.js +0 -39
- package/lib/modularDrawer/utils/getBalanceAndFiatValue.js.map +0 -1
- package/lib/modularDrawer/utils/getProviderCurrency.d.ts +0 -3
- package/lib/modularDrawer/utils/getProviderCurrency.d.ts.map +0 -1
- package/lib/modularDrawer/utils/getProviderCurrency.js +0 -14
- package/lib/modularDrawer/utils/getProviderCurrency.js.map +0 -1
- package/lib/modularDrawer/utils/haveOneCommonProvider.d.ts +0 -11
- package/lib/modularDrawer/utils/haveOneCommonProvider.d.ts.map +0 -1
- package/lib/modularDrawer/utils/haveOneCommonProvider.js +0 -29
- package/lib/modularDrawer/utils/haveOneCommonProvider.js.map +0 -1
- package/lib/modularDrawer/utils/parseToBigNumber.d.ts +0 -9
- package/lib/modularDrawer/utils/parseToBigNumber.d.ts.map +0 -1
- package/lib/modularDrawer/utils/parseToBigNumber.js +0 -24
- package/lib/modularDrawer/utils/parseToBigNumber.js.map +0 -1
- package/lib-es/modularDrawer/data/entities/index.d.ts.map +0 -1
- package/lib-es/modularDrawer/data/entities/index.js.map +0 -1
- package/lib-es/modularDrawer/data/entities/interestRateSelectors.d.ts.map +0 -1
- package/lib-es/modularDrawer/data/entities/interestRateSelectors.js.map +0 -1
- package/lib-es/modularDrawer/data/entities/marketSelectors.d.ts.map +0 -1
- package/lib-es/modularDrawer/data/entities/marketSelectors.js.map +0 -1
- package/lib-es/modularDrawer/data/entities/selectorUtils.d.ts.map +0 -1
- package/lib-es/modularDrawer/data/entities/selectorUtils.js.map +0 -1
- package/lib-es/modularDrawer/data/state-manager/api.js.map +0 -1
- package/lib-es/modularDrawer/data/state-manager/types.d.ts.map +0 -1
- package/lib-es/modularDrawer/data/state-manager/types.js.map +0 -1
- package/lib-es/modularDrawer/hooks/__test__/useAssetsData.test.d.ts.map +0 -1
- package/lib-es/modularDrawer/hooks/__test__/useAssetsData.test.js.map +0 -1
- package/lib-es/modularDrawer/hooks/useAssetsData.d.ts +0 -19
- package/lib-es/modularDrawer/hooks/useAssetsData.d.ts.map +0 -1
- package/lib-es/modularDrawer/hooks/useAssetsData.js.map +0 -1
- package/lib-es/modularDrawer/hooks/useInterestRatesByCurrencies.d.ts.map +0 -1
- package/lib-es/modularDrawer/hooks/useInterestRatesByCurrencies.js.map +0 -1
- package/lib-es/modularDrawer/hooks/useMarketByCurrencies.d.ts.map +0 -1
- package/lib-es/modularDrawer/hooks/useMarketByCurrencies.js.map +0 -1
- package/lib-es/modularDrawer/utils/__tests__/counterValueFormatter.test.d.ts +0 -2
- package/lib-es/modularDrawer/utils/__tests__/counterValueFormatter.test.d.ts.map +0 -1
- package/lib-es/modularDrawer/utils/__tests__/counterValueFormatter.test.js +0 -494
- package/lib-es/modularDrawer/utils/__tests__/counterValueFormatter.test.js.map +0 -1
- package/lib-es/modularDrawer/utils/__tests__/haveOneCommonProvider.test.d.ts +0 -2
- package/lib-es/modularDrawer/utils/__tests__/haveOneCommonProvider.test.d.ts.map +0 -1
- package/lib-es/modularDrawer/utils/__tests__/haveOneCommonProvider.test.js +0 -26
- package/lib-es/modularDrawer/utils/__tests__/haveOneCommonProvider.test.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/counterValueFormatter.d.ts +0 -14
- package/lib-es/modularDrawer/utils/counterValueFormatter.d.ts.map +0 -1
- package/lib-es/modularDrawer/utils/counterValueFormatter.js +0 -103
- package/lib-es/modularDrawer/utils/counterValueFormatter.js.map +0 -1
- package/lib-es/modularDrawer/utils/getBalanceAndFiatValue.d.ts +0 -20
- package/lib-es/modularDrawer/utils/getBalanceAndFiatValue.d.ts.map +0 -1
- package/lib-es/modularDrawer/utils/getBalanceAndFiatValue.js +0 -32
- package/lib-es/modularDrawer/utils/getBalanceAndFiatValue.js.map +0 -1
- package/lib-es/modularDrawer/utils/getProviderCurrency.d.ts +0 -3
- package/lib-es/modularDrawer/utils/getProviderCurrency.d.ts.map +0 -1
- package/lib-es/modularDrawer/utils/getProviderCurrency.js +0 -10
- package/lib-es/modularDrawer/utils/getProviderCurrency.js.map +0 -1
- package/lib-es/modularDrawer/utils/haveOneCommonProvider.d.ts +0 -11
- package/lib-es/modularDrawer/utils/haveOneCommonProvider.d.ts.map +0 -1
- package/lib-es/modularDrawer/utils/haveOneCommonProvider.js +0 -25
- package/lib-es/modularDrawer/utils/haveOneCommonProvider.js.map +0 -1
- package/lib-es/modularDrawer/utils/parseToBigNumber.d.ts +0 -9
- package/lib-es/modularDrawer/utils/parseToBigNumber.d.ts.map +0 -1
- package/lib-es/modularDrawer/utils/parseToBigNumber.js +0 -17
- package/lib-es/modularDrawer/utils/parseToBigNumber.js.map +0 -1
- package/src/modularDrawer/utils/__tests__/counterValueFormatter.test.ts +0 -549
- package/src/modularDrawer/utils/__tests__/haveOneCommonProvider.test.ts +0 -34
- package/src/modularDrawer/utils/buildProviderCurrenciesMap.tsx +0 -25
- package/src/modularDrawer/utils/counterValueFormatter.ts +0 -165
- package/src/modularDrawer/utils/getBalanceAndFiatValue.ts +0 -53
- package/src/modularDrawer/utils/getProviderCurrency.ts +0 -13
- package/src/modularDrawer/utils/haveOneCommonProvider.ts +0 -31
- package/src/modularDrawer/utils/parseToBigNumber.ts +0 -17
- /package/lib/{modularDrawer/data → dada-client}/entities/index.d.ts +0 -0
- /package/lib/{modularDrawer/data → dada-client}/entities/index.js +0 -0
- /package/lib/{modularDrawer/data → dada-client}/entities/interestRateSelectors.js +0 -0
- /package/lib/{modularDrawer/data → dada-client}/entities/marketSelectors.js +0 -0
- /package/lib/{modularDrawer/data → dada-client}/entities/selectorUtils.d.ts +0 -0
- /package/lib/{modularDrawer/data → dada-client}/entities/selectorUtils.js +0 -0
- /package/lib/{modularDrawer/hooks/__test__ → dada-client/hooks/__tests__}/useAssetsData.test.d.ts +0 -0
- /package/lib/{modularDrawer → dada-client}/hooks/useInterestRatesByCurrencies.d.ts +0 -0
- /package/lib/{modularDrawer → dada-client}/hooks/useMarketByCurrencies.d.ts +0 -0
- /package/lib/{modularDrawer/data → dada-client}/state-manager/types.d.ts +0 -0
- /package/lib/{modularDrawer/data → dada-client}/state-manager/types.js +0 -0
- /package/lib-es/{modularDrawer/data → dada-client}/entities/index.d.ts +0 -0
- /package/lib-es/{modularDrawer/data → dada-client}/entities/index.js +0 -0
- /package/lib-es/{modularDrawer/data → dada-client}/entities/interestRateSelectors.js +0 -0
- /package/lib-es/{modularDrawer/data → dada-client}/entities/marketSelectors.js +0 -0
- /package/lib-es/{modularDrawer/data → dada-client}/entities/selectorUtils.d.ts +0 -0
- /package/lib-es/{modularDrawer/data → dada-client}/entities/selectorUtils.js +0 -0
- /package/lib-es/{modularDrawer/hooks/__test__ → dada-client/hooks/__tests__}/useAssetsData.test.d.ts +0 -0
- /package/lib-es/{modularDrawer → dada-client}/hooks/useInterestRatesByCurrencies.d.ts +0 -0
- /package/lib-es/{modularDrawer → dada-client}/hooks/useMarketByCurrencies.d.ts +0 -0
- /package/lib-es/{modularDrawer/data → dada-client}/state-manager/types.d.ts +0 -0
- /package/lib-es/{modularDrawer/data → dada-client}/state-manager/types.js +0 -0
- /package/src/{modularDrawer/data → dada-client}/entities/index.ts +0 -0
- /package/src/{modularDrawer/data → dada-client}/entities/selectorUtils.ts +0 -0
- /package/src/{modularDrawer/data → dada-client}/state-manager/types.ts +0 -0
@@ -1,5 +1,5 @@
|
|
1
1
|
import { encodeOperationId } from "@ledgerhq/coin-framework/operation";
|
2
|
-
import { Account, Operation, OperationType
|
2
|
+
import { Account, Operation, OperationType } from "@ledgerhq/types-live";
|
3
3
|
import BigNumber from "bignumber.js";
|
4
4
|
import { fromBigNumberToBigInt } from "@ledgerhq/coin-framework/utils";
|
5
5
|
import {
|
@@ -128,15 +128,18 @@ export function transactionToIntent(
|
|
128
128
|
data?: { type: string; value?: unknown };
|
129
129
|
} {
|
130
130
|
const intentType = (computeIntentType ?? defaultComputeIntentType)(transaction);
|
131
|
+
const isStaking = ["stake", "unstake"].includes(intentType);
|
132
|
+
const amount = isStaking ? 0n : fromBigNumberToBigInt(transaction.amount, 0n);
|
133
|
+
const useAllAmount = isStaking || !!transaction.useAllAmount;
|
131
134
|
const res: TransactionIntent & { memo?: { type: string; value?: string } } & {
|
132
135
|
data?: { type: string; value?: unknown };
|
133
136
|
} = {
|
134
137
|
type: intentType,
|
135
138
|
sender: account.freshAddress,
|
136
139
|
recipient: transaction.recipient,
|
137
|
-
amount
|
140
|
+
amount,
|
138
141
|
asset: { type: "native", name: account.currency.name, unit: account.currency.units[0] },
|
139
|
-
useAllAmount
|
142
|
+
useAllAmount,
|
140
143
|
feesStrategy:
|
141
144
|
transaction.feesStrategy === "custom" ? undefined : transaction.feesStrategy ?? undefined,
|
142
145
|
data: Buffer.isBuffer(transaction.data)
|
@@ -171,11 +174,27 @@ export function transactionToIntent(
|
|
171
174
|
|
172
175
|
export const buildOptimisticOperation = (
|
173
176
|
account: Account,
|
174
|
-
transaction:
|
177
|
+
transaction: GenericTransaction,
|
175
178
|
sequenceNumber?: number,
|
176
179
|
): Operation => {
|
177
|
-
|
178
|
-
|
180
|
+
let type: OperationType;
|
181
|
+
switch (transaction.mode) {
|
182
|
+
case "changeTrust":
|
183
|
+
type = "OPT_IN";
|
184
|
+
break;
|
185
|
+
case "delegate":
|
186
|
+
case "stake":
|
187
|
+
type = "DELEGATE";
|
188
|
+
break;
|
189
|
+
case "undelegate":
|
190
|
+
case "unstake":
|
191
|
+
type = "UNDELEGATE";
|
192
|
+
break;
|
193
|
+
default:
|
194
|
+
type = "OUT";
|
195
|
+
break;
|
196
|
+
}
|
197
|
+
const fees = BigInt(transaction.fees?.toString() || "0");
|
179
198
|
const { subAccountId } = transaction;
|
180
199
|
const { subAccounts } = account;
|
181
200
|
|
package/src/bridge/impl.ts
CHANGED
@@ -0,0 +1,93 @@
|
|
1
|
+
# DADA Client
|
2
|
+
|
3
|
+
**DADA** stands for **Dynamic Assets Data Aggregator** - a comprehensive data management system for crypto assets, market data, and interest rates.
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
The DADA client is included in `@ledgerhq/live-common`
|
8
|
+
|
9
|
+
## Usage Examples
|
10
|
+
|
11
|
+
### Mobile (React Native)
|
12
|
+
|
13
|
+
```typescript
|
14
|
+
import {
|
15
|
+
useAssetsData,
|
16
|
+
useInterestRatesByCurrencies,
|
17
|
+
} from "@ledgerhq/live-common/dada-client/hooks/useAssetsData";
|
18
|
+
import { ApyType } from "@ledgerhq/live-common/dada-client/types/trend";
|
19
|
+
|
20
|
+
// Fetch assets data
|
21
|
+
const { data, isLoading, error } = useAssetsData({
|
22
|
+
product: "llm",
|
23
|
+
version: "1.0.0",
|
24
|
+
search: "bitcoin",
|
25
|
+
});
|
26
|
+
|
27
|
+
// Get interest rates for currencies
|
28
|
+
const currencies = [bitcoinCurrency, ethereumCurrency];
|
29
|
+
const interestRates = useInterestRatesByCurrencies(currencies);
|
30
|
+
|
31
|
+
// Use APY data
|
32
|
+
const apyData = interestRates[bitcoinCurrency.id];
|
33
|
+
if (apyData) {
|
34
|
+
console.log(`Bitcoin APY: ${apyData.value}% (${apyData.type})`);
|
35
|
+
}
|
36
|
+
```
|
37
|
+
|
38
|
+
### Desktop (React)
|
39
|
+
|
40
|
+
```typescript
|
41
|
+
import { useAssetsData, useMarketByCurrencies } from '@ledgerhq/live-common/dada-client/hooks/useAssetsData';
|
42
|
+
import { assetsDataApi } from '@ledgerhq/live-common/dada-client/state-manager/api';
|
43
|
+
|
44
|
+
// Configure Redux store
|
45
|
+
const store = configureStore({
|
46
|
+
reducer: {
|
47
|
+
// ... other reducers
|
48
|
+
[assetsDataApi.reducerPath]: assetsDataApi.reducer,
|
49
|
+
},
|
50
|
+
middleware: (getDefaultMiddleware) =>
|
51
|
+
getDefaultMiddleware().concat(assetsDataApi.middleware),
|
52
|
+
});
|
53
|
+
|
54
|
+
// Use in components
|
55
|
+
const MarketComponent = () => {
|
56
|
+
const { data: assetsData, isLoading } = useAssetsData({
|
57
|
+
product: 'lld',
|
58
|
+
version: '2.0.0',
|
59
|
+
});
|
60
|
+
|
61
|
+
const marketData = useMarketByCurrencies(currencies);
|
62
|
+
|
63
|
+
return (
|
64
|
+
<div>
|
65
|
+
{isLoading ? (
|
66
|
+
<div>Loading market data...</div>
|
67
|
+
) : (
|
68
|
+
<div>
|
69
|
+
{Object.entries(marketData).map(([currencyId, data]) => (
|
70
|
+
<div key={currencyId}>
|
71
|
+
<span>{currencyId}: ${data.price}</span>
|
72
|
+
<span>Change: {data.priceChangePercentage24h}%</span>
|
73
|
+
</div>
|
74
|
+
))}
|
75
|
+
</div>
|
76
|
+
)}
|
77
|
+
</div>
|
78
|
+
);
|
79
|
+
};
|
80
|
+
```
|
81
|
+
|
82
|
+
## API Reference
|
83
|
+
|
84
|
+
### Hooks
|
85
|
+
|
86
|
+
- `useAssetsData()` - Fetch paginated assets data
|
87
|
+
- `useAssetData()` - Fetch specific asset data
|
88
|
+
- `useInterestRatesByCurrencies()` - Get interest rates for currencies
|
89
|
+
- `useMarketByCurrencies()` - Get market data for currencies
|
90
|
+
|
91
|
+
## Integration
|
92
|
+
|
93
|
+
For custom implementations, ensure you include the `assetsDataApi` reducer and middleware in your Redux store configuration.
|
package/src/{modularDrawer/hooks/__test__ → dada-client/hooks/__tests__}/useAssetsData.test.ts
RENAMED
@@ -4,9 +4,9 @@
|
|
4
4
|
|
5
5
|
import { renderHook } from "@testing-library/react";
|
6
6
|
import { useAssetsData } from "../useAssetsData";
|
7
|
-
import { useGetAssetsDataInfiniteQuery } from "../../
|
7
|
+
import { useGetAssetsDataInfiniteQuery } from "../../state-manager/api";
|
8
8
|
|
9
|
-
jest.mock("../../
|
9
|
+
jest.mock("../../state-manager/api", () => ({
|
10
10
|
useGetAssetsDataInfiniteQuery: jest.fn(),
|
11
11
|
}));
|
12
12
|
|
@@ -0,0 +1,22 @@
|
|
1
|
+
import { useGetAssetDataQuery } from "../state-manager/api";
|
2
|
+
import { GetAssetsDataParams } from "../state-manager/types";
|
3
|
+
|
4
|
+
export function useAssetData({ currencyIds, product, version, isStaging }: GetAssetsDataParams) {
|
5
|
+
const { data, isLoading, error, isSuccess, refetch, isFetching, isError } = useGetAssetDataQuery({
|
6
|
+
currencyIds,
|
7
|
+
product,
|
8
|
+
version,
|
9
|
+
isStaging,
|
10
|
+
});
|
11
|
+
|
12
|
+
const isInitialLoading = isLoading || isFetching;
|
13
|
+
|
14
|
+
return {
|
15
|
+
data,
|
16
|
+
isLoading: isInitialLoading,
|
17
|
+
error,
|
18
|
+
isSuccess,
|
19
|
+
isError,
|
20
|
+
refetch,
|
21
|
+
};
|
22
|
+
}
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { useMemo } from "react";
|
2
|
-
import { useGetAssetsDataInfiniteQuery } from "../
|
3
|
-
import { AssetsDataWithPagination } from "../
|
2
|
+
import { useGetAssetsDataInfiniteQuery } from "../state-manager/api";
|
3
|
+
import { AssetsDataWithPagination } from "../state-manager/types";
|
4
4
|
|
5
5
|
const emptyData = () => ({
|
6
6
|
cryptoAssets: {},
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import { useSelector } from "react-redux";
|
2
2
|
import { CryptoOrTokenCurrency } from "@ledgerhq/types-cryptoassets";
|
3
|
-
import { selectInterestRateByCurrency } from "../
|
4
|
-
import { ApyType } from "../
|
3
|
+
import { selectInterestRateByCurrency } from "../entities/interestRateSelectors";
|
4
|
+
import { ApyType } from "../types/trend";
|
5
5
|
|
6
6
|
const isValidApyType = (type: string): type is ApyType =>
|
7
7
|
type === "NRR" || type === "APY" || type === "APR";
|
@@ -9,7 +9,7 @@ const isValidApyType = (type: string): type is ApyType =>
|
|
9
9
|
export const useInterestRatesByCurrencies = (currencies: CryptoOrTokenCurrency[]) => {
|
10
10
|
return useSelector(state => {
|
11
11
|
const rates: Record<string, { value: number; type: ApyType } | undefined> = {};
|
12
|
-
|
12
|
+
for (const currency of currencies) {
|
13
13
|
const apiRate = selectInterestRateByCurrency(state, currency.id);
|
14
14
|
if (apiRate && isValidApyType(apiRate.type)) {
|
15
15
|
rates[currency.id] = {
|
@@ -17,7 +17,7 @@ export const useInterestRatesByCurrencies = (currencies: CryptoOrTokenCurrency[]
|
|
17
17
|
type: apiRate.type,
|
18
18
|
};
|
19
19
|
}
|
20
|
-
}
|
20
|
+
}
|
21
21
|
return rates;
|
22
22
|
});
|
23
23
|
};
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { useSelector } from "react-redux";
|
2
2
|
import { CryptoOrTokenCurrency } from "@ledgerhq/types-cryptoassets";
|
3
|
-
import { selectMarketByCurrency } from "../
|
3
|
+
import { selectMarketByCurrency } from "../entities/marketSelectors";
|
4
4
|
|
5
5
|
export const useMarketByCurrencies = (currencies: CryptoOrTokenCurrency[]) => {
|
6
6
|
return useSelector(state => {
|
@@ -8,12 +8,11 @@ export const useMarketByCurrencies = (currencies: CryptoOrTokenCurrency[]) => {
|
|
8
8
|
string,
|
9
9
|
{ price?: number; priceChangePercentage24h?: number }
|
10
10
|
> = {};
|
11
|
-
|
11
|
+
for (const currency of currencies) {
|
12
12
|
const currencyMarket = selectMarketByCurrency(state, currency.id);
|
13
13
|
if (
|
14
|
-
currencyMarket &&
|
15
|
-
currencyMarket
|
16
|
-
currencyMarket.priceChangePercentage24h !== undefined
|
14
|
+
currencyMarket?.price !== undefined &&
|
15
|
+
currencyMarket?.priceChangePercentage24h !== undefined
|
17
16
|
) {
|
18
17
|
marketByCurrencies[currency.id] = {
|
19
18
|
...(currencyMarket.price && { price: currencyMarket.price }),
|
@@ -23,7 +22,7 @@ export const useMarketByCurrencies = (currencies: CryptoOrTokenCurrency[]) => {
|
|
23
22
|
}),
|
24
23
|
};
|
25
24
|
}
|
26
|
-
}
|
25
|
+
}
|
27
26
|
return marketByCurrencies;
|
28
27
|
});
|
29
28
|
};
|
@@ -73,7 +73,28 @@ export const assetsDataApi = createApi({
|
|
73
73
|
},
|
74
74
|
},
|
75
75
|
}),
|
76
|
+
getAssetData: build.query<AssetsDataWithPagination, GetAssetsDataParams>({
|
77
|
+
query: queryArg => {
|
78
|
+
const params = {
|
79
|
+
pageSize: 1,
|
80
|
+
...(queryArg?.currencyIds &&
|
81
|
+
queryArg?.currencyIds.length > 0 && { currencyIds: queryArg.currencyIds }),
|
82
|
+
product: queryArg.product,
|
83
|
+
minVersion: queryArg.version,
|
84
|
+
additionalData: [AssetsAdditionalData.Apy, AssetsAdditionalData.MarketTrend],
|
85
|
+
};
|
86
|
+
|
87
|
+
const baseUrl = queryArg.isStaging ? getEnv("DADA_API_STAGING") : getEnv("DADA_API_PROD");
|
88
|
+
|
89
|
+
return {
|
90
|
+
url: `${baseUrl}assets`,
|
91
|
+
params,
|
92
|
+
};
|
93
|
+
},
|
94
|
+
providesTags: [AssetsDataTags.Assets],
|
95
|
+
transformResponse: transformAssetsResponse,
|
96
|
+
}),
|
76
97
|
}),
|
77
98
|
});
|
78
99
|
|
79
|
-
export const { useGetAssetsDataInfiniteQuery } = assetsDataApi;
|
100
|
+
export const { useGetAssetsDataInfiniteQuery, useGetAssetDataQuery } = assetsDataApi;
|
@@ -0,0 +1 @@
|
|
1
|
+
export type ApyType = "NRR" | "APY" | "APR";
|
@@ -3,6 +3,7 @@ import { CryptoOrTokenCurrency } from "@ledgerhq/types-cryptoassets";
|
|
3
3
|
import { useEffect, useMemo, useState } from "react";
|
4
4
|
import { isCurrencySupported, listSupportedCurrencies, listTokens } from "../currencies";
|
5
5
|
import { loadCurrenciesByProvider } from "./helper";
|
6
|
+
import { useCurrenciesUnderFeatureFlag } from "../modularDrawer/hooks/useCurrenciesUnderFeatureFlag";
|
6
7
|
|
7
8
|
// FIXME(LIVE-10505): bad performane & shared utility to move to coin-framework
|
8
9
|
const listSupportedTokens = () => listTokens().filter(t => isCurrencySupported(t.parentCurrency));
|
@@ -16,11 +17,16 @@ export const useGroupedCurrenciesByProvider = (
|
|
16
17
|
withLoading?: boolean,
|
17
18
|
): GroupedCurrencies | LoadingBasedGroupedCurrencies => {
|
18
19
|
const [result, setResult] = useState(initialResult);
|
20
|
+
// the import is from MAD but as this hook will be removed, it's fine to keep it here
|
21
|
+
const { deactivatedCurrencyIds } = useCurrenciesUnderFeatureFlag();
|
19
22
|
|
20
23
|
const [loadingStatus, setLoadingStatus] = useState<LoadingStatus>(LoadingStatus.Idle);
|
21
24
|
const coinsAndTokensSupported = useMemo(
|
22
|
-
() =>
|
23
|
-
|
25
|
+
() =>
|
26
|
+
(listSupportedCurrencies() as CryptoOrTokenCurrency[])
|
27
|
+
.concat(listSupportedTokens())
|
28
|
+
.filter(c => !deactivatedCurrencyIds.has(c.id)),
|
29
|
+
[deactivatedCurrencyIds],
|
24
30
|
);
|
25
31
|
|
26
32
|
// Get mapped assets filtered by supported & sorted currencies, grouped by provider id
|
package/src/e2e/enum/Account.ts
CHANGED
@@ -110,6 +110,12 @@ export class Account {
|
|
110
110
|
"0xa1baa625c5E6A9304cB7AcD86d2fee6B710eC3eB",
|
111
111
|
1,
|
112
112
|
);
|
113
|
+
static readonly BSC_POL = new Account(
|
114
|
+
Currency.BSC_POL,
|
115
|
+
"BNB Chain 1",
|
116
|
+
"0x4BE2E2B8872AA298D6d123b9211B53E41f611566",
|
117
|
+
0,
|
118
|
+
);
|
113
119
|
static readonly BSC_SHIBA = new Account(
|
114
120
|
Currency.BSC_SHIBA,
|
115
121
|
"BNB Chain 1",
|
@@ -242,6 +248,8 @@ export class Account {
|
|
242
248
|
undefined,
|
243
249
|
[Nft.ANTITUS, Nft.PODIUM, Nft.NY_LA_MUSE],
|
244
250
|
);
|
251
|
+
// don't use this account as a recipient, it's balance
|
252
|
+
// should stay close to null to allow for error message testing
|
245
253
|
static readonly ETH_2 = new Account(
|
246
254
|
Currency.ETH,
|
247
255
|
"Ethereum 2",
|
@@ -276,6 +284,8 @@ export class Account {
|
|
276
284
|
0,
|
277
285
|
);
|
278
286
|
|
287
|
+
static readonly HEDERA_1 = new Account(Currency.HBAR, "Hedera 1", "0.0.9374930", 0);
|
288
|
+
|
279
289
|
static readonly INJ_1 = new Account(
|
280
290
|
Currency.INJ,
|
281
291
|
"Injective 1",
|
package/src/e2e/enum/AppInfos.ts
CHANGED
package/src/e2e/enum/Currency.ts
CHANGED
@@ -27,6 +27,10 @@ export class Currency {
|
|
27
27
|
|
28
28
|
static readonly KAS = new Currency("Kaspa", "KAS", "kaspa", AppInfos.KASPA, [Network.KASPA]);
|
29
29
|
|
30
|
+
static readonly HBAR = new Currency("Hedera", "HBAR", "hedera", AppInfos.HEDERA, [
|
31
|
+
Network.HEDERA,
|
32
|
+
]);
|
33
|
+
|
30
34
|
static readonly tBTC = new Currency(
|
31
35
|
"Bitcoin Testnet",
|
32
36
|
"𝚝BTC",
|
@@ -152,6 +156,13 @@ export class Currency {
|
|
152
156
|
AppInfos.BNB_CHAIN,
|
153
157
|
[Network.BNB_CHAIN, Network.POLYGON],
|
154
158
|
);
|
159
|
+
static readonly BSC_POL = new Currency(
|
160
|
+
"Matic Token",
|
161
|
+
"MATIC",
|
162
|
+
"bsc/bep20/matic_token",
|
163
|
+
AppInfos.BNB_CHAIN,
|
164
|
+
[Network.BNB_CHAIN],
|
165
|
+
);
|
155
166
|
static readonly BSC_SHIBA = new Currency("Shiba Inu", "SHIB", "bsc", AppInfos.BNB_CHAIN, [
|
156
167
|
Network.BNB_CHAIN,
|
157
168
|
Network.ETHEREUM,
|
package/src/e2e/enum/Network.ts
CHANGED
package/src/e2e/enum/Provider.ts
CHANGED
@@ -20,6 +20,7 @@ export class Provider {
|
|
20
20
|
static readonly STADER_LABS = new Provider("stader-eth", "Stader Labs", false, true, true);
|
21
21
|
static readonly LIDO = new Provider("lido", "Lido", false, true, true);
|
22
22
|
static readonly TRANSAK = new Provider("transak", "Transak", false, true, true);
|
23
|
+
static readonly NEAR_INTENTS = new Provider("nearintents", "NEAR Intents", false, true, true);
|
23
24
|
|
24
25
|
static getNameByUiName(uiName: string): string {
|
25
26
|
const provider = Object.values(Provider).find(p => p.uiName === uiName);
|
package/src/e2e/speculos.ts
CHANGED
@@ -28,6 +28,7 @@ import { sendStellar } from "./families/stellar";
|
|
28
28
|
import { delegateCardano, sendCardano } from "./families/cardano";
|
29
29
|
import { sendXRP } from "./families/xrp";
|
30
30
|
import { delegateAptos, sendAptos } from "./families/aptos";
|
31
|
+
import { sendHedera } from "./families/hedera";
|
31
32
|
import { delegateNear } from "./families/near";
|
32
33
|
import { delegateCosmos, sendCosmos } from "./families/cosmos";
|
33
34
|
import { sendKaspa } from "./families/kaspa";
|
@@ -335,6 +336,14 @@ export const specs: Specs = {
|
|
335
336
|
},
|
336
337
|
dependency: "",
|
337
338
|
},
|
339
|
+
Hedera: {
|
340
|
+
currency: getCryptoCurrencyById("hedera"),
|
341
|
+
appQuery: {
|
342
|
+
model: getSpeculosModel(),
|
343
|
+
appName: "Hedera",
|
344
|
+
},
|
345
|
+
dependency: "",
|
346
|
+
},
|
338
347
|
};
|
339
348
|
|
340
349
|
export async function startSpeculos(
|
@@ -709,6 +718,9 @@ export async function signSendTransaction(tx: Transaction) {
|
|
709
718
|
case Currency.KAS:
|
710
719
|
await sendKaspa();
|
711
720
|
break;
|
721
|
+
case Currency.HBAR:
|
722
|
+
await sendHedera();
|
723
|
+
break;
|
712
724
|
default:
|
713
725
|
throw new Error(`Unsupported currency: ${currencyName.ticker}`);
|
714
726
|
}
|
package/src/e2e/swap.ts
CHANGED
@@ -30,16 +30,16 @@ export async function getMinimumSwapAmount(AccountFrom: Account, AccountTo: Acco
|
|
30
30
|
|
31
31
|
const minimumAmounts = data
|
32
32
|
.filter((item: any) => item.parameter?.minAmount !== undefined)
|
33
|
-
.map((item: any) => parseFloat(item.parameter.minAmount))
|
33
|
+
.map((item: any) => parseFloat(item.parameter.minAmount))
|
34
|
+
.filter((amount: number) => !isNaN(amount));
|
34
35
|
|
35
|
-
|
36
|
-
|
37
|
-
if (validMinimumAmounts.length === 0) {
|
36
|
+
if (minimumAmounts.length === 0) {
|
38
37
|
throw new Error("No valid minimum amounts returned from swap quote API.");
|
39
38
|
}
|
40
39
|
|
41
|
-
return Math.max(...
|
40
|
+
return Math.max(...minimumAmounts);
|
42
41
|
} catch (error) {
|
43
|
-
console.error(error);
|
42
|
+
console.error("Error fetching swap minimum amount:", error);
|
43
|
+
throw error;
|
44
44
|
}
|
45
45
|
}
|
@@ -1,3 +1,4 @@
|
|
1
|
+
import type { DeviceModelId } from "@ledgerhq/devices";
|
1
2
|
import { CryptoOrTokenCurrency } from "@ledgerhq/types-cryptoassets";
|
2
3
|
import type { Account, AccountLike, AccountRaw, AccountRawLike } from "@ledgerhq/types-live";
|
3
4
|
import type { ExchangeTypes, RateTypes } from "@ledgerhq/hw-app-exchange";
|
@@ -42,6 +43,7 @@ export type StartExchangeInput = {
|
|
42
43
|
|
43
44
|
interface CompleteExchangeInputCommon {
|
44
45
|
rateType?: RateTypes;
|
46
|
+
deviceModelId?: DeviceModelId;
|
45
47
|
deviceId?: string;
|
46
48
|
provider: string;
|
47
49
|
binaryPayload: string;
|
@@ -1,3 +1,4 @@
|
|
1
|
+
import type { Account } from "@ledgerhq/types-live";
|
1
2
|
import {
|
2
3
|
DisconnectedDeviceDuringOperation,
|
3
4
|
TransportStatusError,
|
@@ -13,12 +14,14 @@ import {
|
|
13
14
|
import { getDefaultAccountName } from "@ledgerhq/live-wallet/accountName";
|
14
15
|
import { log } from "@ledgerhq/logs";
|
15
16
|
import BigNumber from "bignumber.js";
|
17
|
+
import invariant from "invariant";
|
16
18
|
import { Observable } from "rxjs";
|
17
19
|
import { secp256k1 } from "@noble/curves/secp256k1";
|
18
20
|
import { getCurrencyExchangeConfig } from "../";
|
19
21
|
import { getAccountCurrency, getMainAccount } from "../../account";
|
20
22
|
import { getAccountBridge } from "../../bridge";
|
21
23
|
import { TransactionRefusedOnDevice } from "../../errors";
|
24
|
+
import { handleHederaTrustedFlow } from "../../families/hedera/exchange";
|
22
25
|
import { withDevicePromise } from "../../hw/deviceAccess";
|
23
26
|
import { delay } from "../../promise";
|
24
27
|
import { CompleteExchangeStep, convertTransportError } from "../error";
|
@@ -27,6 +30,7 @@ import { convertToAppExchangePartnerKey, getSwapProvider } from "../providers";
|
|
27
30
|
import { CEXProviderConfig } from "../providers/swap";
|
28
31
|
import { isAddressSanctioned } from "@ledgerhq/coin-framework/sanction/index";
|
29
32
|
import { AddressesSanctionedError } from "@ledgerhq/coin-framework/sanction/errors";
|
33
|
+
import { getCryptoCurrencyById } from "../../currencies";
|
30
34
|
|
31
35
|
const COMPLETE_EXCHANGE_LOG = "SWAP-CompleteExchange";
|
32
36
|
|
@@ -34,8 +38,16 @@ const completeExchange = (
|
|
34
38
|
input: CompleteExchangeInputSwap,
|
35
39
|
): Observable<CompleteExchangeRequestEvent> => {
|
36
40
|
let { transaction } = input; // TODO build a tx from the data
|
37
|
-
|
38
|
-
|
41
|
+
const {
|
42
|
+
deviceId,
|
43
|
+
deviceModelId,
|
44
|
+
exchange,
|
45
|
+
provider,
|
46
|
+
binaryPayload,
|
47
|
+
signature,
|
48
|
+
rateType,
|
49
|
+
exchangeType,
|
50
|
+
} = input;
|
39
51
|
|
40
52
|
const { fromAccount, fromParentAccount } = exchange;
|
41
53
|
const { toAccount, toParentAccount } = exchange;
|
@@ -152,6 +164,24 @@ const completeExchange = (
|
|
152
164
|
await exchange.checkTransactionSignature(goodSign);
|
153
165
|
if (unsubscribed) return;
|
154
166
|
|
167
|
+
// Hedera swap payload is filled with user account address,
|
168
|
+
// but the device app requires the related public key for verification.
|
169
|
+
// Since this key is stored on-chain, we use the TrustedService
|
170
|
+
// to fetch a signed descriptor linking the address to its public key.
|
171
|
+
const hederaCurrency = getCryptoCurrencyById("hedera");
|
172
|
+
let hederaAccount: Account | null = null;
|
173
|
+
if (payoutAccount.currency.family === hederaCurrency.family) {
|
174
|
+
hederaAccount = payoutAccount;
|
175
|
+
} else if (refundAccount.currency.family === hederaCurrency.family) {
|
176
|
+
hederaAccount = refundAccount;
|
177
|
+
}
|
178
|
+
|
179
|
+
if (hederaAccount) {
|
180
|
+
invariant(deviceModelId, "hedera: deviceModelId is not available");
|
181
|
+
await handleHederaTrustedFlow({ exchange, hederaAccount, deviceModelId });
|
182
|
+
if (unsubscribed) return;
|
183
|
+
}
|
184
|
+
|
155
185
|
const payoutAddressParameters = payoutAccountBridge.getSerializedAddressParameters(
|
156
186
|
payoutAccount,
|
157
187
|
mainPayoutCurrency.id,
|
@@ -59,6 +59,10 @@ const INCOMPATIBLE_NANO_S_CURRENCY_KEYS: Keys = {
|
|
59
59
|
title: "swap.incompatibility.cosmos_title",
|
60
60
|
description: "swap.incompatibility.cosmos_description",
|
61
61
|
},
|
62
|
+
hedera: {
|
63
|
+
title: "swap.incompatibility.hedera_title",
|
64
|
+
description: "swap.incompatibility.hedera_description",
|
65
|
+
},
|
62
66
|
osmo: {
|
63
67
|
title: "swap.incompatibility.osmo_title",
|
64
68
|
description: "swap.incompatibility.osmo_description",
|
@@ -71,6 +75,10 @@ const INCOMPATIBLE_NANO_S_CURRENCY_KEYS: Keys = {
|
|
71
75
|
title: "swap.incompatibility.sui_title",
|
72
76
|
description: "swap.incompatibility.sui_description",
|
73
77
|
},
|
78
|
+
kaspa: {
|
79
|
+
title: "swap.incompatibility.kaspa_title",
|
80
|
+
description: "swap.incompatibility.kaspa_description",
|
81
|
+
},
|
74
82
|
};
|
75
83
|
|
76
84
|
export const getIncompatibleCurrencyKeys = (exchange: ExchangeSwap) => {
|