@ledgerhq/live-common 34.50.0 → 34.51.0-nightly.1
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 +9 -7
- 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
@@ -3,6 +3,7 @@ import { createApi as createStellarApi } from "@ledgerhq/coin-stellar/api/index"
|
|
3
3
|
import { createApi as createCantonApi } from "@ledgerhq/coin-canton/api/index";
|
4
4
|
import { createApi as createTronApi } from "@ledgerhq/coin-tron/api/index";
|
5
5
|
import { createApi as createEvmApi } from "@ledgerhq/coin-evm/api/index";
|
6
|
+
import { createApi as createTezosApi } from "@ledgerhq/coin-tezos/api/index";
|
6
7
|
import { getCurrencyConfiguration } from "../../../config";
|
7
8
|
import { getNetworkAlpacaApi } from "./network/network-alpaca";
|
8
9
|
import { Api } from "@ledgerhq/coin-framework/api/types";
|
@@ -11,6 +12,7 @@ import { StellarCoinConfig } from "@ledgerhq/coin-stellar/config";
|
|
11
12
|
import { CantonCoinConfig } from "@ledgerhq/coin-canton/config";
|
12
13
|
import { TronCoinConfig } from "@ledgerhq/coin-tron/config";
|
13
14
|
import { EvmConfigInfo } from "@ledgerhq/coin-evm/config";
|
15
|
+
import { TezosCoinConfig } from "@ledgerhq/coin-tezos/config";
|
14
16
|
import { findCryptoCurrencyByNetwork } from "../utils";
|
15
17
|
|
16
18
|
export function getAlpacaApi(network: string, kind: string): Api<any> {
|
@@ -30,6 +32,8 @@ export function getAlpacaApi(network: string, kind: string): Api<any> {
|
|
30
32
|
getCurrencyConfiguration<EvmConfigInfo>(currency),
|
31
33
|
currency.id,
|
32
34
|
) as Api<any>;
|
35
|
+
case "tezos":
|
36
|
+
return createTezosApi(getCurrencyConfiguration<TezosCoinConfig>(currency)) as Api<any>;
|
33
37
|
}
|
34
38
|
}
|
35
39
|
return getNetworkAlpacaApi(network) satisfies Partial<Api<any>>;
|
@@ -55,47 +55,47 @@ function buildTokenAccount({
|
|
55
55
|
};
|
56
56
|
}
|
57
57
|
|
58
|
-
export function buildSubAccounts({
|
58
|
+
export async function buildSubAccounts({
|
59
59
|
currency,
|
60
60
|
accountId,
|
61
|
-
|
61
|
+
allTokenAssetsBalances,
|
62
62
|
syncConfig,
|
63
63
|
operations,
|
64
64
|
getTokenFromAsset,
|
65
65
|
}: {
|
66
66
|
currency: CryptoCurrency;
|
67
67
|
accountId: string;
|
68
|
-
|
68
|
+
allTokenAssetsBalances: Balance[];
|
69
69
|
syncConfig: SyncConfig;
|
70
70
|
operations: OperationCommon[];
|
71
|
-
getTokenFromAsset?: (asset: AssetInfo) => TokenCurrency | undefined
|
72
|
-
}): TokenAccount[]
|
71
|
+
getTokenFromAsset?: (asset: AssetInfo) => Promise<TokenCurrency | undefined>;
|
72
|
+
}): Promise<TokenAccount[]> {
|
73
73
|
const { blacklistedTokenIds = [] } = syncConfig;
|
74
74
|
const allTokens = listTokensForCryptoCurrency(currency);
|
75
|
+
const tokenAccounts: TokenAccount[] = [];
|
75
76
|
|
76
|
-
if (allTokens.length === 0 ||
|
77
|
-
return
|
77
|
+
if (allTokens.length === 0 || allTokenAssetsBalances.length === 0) {
|
78
|
+
return tokenAccounts;
|
78
79
|
}
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
op
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
});
|
80
|
+
|
81
|
+
for (const balance of allTokenAssetsBalances) {
|
82
|
+
const token = getTokenFromAsset && (await getTokenFromAsset(balance.asset));
|
83
|
+
// NOTE: for future tokens, will need to check over currencyName/standard(erc20,trc10,trc20, etc)/id
|
84
|
+
if (token && !blacklistedTokenIds.includes(token.id)) {
|
85
|
+
tokenAccounts.push(
|
86
|
+
buildTokenAccount({
|
87
|
+
parentAccountId: accountId,
|
88
|
+
assetBalance: balance,
|
89
|
+
token,
|
90
|
+
operations: operations.filter(
|
91
|
+
op =>
|
92
|
+
op.extra.assetReference === balance.asset?.["assetReference"] &&
|
93
|
+
op.extra.assetOwner === balance.asset?.["assetOwner"], // NOTE: we could narrow type
|
94
|
+
),
|
95
|
+
}),
|
96
|
+
);
|
97
|
+
}
|
98
|
+
}
|
99
|
+
|
100
100
|
return tokenAccounts;
|
101
101
|
}
|
@@ -30,6 +30,17 @@ export function createTransaction(account: Account | TokenAccount): GenericTrans
|
|
30
30
|
assetOwner: "",
|
31
31
|
networkInfo: null,
|
32
32
|
};
|
33
|
+
case "tezos":
|
34
|
+
// note: default transaction for tezos, mode will be set by UI (send, stake, unstake)
|
35
|
+
return {
|
36
|
+
family: currency.family,
|
37
|
+
amount: new BigNumber(0),
|
38
|
+
fees: null,
|
39
|
+
recipient: "",
|
40
|
+
useAllAmount: false,
|
41
|
+
mode: "send",
|
42
|
+
networkInfo: null,
|
43
|
+
};
|
33
44
|
case "evm": {
|
34
45
|
return {
|
35
46
|
mode: "send-eip1559",
|
@@ -1,5 +1,6 @@
|
|
1
1
|
import { encodeAccountId } from "@ledgerhq/coin-framework/account/index";
|
2
2
|
import { GetAccountShape, mergeOps } from "@ledgerhq/coin-framework/bridge/jsHelpers";
|
3
|
+
import { encodeOperationId } from "@ledgerhq/coin-framework/operation";
|
3
4
|
import BigNumber from "bignumber.js";
|
4
5
|
import { getAlpacaApi } from "./alpaca";
|
5
6
|
import { adaptCoreOperationToLiveOperation, extractBalance } from "./utils";
|
@@ -31,18 +32,25 @@ export function genericGetAccountShape(network: string, kind: string): GetAccoun
|
|
31
32
|
const balanceRes = await alpacaApi.getBalance(address);
|
32
33
|
const nativeAsset = extractBalance(balanceRes, "native");
|
33
34
|
|
34
|
-
const
|
35
|
-
.filter(b => b.asset.type !== "native")
|
36
|
-
.filter(b => alpacaApi.getTokenFromAsset && alpacaApi.getTokenFromAsset(b.asset));
|
35
|
+
const allTokenAssetsBalances = balanceRes.filter(b => b.asset.type !== "native");
|
37
36
|
const nativeBalance = BigInt(nativeAsset?.value ?? "0");
|
38
37
|
|
39
38
|
const spendableBalance = BigInt(nativeBalance - BigInt(nativeAsset?.locked ?? "0"));
|
40
39
|
|
41
|
-
|
40
|
+
// Normalize pre-alpaca operations to the new accountId to keep UI rendering consistent
|
41
|
+
const oldOps = ((initialAccount?.operations || []) as OperationCommon[]).map(op =>
|
42
|
+
op.accountId === accountId
|
43
|
+
? op
|
44
|
+
: { ...op, accountId, id: encodeOperationId(accountId, op.hash, op.type) },
|
45
|
+
);
|
42
46
|
const lastPagingToken = oldOps[0]?.extra?.pagingToken || "";
|
43
47
|
|
44
|
-
|
45
|
-
|
48
|
+
// Calculate minHeight for pagination
|
49
|
+
let minHeight: number = 0;
|
50
|
+
if (oldOps.length > 0 && initialAccount?.blockHeight !== 0) {
|
51
|
+
minHeight = (oldOps[0].blockHeight ?? 0) + 1;
|
52
|
+
}
|
53
|
+
const paginationParams: Pagination = { minHeight, order: "asc" };
|
46
54
|
if (lastPagingToken) {
|
47
55
|
paginationParams.lastPagingToken = lastPagingToken;
|
48
56
|
}
|
@@ -64,15 +72,14 @@ export function genericGetAccountShape(network: string, kind: string): GetAccoun
|
|
64
72
|
}
|
65
73
|
});
|
66
74
|
|
67
|
-
const subAccounts =
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
}) || [];
|
75
|
+
const subAccounts = await buildSubAccounts({
|
76
|
+
currency,
|
77
|
+
accountId,
|
78
|
+
allTokenAssetsBalances,
|
79
|
+
syncConfig,
|
80
|
+
operations: assetOperations,
|
81
|
+
getTokenFromAsset: alpacaApi.getTokenFromAsset,
|
82
|
+
});
|
76
83
|
|
77
84
|
const operations = mergedOps.map(op => {
|
78
85
|
const subOperations = inferSubOperations(op.hash, subAccounts);
|
@@ -13,7 +13,7 @@ export function genericGetTransactionStatus(
|
|
13
13
|
return async (account, transaction: GenericTransaction) => {
|
14
14
|
const alpacaApi = getAlpacaApi(account.currency.id, kind);
|
15
15
|
const draftTransaction = {
|
16
|
-
mode: transaction?.mode,
|
16
|
+
mode: transaction?.mode ?? "send",
|
17
17
|
recipient: transaction.recipient,
|
18
18
|
amount: transaction.amount ?? new BigNumber(0),
|
19
19
|
useAllAmount: !!transaction.useAllAmount,
|
@@ -26,15 +26,15 @@ export function genericPrepareTransaction(
|
|
26
26
|
kind,
|
27
27
|
): AccountBridge<GenericTransaction, Account>["prepareTransaction"] {
|
28
28
|
return async (account, transaction: GenericTransaction) => {
|
29
|
-
const { getAssetFromToken, computeIntentType, estimateFees } = getAlpacaApi(
|
29
|
+
const { getAssetFromToken, computeIntentType, estimateFees, validateIntent } = getAlpacaApi(
|
30
30
|
account.currency.id,
|
31
31
|
kind,
|
32
32
|
);
|
33
33
|
const { assetReference, assetOwner } = getAssetFromToken
|
34
34
|
? getAssetInfos(transaction, account.freshAddress, getAssetFromToken)
|
35
35
|
: assetInfosFallback(transaction);
|
36
|
-
|
37
|
-
let fees: BigNumber | bigint | null =
|
36
|
+
const customParametersFees = transaction.customFees?.parameters?.fees;
|
37
|
+
let fees: BigNumber | bigint | null = customParametersFees || null;
|
38
38
|
if (fees === null) {
|
39
39
|
fees = (
|
40
40
|
await estimateFees(
|
@@ -50,17 +50,59 @@ export function genericPrepareTransaction(
|
|
50
50
|
}
|
51
51
|
|
52
52
|
if (!bnEq(transaction.fees, new BigNumber(fees.toString()))) {
|
53
|
-
|
53
|
+
const next: GenericTransaction = {
|
54
54
|
...transaction,
|
55
55
|
fees: new BigNumber(fees.toString()),
|
56
56
|
assetReference,
|
57
57
|
assetOwner,
|
58
58
|
customFees: {
|
59
59
|
parameters: {
|
60
|
-
fees: new BigNumber(
|
60
|
+
fees: customParametersFees ? new BigNumber(customParametersFees.toString()) : undefined,
|
61
61
|
},
|
62
62
|
},
|
63
63
|
};
|
64
|
+
|
65
|
+
// propagate storageLimit fee parameter when present (ex: tezos)
|
66
|
+
const feeEstimation = await estimateFees(
|
67
|
+
transactionToIntent(
|
68
|
+
account,
|
69
|
+
{
|
70
|
+
...transaction,
|
71
|
+
},
|
72
|
+
computeIntentType,
|
73
|
+
),
|
74
|
+
);
|
75
|
+
const params = feeEstimation?.parameters;
|
76
|
+
if (params) {
|
77
|
+
const storageLimit = params["storageLimit"];
|
78
|
+
if (
|
79
|
+
storageLimit !== undefined &&
|
80
|
+
(typeof storageLimit === "bigint" ||
|
81
|
+
typeof storageLimit === "number" ||
|
82
|
+
typeof storageLimit === "string")
|
83
|
+
) {
|
84
|
+
next.storageLimit = new BigNumber(storageLimit.toString());
|
85
|
+
}
|
86
|
+
}
|
87
|
+
|
88
|
+
// align with stellar/xrp: when send max (or staking intents), reflect validated amount in UI
|
89
|
+
if (
|
90
|
+
transaction.useAllAmount ||
|
91
|
+
transaction["mode"] === "stake" ||
|
92
|
+
transaction["mode"] === "unstake"
|
93
|
+
) {
|
94
|
+
const { amount } = await validateIntent(
|
95
|
+
transactionToIntent(
|
96
|
+
account,
|
97
|
+
{
|
98
|
+
...transaction,
|
99
|
+
},
|
100
|
+
computeIntentType,
|
101
|
+
),
|
102
|
+
);
|
103
|
+
next.amount = new BigNumber(amount.toString());
|
104
|
+
}
|
105
|
+
return next;
|
64
106
|
}
|
65
107
|
|
66
108
|
return transaction;
|
@@ -1,12 +1,15 @@
|
|
1
1
|
import xrpGetAddress from "@ledgerhq/coin-xrp/signer/getAddress";
|
2
2
|
import stellarGetAddress from "@ledgerhq/coin-stellar/signer/getAddress";
|
3
3
|
import Stellar from "@ledgerhq/hw-app-str";
|
4
|
-
import { signTransaction, stellarSignTransaction } from "./signTransaction";
|
4
|
+
import { signTransaction, stellarSignTransaction, tezosSignTransaction } from "./signTransaction";
|
5
5
|
import { StrKey } from "@stellar/stellar-sdk";
|
6
6
|
import { CreateSigner, executeWithSigner } from "../../setup";
|
7
7
|
import Xrp from "@ledgerhq/hw-app-xrp";
|
8
8
|
import Transport from "@ledgerhq/hw-transport";
|
9
9
|
import { AlpacaSigner } from "./types";
|
10
|
+
import { DerivationType, LedgerSigner as TaquitoLedgerSigner } from "@taquito/ledger-signer";
|
11
|
+
import tezosGetAddress from "@ledgerhq/coin-tezos/signer/getAddress";
|
12
|
+
import Tezos from "@ledgerhq/hw-app-tezos";
|
10
13
|
|
11
14
|
const createSignerXrp: CreateSigner<Xrp> = (transport: Transport) => {
|
12
15
|
return new Xrp(transport);
|
@@ -37,6 +40,39 @@ const createSignerStellar: CreateSigner<Stellar> = (transport: Transport) => {
|
|
37
40
|
|
38
41
|
const signerContextStellar = executeWithSigner(createSignerStellar);
|
39
42
|
|
43
|
+
const createSignerTezos: CreateSigner<
|
44
|
+
Tezos & { createLedgerSigner: (path: string, prompt: boolean, derivationType: number) => any }
|
45
|
+
> = (transport: Transport) => {
|
46
|
+
const tezos = new Tezos(transport);
|
47
|
+
// align with genericSignOperation that calls signer.signTransaction
|
48
|
+
return Object.assign(tezos, {
|
49
|
+
async signTransaction(path: string, rawTxHex: string) {
|
50
|
+
const { signature } = await tezos.signOperation(path, rawTxHex, {});
|
51
|
+
return signature;
|
52
|
+
},
|
53
|
+
async getAddress(path: string, { verify }: { verify?: boolean } = {}) {
|
54
|
+
// Use Taquito LedgerSigner to retrieve base58 public key and matching pkh (like oldbridge)
|
55
|
+
const ledgerSigner = new TaquitoLedgerSigner(
|
56
|
+
transport,
|
57
|
+
path,
|
58
|
+
!!verify,
|
59
|
+
DerivationType.ED25519,
|
60
|
+
);
|
61
|
+
const address = await ledgerSigner.publicKeyHash();
|
62
|
+
const publicKey = await ledgerSigner.publicKey();
|
63
|
+
return { path, address, publicKey };
|
64
|
+
},
|
65
|
+
createLedgerSigner(path: string, prompt: boolean, derivationType: number) {
|
66
|
+
// Map 0 -> ED25519, 1 -> SECP256K1, 2 -> P256 by convention
|
67
|
+
let dt: DerivationType = DerivationType.ED25519;
|
68
|
+
if (derivationType === 1) dt = DerivationType.SECP256K1;
|
69
|
+
else if (derivationType === 2) dt = DerivationType.P256;
|
70
|
+
return new TaquitoLedgerSigner(transport, path, prompt, dt);
|
71
|
+
},
|
72
|
+
});
|
73
|
+
};
|
74
|
+
const signerContextTezos = executeWithSigner(createSignerTezos);
|
75
|
+
|
40
76
|
export function getSigner(network: string): AlpacaSigner {
|
41
77
|
switch (network) {
|
42
78
|
case "ripple":
|
@@ -54,6 +90,13 @@ export function getSigner(network: string): AlpacaSigner {
|
|
54
90
|
context: signerContextStellar,
|
55
91
|
};
|
56
92
|
}
|
93
|
+
case "tezos": {
|
94
|
+
return {
|
95
|
+
getAddress: tezosGetAddress(signerContextTezos),
|
96
|
+
signTransaction: tezosSignTransaction(executeWithSigner(createSignerTezos)),
|
97
|
+
context: signerContextTezos,
|
98
|
+
};
|
99
|
+
}
|
57
100
|
}
|
58
101
|
throw new Error(`signer for ${network} not implemented`);
|
59
102
|
}
|
@@ -1,5 +1,6 @@
|
|
1
1
|
import { SignerContext } from "@ledgerhq/coin-framework/signer";
|
2
2
|
import { StellarSigner } from "@ledgerhq/coin-stellar/types/signer";
|
3
|
+
import { TezosSigner } from "@ledgerhq/coin-tezos/types/signer";
|
3
4
|
import { LegacySigner, SignTransactionOptions } from "./types";
|
4
5
|
|
5
6
|
export const signTransaction = <Signer extends LegacySigner>(
|
@@ -23,3 +24,12 @@ export const stellarSignTransaction = (signerContext: SignerContext<StellarSigne
|
|
23
24
|
return signedTx.signature.toString("base64"); // It should return a Buffer
|
24
25
|
};
|
25
26
|
};
|
27
|
+
|
28
|
+
export const tezosSignTransaction = (signerContext: SignerContext<TezosSigner>) => {
|
29
|
+
return async (deviceId: string, { path, rawTxHex }: SignTransactionOptions) => {
|
30
|
+
const signed = await signerContext(deviceId, signer =>
|
31
|
+
signer.signOperation(path, rawTxHex, {}),
|
32
|
+
);
|
33
|
+
return signed.signature;
|
34
|
+
};
|
35
|
+
};
|
@@ -35,9 +35,23 @@ const dummyAccounts = [
|
|
35
35
|
freshAddress: "s123",
|
36
36
|
pendingOperations: [],
|
37
37
|
},
|
38
|
+
{
|
39
|
+
id: "js:2:tezos:t123",
|
40
|
+
type: "Account",
|
41
|
+
spendableBalance: new BigNumber(50000000),
|
42
|
+
balance: new BigNumber(60000000),
|
43
|
+
currency: {
|
44
|
+
id: "tezos",
|
45
|
+
family: "tezos",
|
46
|
+
name: "Tezos",
|
47
|
+
units: [{ name: "XTZ", magnitude: 6 }],
|
48
|
+
},
|
49
|
+
freshAddress: "t123",
|
50
|
+
pendingOperations: [],
|
51
|
+
},
|
38
52
|
] as unknown as Account[];
|
39
53
|
|
40
|
-
["xrp", "stellar"].forEach((currencyName, idx) => {
|
54
|
+
["xrp", "stellar", "tezos"].forEach((currencyName, idx) => {
|
41
55
|
describe(`genericEstimateMaxSpendable for ${currencyName}`, () => {
|
42
56
|
const dummyAccount = dummyAccounts[idx];
|
43
57
|
|
@@ -117,9 +117,11 @@ describe("genericGetAccountShape (stellar & xrp)", () => {
|
|
117
117
|
lastPagingToken: "pt1",
|
118
118
|
});
|
119
119
|
|
120
|
-
const assetsBalancePassed = buildSubAccountsMock.mock.calls[0][0].
|
121
|
-
expect(assetsBalancePassed).
|
122
|
-
|
120
|
+
const assetsBalancePassed = buildSubAccountsMock.mock.calls[0][0].allTokenAssetsBalances;
|
121
|
+
expect(assetsBalancePassed).toEqual([
|
122
|
+
{ asset: { symbol: "TOK1", type: "token" }, value: "42" },
|
123
|
+
{ asset: { symbol: "TOK_IGNORE", type: "token" }, value: "5" },
|
124
|
+
]);
|
123
125
|
|
124
126
|
const assetOpsPassed = buildSubAccountsMock.mock.calls[0][0].operations;
|
125
127
|
expect(assetOpsPassed).toHaveLength(1);
|
@@ -91,4 +91,82 @@ describe("genericPrepareTransaction", () => {
|
|
91
91
|
|
92
92
|
expect(result).toBe(baseTransaction); // still same reference
|
93
93
|
});
|
94
|
+
|
95
|
+
it("propagates storageLimit from second estimation", async () => {
|
96
|
+
const estimatedFee = new BigNumber(491);
|
97
|
+
|
98
|
+
const estimateFeesFirstCall = jest.fn().mockResolvedValue({
|
99
|
+
value: estimatedFee,
|
100
|
+
parameters: { storageLimit: 300 },
|
101
|
+
});
|
102
|
+
|
103
|
+
const estimateFeesSecondCall = jest.fn().mockResolvedValue({
|
104
|
+
value: estimatedFee,
|
105
|
+
parameters: { storageLimit: 0 },
|
106
|
+
});
|
107
|
+
|
108
|
+
(getAlpacaApi as jest.Mock).mockReturnValue({
|
109
|
+
estimateFees: jest
|
110
|
+
.fn()
|
111
|
+
.mockImplementationOnce(() => estimateFeesFirstCall())
|
112
|
+
.mockImplementationOnce(() => estimateFeesSecondCall()),
|
113
|
+
});
|
114
|
+
|
115
|
+
const txWithoutCustomFees = { ...baseTransaction, customFees: undefined };
|
116
|
+
const prepareTransaction = genericPrepareTransaction(network, kind);
|
117
|
+
const result = await prepareTransaction(account, txWithoutCustomFees);
|
118
|
+
|
119
|
+
expect(result).toEqual(
|
120
|
+
expect.objectContaining({
|
121
|
+
fees: estimatedFee,
|
122
|
+
storageLimit: new BigNumber(0),
|
123
|
+
customFees: {
|
124
|
+
parameters: {
|
125
|
+
fees: undefined,
|
126
|
+
},
|
127
|
+
},
|
128
|
+
}),
|
129
|
+
);
|
130
|
+
|
131
|
+
expect((getAlpacaApi as jest.Mock)().estimateFees).toHaveBeenCalledTimes(2);
|
132
|
+
});
|
133
|
+
|
134
|
+
it("propagates storageLimit showing new account scenario", async () => {
|
135
|
+
const estimatedFee = new BigNumber(491);
|
136
|
+
|
137
|
+
const estimateFeesFirstCall = jest.fn().mockResolvedValue({
|
138
|
+
value: estimatedFee,
|
139
|
+
parameters: { storageLimit: 300 },
|
140
|
+
});
|
141
|
+
|
142
|
+
const estimateFeesSecondCall = jest.fn().mockResolvedValue({
|
143
|
+
value: estimatedFee,
|
144
|
+
parameters: { storageLimit: 277 },
|
145
|
+
});
|
146
|
+
|
147
|
+
(getAlpacaApi as jest.Mock).mockReturnValue({
|
148
|
+
estimateFees: jest
|
149
|
+
.fn()
|
150
|
+
.mockImplementationOnce(() => estimateFeesFirstCall())
|
151
|
+
.mockImplementationOnce(() => estimateFeesSecondCall()),
|
152
|
+
});
|
153
|
+
|
154
|
+
const txWithoutCustomFees = { ...baseTransaction, customFees: undefined };
|
155
|
+
const prepareTransaction = genericPrepareTransaction(network, kind);
|
156
|
+
const result = await prepareTransaction(account, txWithoutCustomFees);
|
157
|
+
|
158
|
+
expect(result).toEqual(
|
159
|
+
expect.objectContaining({
|
160
|
+
fees: estimatedFee,
|
161
|
+
storageLimit: new BigNumber(277),
|
162
|
+
customFees: {
|
163
|
+
parameters: {
|
164
|
+
fees: undefined,
|
165
|
+
},
|
166
|
+
},
|
167
|
+
}),
|
168
|
+
);
|
169
|
+
|
170
|
+
expect((getAlpacaApi as jest.Mock)().estimateFees).toHaveBeenCalledTimes(2);
|
171
|
+
});
|
94
172
|
});
|
@@ -14,7 +14,7 @@ jest.mock("../utils", () => ({
|
|
14
14
|
transactionToIntent: jest.fn(),
|
15
15
|
}));
|
16
16
|
describe("genericSignOperation", () => {
|
17
|
-
const networks = ["xrp", "stellar"];
|
17
|
+
const networks = ["xrp", "stellar", "tezos"];
|
18
18
|
const kind = "local";
|
19
19
|
|
20
20
|
const mockSignerContext = jest.fn();
|
@@ -11,15 +11,23 @@ export type GenericTransaction = TransactionCommon & {
|
|
11
11
|
fees?: BigNumber | null;
|
12
12
|
storageLimit?: BigNumber | null;
|
13
13
|
customFees?: {
|
14
|
-
parameters: { fees?: BigNumber | null
|
14
|
+
parameters: { fees?: BigNumber | null };
|
15
15
|
};
|
16
16
|
tag?: number | null | undefined;
|
17
17
|
feeCustomUnit?: Unit | null | undefined;
|
18
18
|
memoType?: string | null;
|
19
19
|
memoValue?: string | null;
|
20
20
|
data?: Buffer;
|
21
|
+
mode?:
|
22
|
+
| "send"
|
23
|
+
| "changeTrust"
|
24
|
+
| "send-legacy"
|
25
|
+
| "send-eip1559"
|
26
|
+
| "delegate"
|
27
|
+
| "stake"
|
28
|
+
| "undelegate"
|
29
|
+
| "unstake";
|
21
30
|
type?: number;
|
22
|
-
mode?: "send" | "changeTrust" | "send-legacy" | "send-eip1559";
|
23
31
|
assetReference?: string;
|
24
32
|
assetOwner?: string;
|
25
33
|
networkInfo?: NetworkInfo | null;
|
@@ -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
|
|