@ledgerhq/live-common 34.54.0 → 34.55.0-nightly.20251210114107
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 +3 -0
- package/lib/__tests__/test-helpers/environment.js.map +1 -1
- package/lib/account/index.d.ts +1 -0
- package/lib/account/index.d.ts.map +1 -1
- package/lib/account/index.js +4 -1
- package/lib/account/index.js.map +1 -1
- package/lib/account/recentAddresses.d.ts +10 -0
- package/lib/account/recentAddresses.d.ts.map +1 -0
- package/lib/account/recentAddresses.js +60 -0
- package/lib/account/recentAddresses.js.map +1 -0
- package/lib/account/serialization.js +1 -1
- package/lib/account/serialization.js.map +1 -1
- package/lib/account/support.js +1 -1
- package/lib/account/support.js.map +1 -1
- package/lib/bridge/generic-alpaca/accountBridge.d.ts +1 -1
- package/lib/bridge/generic-alpaca/accountBridge.d.ts.map +1 -1
- package/lib/bridge/generic-alpaca/accountBridge.js +2 -1
- package/lib/bridge/generic-alpaca/accountBridge.js.map +1 -1
- package/lib/bridge/generic-alpaca/broadcast.d.ts.map +1 -1
- package/lib/bridge/generic-alpaca/broadcast.js +3 -3
- package/lib/bridge/generic-alpaca/broadcast.js.map +1 -1
- package/lib/bridge/generic-alpaca/currencyBridge.d.ts.map +1 -1
- package/lib/bridge/generic-alpaca/currencyBridge.js +3 -3
- package/lib/bridge/generic-alpaca/currencyBridge.js.map +1 -1
- package/lib/bridge/generic-alpaca/estimateMaxSpendable.d.ts.map +1 -1
- package/lib/bridge/generic-alpaca/estimateMaxSpendable.js +2 -1
- package/lib/bridge/generic-alpaca/estimateMaxSpendable.js.map +1 -1
- package/lib/bridge/generic-alpaca/getAccountShape.d.ts.map +1 -1
- package/lib/bridge/generic-alpaca/getAccountShape.js +24 -8
- package/lib/bridge/generic-alpaca/getAccountShape.js.map +1 -1
- package/lib/bridge/generic-alpaca/getTransactionStatus.d.ts.map +1 -1
- package/lib/bridge/generic-alpaca/getTransactionStatus.js +16 -1
- package/lib/bridge/generic-alpaca/getTransactionStatus.js.map +1 -1
- package/lib/bridge/generic-alpaca/postSync.d.ts +16 -0
- package/lib/bridge/generic-alpaca/postSync.d.ts.map +1 -0
- package/lib/bridge/generic-alpaca/postSync.js +44 -0
- package/lib/bridge/generic-alpaca/postSync.js.map +1 -0
- package/lib/bridge/generic-alpaca/prepareTransaction.d.ts.map +1 -1
- package/lib/bridge/generic-alpaca/prepareTransaction.js +45 -4
- package/lib/bridge/generic-alpaca/prepareTransaction.js.map +1 -1
- package/lib/bridge/generic-alpaca/signOperation.d.ts.map +1 -1
- package/lib/bridge/generic-alpaca/signOperation.js +18 -2
- package/lib/bridge/generic-alpaca/signOperation.js.map +1 -1
- package/lib/bridge/generic-alpaca/signer/Eth.d.ts +2 -0
- package/lib/bridge/generic-alpaca/signer/Eth.d.ts.map +1 -1
- package/lib/bridge/generic-alpaca/signer/Eth.js +8 -1
- package/lib/bridge/generic-alpaca/signer/Eth.js.map +1 -1
- package/lib/bridge/generic-alpaca/signer/index.d.ts.map +1 -1
- package/lib/bridge/generic-alpaca/signer/index.js +7 -0
- package/lib/bridge/generic-alpaca/signer/index.js.map +1 -1
- package/lib/bridge/generic-alpaca/types.d.ts +4 -0
- package/lib/bridge/generic-alpaca/types.d.ts.map +1 -1
- package/lib/bridge/generic-alpaca/utils.d.ts.map +1 -1
- package/lib/bridge/generic-alpaca/utils.js +12 -3
- package/lib/bridge/generic-alpaca/utils.js.map +1 -1
- package/lib/bridge/impl.d.ts.map +1 -1
- package/lib/bridge/impl.js +14 -3
- package/lib/bridge/impl.js.map +1 -1
- package/lib/bridge/react/BridgeSync.d.ts +1 -1
- package/lib/bridge/react/BridgeSync.d.ts.map +1 -1
- package/lib/bridge/react/BridgeSync.js.map +1 -1
- package/lib/currencies/helpers.d.ts +1 -0
- package/lib/currencies/helpers.d.ts.map +1 -1
- package/lib/currencies/helpers.js +7 -1
- package/lib/currencies/helpers.js.map +1 -1
- package/lib/deposit/api.js +2 -2
- package/lib/deposit/api.js.map +1 -1
- package/lib/domain/getTokensWithFunds.d.ts +7 -1
- package/lib/domain/getTokensWithFunds.d.ts.map +1 -1
- package/lib/domain/getTokensWithFunds.js +15 -4
- package/lib/domain/getTokensWithFunds.js.map +1 -1
- package/lib/domain/getTotalStakeableAssets.d.ts +10 -0
- package/lib/domain/getTotalStakeableAssets.d.ts.map +1 -0
- package/lib/domain/getTotalStakeableAssets.js +35 -0
- package/lib/domain/getTotalStakeableAssets.js.map +1 -0
- package/lib/e2e/data/deviceLabelsData.d.ts.map +1 -1
- package/lib/e2e/data/deviceLabelsData.js +1 -0
- package/lib/e2e/data/deviceLabelsData.js.map +1 -1
- package/lib/e2e/data/regexes.d.ts +2 -0
- package/lib/e2e/data/regexes.d.ts.map +1 -0
- package/lib/e2e/data/regexes.js +5 -0
- package/lib/e2e/data/regexes.js.map +1 -0
- package/lib/e2e/enum/Device.d.ts +1 -0
- package/lib/e2e/enum/Device.d.ts.map +1 -1
- package/lib/e2e/enum/Device.js +1 -0
- package/lib/e2e/enum/Device.js.map +1 -1
- package/lib/e2e/families/cardano.d.ts.map +1 -1
- package/lib/e2e/families/cardano.js +29 -14
- package/lib/e2e/families/cardano.js.map +1 -1
- package/lib/e2e/index.d.ts +35 -3
- package/lib/e2e/index.d.ts.map +1 -1
- package/lib/e2e/index.js +21 -1
- package/lib/e2e/index.js.map +1 -1
- package/lib/e2e/speculos.d.ts.map +1 -1
- package/lib/e2e/speculos.js +31 -4
- package/lib/e2e/speculos.js.map +1 -1
- package/lib/e2e/speculosAppVersion.d.ts.map +1 -1
- package/lib/e2e/speculosAppVersion.js +6 -2
- package/lib/e2e/speculosAppVersion.js.map +1 -1
- package/lib/e2e/swap.d.ts.map +1 -1
- package/lib/e2e/swap.js +7 -6
- package/lib/e2e/swap.js.map +1 -1
- package/lib/env.react.d.ts +1 -1
- package/lib/env.react.d.ts.map +1 -1
- package/lib/exchange/swap/api/v5/fetchCurrencyAll.js +2 -2
- package/lib/exchange/swap/api/v5/fetchCurrencyAll.js.map +1 -1
- package/lib/exchange/swap/api/v5/fetchCurrencyFrom.js +3 -3
- package/lib/exchange/swap/api/v5/fetchCurrencyFrom.js.map +1 -1
- package/lib/exchange/swap/api/v5/fetchCurrencyTo.js +2 -2
- package/lib/exchange/swap/api/v5/fetchCurrencyTo.js.map +1 -1
- package/lib/exchange/swap/api/v5/fetchRates.js +2 -2
- package/lib/exchange/swap/api/v5/fetchRates.js.map +1 -1
- package/lib/exchange/swap/getIncompatibleCurrencyKeys.d.ts.map +1 -1
- package/lib/exchange/swap/getIncompatibleCurrencyKeys.js +4 -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 +10 -6
- package/lib/exchange/swap/postSwapState.js.map +1 -1
- package/lib/exchange/swap/transactionStrategies.d.ts +3 -2
- package/lib/exchange/swap/transactionStrategies.d.ts.map +1 -1
- package/lib/exchange/swap/transactionStrategies.js +26 -7
- package/lib/exchange/swap/transactionStrategies.js.map +1 -1
- package/lib/exchange/swap/types.d.ts +3 -1
- package/lib/exchange/swap/types.d.ts.map +1 -1
- package/lib/families/bitcoin/bridge/api.js +2 -2
- package/lib/families/bitcoin/bridge/api.js.map +1 -1
- package/lib/families/bitcoin/walletApiAdapter.d.ts.map +1 -1
- package/lib/families/bitcoin/walletApiAdapter.js +3 -0
- package/lib/families/bitcoin/walletApiAdapter.js.map +1 -1
- package/lib/families/canton/config.d.ts.map +1 -1
- package/lib/families/canton/config.js +4 -4
- package/lib/families/canton/config.js.map +1 -1
- package/lib/families/canton/react.d.ts +2 -0
- package/lib/families/canton/react.d.ts.map +1 -1
- package/lib/families/canton/react.js +40 -1
- package/lib/families/canton/react.js.map +1 -1
- package/lib/families/celo/setup.d.ts.map +1 -1
- package/lib/families/celo/setup.js +11 -0
- package/lib/families/celo/setup.js.map +1 -1
- package/lib/families/evm/bridge/mock.d.ts +1 -0
- package/lib/families/evm/bridge/mock.d.ts.map +1 -1
- package/lib/families/evm/bridge/mock.js +12 -0
- package/lib/families/evm/bridge/mock.js.map +1 -1
- package/lib/families/evm/setup.d.ts +1 -4
- package/lib/families/evm/setup.d.ts.map +1 -1
- package/lib/families/evm/setup.js +1 -8
- package/lib/families/evm/setup.js.map +1 -1
- package/lib/families/evm/walletApiAdapter.d.ts +7 -0
- package/lib/families/evm/walletApiAdapter.d.ts.map +1 -1
- package/lib/families/evm/walletApiAdapter.js +36 -2
- package/lib/families/evm/walletApiAdapter.js.map +1 -1
- package/lib/families/hedera/react.d.ts +6 -0
- package/lib/families/hedera/react.d.ts.map +1 -0
- package/lib/families/hedera/react.js +50 -0
- package/lib/families/hedera/react.js.map +1 -0
- package/lib/families/polkadot/config.js +1 -1
- package/lib/families/polkadot/config.js.map +1 -1
- package/lib/families/stacks/constants.d.ts +1 -1
- package/lib/families/stacks/constants.d.ts.map +1 -1
- package/lib/families/stacks/constants.js +1 -1
- package/lib/families/stacks/constants.js.map +1 -1
- package/lib/featureFlags/FeatureToggle.d.ts +2 -2
- package/lib/featureFlags/FeatureToggle.d.ts.map +1 -1
- package/lib/featureFlags/FeatureToggle.js.map +1 -1
- package/lib/featureFlags/defaultFeatures.d.ts +2 -0
- package/lib/featureFlags/defaultFeatures.d.ts.map +1 -1
- package/lib/featureFlags/defaultFeatures.js +22 -1
- package/lib/featureFlags/defaultFeatures.js.map +1 -1
- package/lib/featureFlags/firebaseFeatureFlags.js +1 -1
- package/lib/featureFlags/firebaseFeatureFlags.js.map +1 -1
- package/lib/featureFlags/stakePrograms/index.js +4 -4
- package/lib/featureFlags/stakePrograms/index.js.map +1 -1
- package/lib/featureFlags/useFeature.d.ts +1 -1
- package/lib/featureFlags/useFeature.d.ts.map +1 -1
- package/lib/featureFlags/useHasOverriddenFeatureFlags.js +1 -1
- package/lib/featureFlags/useHasOverriddenFeatureFlags.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 +30 -32
- package/lib/generated/bridge/js.js.map +1 -1
- package/lib/generated/bridge/mock.d.ts +1 -0
- package/lib/generated/bridge/mock.d.ts.map +1 -1
- package/lib/helpers/cryptoIconSize.d.ts +3 -0
- package/lib/helpers/cryptoIconSize.d.ts.map +1 -0
- package/lib/helpers/cryptoIconSize.js +40 -0
- package/lib/helpers/cryptoIconSize.js.map +1 -0
- package/lib/helpers.d.ts +1 -0
- package/lib/helpers.d.ts.map +1 -1
- package/lib/helpers.js +15 -0
- package/lib/helpers.js.map +1 -1
- package/lib/hooks/useHtmlLinkSegments.d.ts +19 -0
- package/lib/hooks/useHtmlLinkSegments.d.ts.map +1 -0
- package/lib/hooks/useHtmlLinkSegments.js +128 -0
- package/lib/hooks/useHtmlLinkSegments.js.map +1 -0
- package/lib/hw/getAppAndVersion.d.ts +3 -1
- package/lib/hw/getAppAndVersion.d.ts.map +1 -1
- package/lib/hw/getAppAndVersion.js +2 -2
- package/lib/hw/getAppAndVersion.js.map +1 -1
- package/lib/hw/getBitcoinLikeInfo.js +1 -1
- package/lib/hw/getBitcoinLikeInfo.js.map +1 -1
- package/lib/hw/isFirmwareUpdateVersionSupported.d.ts +2 -2
- package/lib/hw/isFirmwareUpdateVersionSupported.d.ts.map +1 -1
- package/lib/hw/isFirmwareUpdateVersionSupported.js +20 -7
- package/lib/hw/isFirmwareUpdateVersionSupported.js.map +1 -1
- package/lib/load/speculos.d.ts.map +1 -1
- package/lib/load/speculos.js +1 -0
- package/lib/load/speculos.js.map +1 -1
- package/lib/market/api/index.d.ts.map +1 -1
- package/lib/market/api/index.js +7 -7
- package/lib/market/api/index.js.map +1 -1
- package/lib/market/utils/types.d.ts +5 -0
- package/lib/market/utils/types.d.ts.map +1 -1
- package/lib/market/utils/types.js.map +1 -1
- package/lib/mock/account.js +1 -1
- package/lib/mock/account.js.map +1 -1
- package/lib/modularDrawer/hooks/useCurrenciesUnderFeatureFlag.d.ts.map +1 -1
- package/lib/modularDrawer/hooks/useCurrenciesUnderFeatureFlag.js +6 -0
- package/lib/modularDrawer/hooks/useCurrenciesUnderFeatureFlag.js.map +1 -1
- package/lib/notifications/AnnouncementProvider/api/api.js +2 -2
- package/lib/notifications/AnnouncementProvider/api/api.js.map +1 -1
- package/lib/notifications/ServiceStatusProvider/api/api.js +2 -2
- package/lib/notifications/ServiceStatusProvider/api/api.js.map +1 -1
- package/lib/operation.d.ts.map +1 -1
- package/lib/operation.js +7 -2
- package/lib/operation.js.map +1 -1
- package/lib/platform/providers/RampCatalogProvider/api/index.js +2 -2
- package/lib/platform/providers/RampCatalogProvider/api/index.js.map +1 -1
- package/lib/platform/providers/RampCatalogProvider/index.d.ts +1 -1
- package/lib/platform/providers/RampCatalogProvider/index.d.ts.map +1 -1
- package/lib/platform/providers/RemoteLiveAppProvider/index.d.ts +1 -1
- package/lib/platform/providers/RemoteLiveAppProvider/index.d.ts.map +1 -1
- package/lib/postOnboarding/reducer.d.ts +2 -0
- package/lib/postOnboarding/reducer.d.ts.map +1 -1
- package/lib/wallet-api/Exchange/SwapError.d.ts +93 -0
- package/lib/wallet-api/Exchange/SwapError.d.ts.map +1 -0
- package/lib/wallet-api/Exchange/SwapError.js +142 -0
- package/lib/wallet-api/Exchange/SwapError.js.map +1 -0
- package/lib/wallet-api/Exchange/handleSwapErrors.d.ts +40 -0
- package/lib/wallet-api/Exchange/handleSwapErrors.d.ts.map +1 -0
- package/lib/wallet-api/Exchange/handleSwapErrors.js +112 -0
- package/lib/wallet-api/Exchange/handleSwapErrors.js.map +1 -0
- package/lib/wallet-api/Exchange/index.d.ts +4 -0
- package/lib/wallet-api/Exchange/index.d.ts.map +1 -0
- package/lib/wallet-api/Exchange/index.js +27 -0
- package/lib/wallet-api/Exchange/index.js.map +1 -0
- package/lib/wallet-api/Exchange/parser.d.ts +46 -0
- package/lib/wallet-api/Exchange/parser.d.ts.map +1 -0
- package/lib/wallet-api/Exchange/parser.js +97 -0
- package/lib/wallet-api/Exchange/parser.js.map +1 -0
- package/lib/wallet-api/Exchange/server.d.ts.map +1 -1
- package/lib/wallet-api/Exchange/server.js +227 -174
- package/lib/wallet-api/Exchange/server.js.map +1 -1
- package/lib/wallet-api/Exchange/tracking.d.ts +7 -6
- package/lib/wallet-api/Exchange/tracking.d.ts.map +1 -1
- package/lib/wallet-api/Exchange/tracking.js +52 -13
- package/lib/wallet-api/Exchange/tracking.js.map +1 -1
- package/lib/wallet-api/LocalLiveAppProvider/index.d.ts +1 -1
- package/lib/wallet-api/LocalLiveAppProvider/index.d.ts.map +1 -1
- package/lib/wallet-api/constants.d.ts +1 -1
- package/lib/wallet-api/logic.d.ts +1 -1
- package/lib/wallet-api/logic.d.ts.map +1 -1
- package/lib/wallet-api/logic.js +5 -5
- package/lib/wallet-api/logic.js.map +1 -1
- package/lib/wallet-api/react.d.ts.map +1 -1
- package/lib/wallet-api/react.js +9 -6
- package/lib/wallet-api/react.js.map +1 -1
- package/lib/wallet-api/tracking.d.ts +5 -5
- package/lib/wallet-api/tracking.d.ts.map +1 -1
- package/lib/wallet-api/tracking.js +30 -10
- package/lib/wallet-api/tracking.js.map +1 -1
- package/lib/wallet-api/useDappLogic.d.ts.map +1 -1
- package/lib/wallet-api/useDappLogic.js +31 -20
- package/lib/wallet-api/useDappLogic.js.map +1 -1
- package/lib/wallet-api/utils/extractDappURLFromManifest.js +3 -3
- package/lib/wallet-api/utils/extractDappURLFromManifest.js.map +1 -1
- package/lib/wallet-api/utils/extractURLFromManifest.js +1 -1
- package/lib/wallet-api/utils/extractURLFromManifest.js.map +1 -1
- package/lib/walletSync/getEnvironmentParams.js +6 -6
- package/lib/walletSync/getEnvironmentParams.js.map +1 -1
- package/lib-es/__tests__/test-helpers/bridge.js +1 -1
- package/lib-es/__tests__/test-helpers/bridge.js.map +1 -1
- package/lib-es/__tests__/test-helpers/environment.js +3 -0
- package/lib-es/__tests__/test-helpers/environment.js.map +1 -1
- package/lib-es/account/index.d.ts +1 -0
- package/lib-es/account/index.d.ts.map +1 -1
- package/lib-es/account/index.js +1 -0
- package/lib-es/account/index.js.map +1 -1
- package/lib-es/account/recentAddresses.d.ts +10 -0
- package/lib-es/account/recentAddresses.d.ts.map +1 -0
- package/lib-es/account/recentAddresses.js +55 -0
- package/lib-es/account/recentAddresses.js.map +1 -0
- package/lib-es/account/serialization.js +1 -1
- package/lib-es/account/serialization.js.map +1 -1
- package/lib-es/account/support.js +1 -1
- package/lib-es/account/support.js.map +1 -1
- package/lib-es/bridge/generic-alpaca/accountBridge.d.ts +1 -1
- package/lib-es/bridge/generic-alpaca/accountBridge.d.ts.map +1 -1
- package/lib-es/bridge/generic-alpaca/accountBridge.js +2 -1
- package/lib-es/bridge/generic-alpaca/accountBridge.js.map +1 -1
- package/lib-es/bridge/generic-alpaca/broadcast.d.ts.map +1 -1
- package/lib-es/bridge/generic-alpaca/broadcast.js +3 -3
- package/lib-es/bridge/generic-alpaca/broadcast.js.map +1 -1
- package/lib-es/bridge/generic-alpaca/currencyBridge.d.ts.map +1 -1
- package/lib-es/bridge/generic-alpaca/currencyBridge.js +3 -3
- package/lib-es/bridge/generic-alpaca/currencyBridge.js.map +1 -1
- package/lib-es/bridge/generic-alpaca/estimateMaxSpendable.d.ts.map +1 -1
- package/lib-es/bridge/generic-alpaca/estimateMaxSpendable.js +2 -1
- package/lib-es/bridge/generic-alpaca/estimateMaxSpendable.js.map +1 -1
- package/lib-es/bridge/generic-alpaca/getAccountShape.d.ts.map +1 -1
- package/lib-es/bridge/generic-alpaca/getAccountShape.js +24 -8
- package/lib-es/bridge/generic-alpaca/getAccountShape.js.map +1 -1
- package/lib-es/bridge/generic-alpaca/getTransactionStatus.d.ts.map +1 -1
- package/lib-es/bridge/generic-alpaca/getTransactionStatus.js +16 -1
- package/lib-es/bridge/generic-alpaca/getTransactionStatus.js.map +1 -1
- package/lib-es/bridge/generic-alpaca/postSync.d.ts +16 -0
- package/lib-es/bridge/generic-alpaca/postSync.d.ts.map +1 -0
- package/lib-es/bridge/generic-alpaca/postSync.js +37 -0
- package/lib-es/bridge/generic-alpaca/postSync.js.map +1 -0
- package/lib-es/bridge/generic-alpaca/prepareTransaction.d.ts.map +1 -1
- package/lib-es/bridge/generic-alpaca/prepareTransaction.js +45 -4
- package/lib-es/bridge/generic-alpaca/prepareTransaction.js.map +1 -1
- package/lib-es/bridge/generic-alpaca/signOperation.d.ts.map +1 -1
- package/lib-es/bridge/generic-alpaca/signOperation.js +18 -2
- package/lib-es/bridge/generic-alpaca/signOperation.js.map +1 -1
- package/lib-es/bridge/generic-alpaca/signer/Eth.d.ts +2 -0
- package/lib-es/bridge/generic-alpaca/signer/Eth.d.ts.map +1 -1
- package/lib-es/bridge/generic-alpaca/signer/Eth.js +4 -0
- package/lib-es/bridge/generic-alpaca/signer/Eth.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 +7 -0
- package/lib-es/bridge/generic-alpaca/signer/index.js.map +1 -1
- package/lib-es/bridge/generic-alpaca/types.d.ts +4 -0
- package/lib-es/bridge/generic-alpaca/types.d.ts.map +1 -1
- package/lib-es/bridge/generic-alpaca/utils.d.ts.map +1 -1
- package/lib-es/bridge/generic-alpaca/utils.js +12 -3
- 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 +14 -3
- package/lib-es/bridge/impl.js.map +1 -1
- package/lib-es/bridge/react/BridgeSync.d.ts +1 -1
- package/lib-es/bridge/react/BridgeSync.d.ts.map +1 -1
- package/lib-es/bridge/react/BridgeSync.js.map +1 -1
- package/lib-es/currencies/helpers.d.ts +1 -0
- package/lib-es/currencies/helpers.d.ts.map +1 -1
- package/lib-es/currencies/helpers.js +5 -0
- package/lib-es/currencies/helpers.js.map +1 -1
- package/lib-es/deposit/api.js +1 -1
- package/lib-es/deposit/api.js.map +1 -1
- package/lib-es/domain/getTokensWithFunds.d.ts +7 -1
- package/lib-es/domain/getTokensWithFunds.d.ts.map +1 -1
- package/lib-es/domain/getTokensWithFunds.js +13 -3
- package/lib-es/domain/getTokensWithFunds.js.map +1 -1
- package/lib-es/domain/getTotalStakeableAssets.d.ts +10 -0
- package/lib-es/domain/getTotalStakeableAssets.d.ts.map +1 -0
- package/lib-es/domain/getTotalStakeableAssets.js +31 -0
- package/lib-es/domain/getTotalStakeableAssets.js.map +1 -0
- package/lib-es/e2e/data/deviceLabelsData.d.ts.map +1 -1
- package/lib-es/e2e/data/deviceLabelsData.js +1 -0
- package/lib-es/e2e/data/deviceLabelsData.js.map +1 -1
- package/lib-es/e2e/data/regexes.d.ts +2 -0
- package/lib-es/e2e/data/regexes.d.ts.map +1 -0
- package/lib-es/e2e/data/regexes.js +2 -0
- package/lib-es/e2e/data/regexes.js.map +1 -0
- package/lib-es/e2e/enum/Device.d.ts +1 -0
- package/lib-es/e2e/enum/Device.d.ts.map +1 -1
- package/lib-es/e2e/enum/Device.js +1 -0
- package/lib-es/e2e/enum/Device.js.map +1 -1
- package/lib-es/e2e/families/cardano.d.ts.map +1 -1
- package/lib-es/e2e/families/cardano.js +29 -14
- package/lib-es/e2e/families/cardano.js.map +1 -1
- package/lib-es/e2e/index.d.ts +35 -3
- package/lib-es/e2e/index.d.ts.map +1 -1
- package/lib-es/e2e/index.js +16 -0
- package/lib-es/e2e/index.js.map +1 -1
- package/lib-es/e2e/speculos.d.ts.map +1 -1
- package/lib-es/e2e/speculos.js +31 -4
- package/lib-es/e2e/speculos.js.map +1 -1
- package/lib-es/e2e/speculosAppVersion.d.ts.map +1 -1
- package/lib-es/e2e/speculosAppVersion.js +6 -2
- package/lib-es/e2e/speculosAppVersion.js.map +1 -1
- package/lib-es/e2e/swap.d.ts.map +1 -1
- package/lib-es/e2e/swap.js +7 -6
- package/lib-es/e2e/swap.js.map +1 -1
- package/lib-es/env.react.d.ts +1 -1
- package/lib-es/env.react.d.ts.map +1 -1
- package/lib-es/exchange/swap/api/v5/fetchCurrencyAll.js +1 -1
- package/lib-es/exchange/swap/api/v5/fetchCurrencyAll.js.map +1 -1
- package/lib-es/exchange/swap/api/v5/fetchCurrencyFrom.js +2 -2
- package/lib-es/exchange/swap/api/v5/fetchCurrencyFrom.js.map +1 -1
- package/lib-es/exchange/swap/api/v5/fetchCurrencyTo.js +1 -1
- package/lib-es/exchange/swap/api/v5/fetchCurrencyTo.js.map +1 -1
- package/lib-es/exchange/swap/api/v5/fetchRates.js +1 -1
- package/lib-es/exchange/swap/api/v5/fetchRates.js.map +1 -1
- package/lib-es/exchange/swap/getIncompatibleCurrencyKeys.d.ts.map +1 -1
- package/lib-es/exchange/swap/getIncompatibleCurrencyKeys.js +4 -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 +10 -6
- package/lib-es/exchange/swap/postSwapState.js.map +1 -1
- package/lib-es/exchange/swap/transactionStrategies.d.ts +3 -2
- package/lib-es/exchange/swap/transactionStrategies.d.ts.map +1 -1
- package/lib-es/exchange/swap/transactionStrategies.js +26 -7
- package/lib-es/exchange/swap/transactionStrategies.js.map +1 -1
- package/lib-es/exchange/swap/types.d.ts +3 -1
- package/lib-es/exchange/swap/types.d.ts.map +1 -1
- package/lib-es/families/bitcoin/bridge/api.js +1 -1
- package/lib-es/families/bitcoin/bridge/api.js.map +1 -1
- package/lib-es/families/bitcoin/walletApiAdapter.d.ts.map +1 -1
- package/lib-es/families/bitcoin/walletApiAdapter.js +3 -0
- package/lib-es/families/bitcoin/walletApiAdapter.js.map +1 -1
- package/lib-es/families/canton/config.d.ts.map +1 -1
- package/lib-es/families/canton/config.js +4 -4
- package/lib-es/families/canton/config.js.map +1 -1
- package/lib-es/families/canton/react.d.ts +2 -0
- package/lib-es/families/canton/react.d.ts.map +1 -1
- package/lib-es/families/canton/react.js +38 -1
- package/lib-es/families/canton/react.js.map +1 -1
- package/lib-es/families/celo/setup.d.ts.map +1 -1
- package/lib-es/families/celo/setup.js +11 -0
- package/lib-es/families/celo/setup.js.map +1 -1
- package/lib-es/families/evm/bridge/mock.d.ts +1 -0
- package/lib-es/families/evm/bridge/mock.d.ts.map +1 -1
- package/lib-es/families/evm/bridge/mock.js +12 -0
- package/lib-es/families/evm/bridge/mock.js.map +1 -1
- package/lib-es/families/evm/setup.d.ts +1 -4
- package/lib-es/families/evm/setup.d.ts.map +1 -1
- package/lib-es/families/evm/setup.js +2 -8
- package/lib-es/families/evm/setup.js.map +1 -1
- package/lib-es/families/evm/walletApiAdapter.d.ts +7 -0
- package/lib-es/families/evm/walletApiAdapter.d.ts.map +1 -1
- package/lib-es/families/evm/walletApiAdapter.js +30 -1
- package/lib-es/families/evm/walletApiAdapter.js.map +1 -1
- package/lib-es/families/hedera/react.d.ts +6 -0
- package/lib-es/families/hedera/react.d.ts.map +1 -0
- package/lib-es/families/hedera/react.js +41 -0
- package/lib-es/families/hedera/react.js.map +1 -0
- package/lib-es/families/polkadot/config.js +1 -1
- package/lib-es/families/polkadot/config.js.map +1 -1
- package/lib-es/families/stacks/constants.d.ts +1 -1
- package/lib-es/families/stacks/constants.d.ts.map +1 -1
- package/lib-es/families/stacks/constants.js +1 -1
- package/lib-es/families/stacks/constants.js.map +1 -1
- package/lib-es/featureFlags/FeatureToggle.d.ts +2 -2
- package/lib-es/featureFlags/FeatureToggle.d.ts.map +1 -1
- package/lib-es/featureFlags/FeatureToggle.js.map +1 -1
- package/lib-es/featureFlags/defaultFeatures.d.ts +2 -0
- package/lib-es/featureFlags/defaultFeatures.d.ts.map +1 -1
- package/lib-es/featureFlags/defaultFeatures.js +22 -1
- package/lib-es/featureFlags/defaultFeatures.js.map +1 -1
- package/lib-es/featureFlags/firebaseFeatureFlags.js +1 -1
- package/lib-es/featureFlags/firebaseFeatureFlags.js.map +1 -1
- package/lib-es/featureFlags/stakePrograms/index.js +4 -4
- package/lib-es/featureFlags/stakePrograms/index.js.map +1 -1
- package/lib-es/featureFlags/useFeature.d.ts +1 -1
- package/lib-es/featureFlags/useFeature.d.ts.map +1 -1
- package/lib-es/featureFlags/useHasOverriddenFeatureFlags.js +1 -1
- package/lib-es/featureFlags/useHasOverriddenFeatureFlags.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/generated/bridge/mock.d.ts +1 -0
- package/lib-es/generated/bridge/mock.d.ts.map +1 -1
- package/lib-es/helpers/cryptoIconSize.d.ts +3 -0
- package/lib-es/helpers/cryptoIconSize.d.ts.map +1 -0
- package/lib-es/helpers/cryptoIconSize.js +35 -0
- package/lib-es/helpers/cryptoIconSize.js.map +1 -0
- package/lib-es/helpers.d.ts +1 -0
- package/lib-es/helpers.d.ts.map +1 -1
- package/lib-es/helpers.js +1 -0
- package/lib-es/helpers.js.map +1 -1
- package/lib-es/hooks/useHtmlLinkSegments.d.ts +19 -0
- package/lib-es/hooks/useHtmlLinkSegments.d.ts.map +1 -0
- package/lib-es/hooks/useHtmlLinkSegments.js +121 -0
- package/lib-es/hooks/useHtmlLinkSegments.js.map +1 -0
- package/lib-es/hw/getAppAndVersion.d.ts +3 -1
- package/lib-es/hw/getAppAndVersion.d.ts.map +1 -1
- package/lib-es/hw/getAppAndVersion.js +2 -2
- package/lib-es/hw/getAppAndVersion.js.map +1 -1
- package/lib-es/hw/getBitcoinLikeInfo.js +1 -1
- package/lib-es/hw/getBitcoinLikeInfo.js.map +1 -1
- package/lib-es/hw/isFirmwareUpdateVersionSupported.d.ts +2 -2
- package/lib-es/hw/isFirmwareUpdateVersionSupported.d.ts.map +1 -1
- package/lib-es/hw/isFirmwareUpdateVersionSupported.js +17 -7
- package/lib-es/hw/isFirmwareUpdateVersionSupported.js.map +1 -1
- package/lib-es/load/speculos.d.ts.map +1 -1
- package/lib-es/load/speculos.js +1 -0
- package/lib-es/load/speculos.js.map +1 -1
- package/lib-es/market/api/index.d.ts.map +1 -1
- package/lib-es/market/api/index.js +1 -1
- package/lib-es/market/api/index.js.map +1 -1
- package/lib-es/market/utils/types.d.ts +5 -0
- package/lib-es/market/utils/types.d.ts.map +1 -1
- package/lib-es/market/utils/types.js.map +1 -1
- package/lib-es/mock/account.js +1 -1
- package/lib-es/mock/account.js.map +1 -1
- package/lib-es/modularDrawer/hooks/useCurrenciesUnderFeatureFlag.d.ts.map +1 -1
- package/lib-es/modularDrawer/hooks/useCurrenciesUnderFeatureFlag.js +6 -0
- package/lib-es/modularDrawer/hooks/useCurrenciesUnderFeatureFlag.js.map +1 -1
- package/lib-es/notifications/AnnouncementProvider/api/api.js +1 -1
- package/lib-es/notifications/AnnouncementProvider/api/api.js.map +1 -1
- package/lib-es/notifications/ServiceStatusProvider/api/api.js +1 -1
- package/lib-es/notifications/ServiceStatusProvider/api/api.js.map +1 -1
- package/lib-es/operation.d.ts.map +1 -1
- package/lib-es/operation.js +7 -2
- package/lib-es/operation.js.map +1 -1
- package/lib-es/platform/providers/RampCatalogProvider/api/index.js +1 -1
- package/lib-es/platform/providers/RampCatalogProvider/api/index.js.map +1 -1
- package/lib-es/platform/providers/RampCatalogProvider/index.d.ts +1 -1
- package/lib-es/platform/providers/RampCatalogProvider/index.d.ts.map +1 -1
- package/lib-es/platform/providers/RemoteLiveAppProvider/index.d.ts +1 -1
- package/lib-es/platform/providers/RemoteLiveAppProvider/index.d.ts.map +1 -1
- package/lib-es/postOnboarding/reducer.d.ts +2 -0
- package/lib-es/postOnboarding/reducer.d.ts.map +1 -1
- package/lib-es/wallet-api/Exchange/SwapError.d.ts +93 -0
- package/lib-es/wallet-api/Exchange/SwapError.d.ts.map +1 -0
- package/lib-es/wallet-api/Exchange/SwapError.js +128 -0
- package/lib-es/wallet-api/Exchange/SwapError.js.map +1 -0
- package/lib-es/wallet-api/Exchange/handleSwapErrors.d.ts +40 -0
- package/lib-es/wallet-api/Exchange/handleSwapErrors.d.ts.map +1 -0
- package/lib-es/wallet-api/Exchange/handleSwapErrors.js +106 -0
- package/lib-es/wallet-api/Exchange/handleSwapErrors.js.map +1 -0
- package/lib-es/wallet-api/Exchange/index.d.ts +4 -0
- package/lib-es/wallet-api/Exchange/index.d.ts.map +1 -0
- package/lib-es/wallet-api/Exchange/index.js +7 -0
- package/lib-es/wallet-api/Exchange/index.js.map +1 -0
- package/lib-es/wallet-api/Exchange/parser.d.ts +46 -0
- package/lib-es/wallet-api/Exchange/parser.d.ts.map +1 -0
- package/lib-es/wallet-api/Exchange/parser.js +90 -0
- package/lib-es/wallet-api/Exchange/parser.js.map +1 -0
- package/lib-es/wallet-api/Exchange/server.d.ts.map +1 -1
- package/lib-es/wallet-api/Exchange/server.js +224 -174
- package/lib-es/wallet-api/Exchange/server.js.map +1 -1
- package/lib-es/wallet-api/Exchange/tracking.d.ts +7 -6
- package/lib-es/wallet-api/Exchange/tracking.d.ts.map +1 -1
- package/lib-es/wallet-api/Exchange/tracking.js +52 -13
- package/lib-es/wallet-api/Exchange/tracking.js.map +1 -1
- package/lib-es/wallet-api/LocalLiveAppProvider/index.d.ts +1 -1
- package/lib-es/wallet-api/LocalLiveAppProvider/index.d.ts.map +1 -1
- package/lib-es/wallet-api/constants.d.ts +1 -1
- package/lib-es/wallet-api/logic.d.ts +1 -1
- package/lib-es/wallet-api/logic.d.ts.map +1 -1
- package/lib-es/wallet-api/logic.js +5 -5
- package/lib-es/wallet-api/logic.js.map +1 -1
- package/lib-es/wallet-api/react.d.ts.map +1 -1
- package/lib-es/wallet-api/react.js +9 -6
- package/lib-es/wallet-api/react.js.map +1 -1
- package/lib-es/wallet-api/tracking.d.ts +5 -5
- package/lib-es/wallet-api/tracking.d.ts.map +1 -1
- package/lib-es/wallet-api/tracking.js +30 -10
- package/lib-es/wallet-api/tracking.js.map +1 -1
- package/lib-es/wallet-api/useDappLogic.d.ts.map +1 -1
- package/lib-es/wallet-api/useDappLogic.js +31 -20
- package/lib-es/wallet-api/useDappLogic.js.map +1 -1
- package/lib-es/wallet-api/utils/extractDappURLFromManifest.js +3 -3
- package/lib-es/wallet-api/utils/extractDappURLFromManifest.js.map +1 -1
- package/lib-es/wallet-api/utils/extractURLFromManifest.js +1 -1
- package/lib-es/wallet-api/utils/extractURLFromManifest.js.map +1 -1
- package/lib-es/walletSync/getEnvironmentParams.js +6 -6
- package/lib-es/walletSync/getEnvironmentParams.js.map +1 -1
- package/package.json +82 -90
- package/src/__tests__/test-helpers/bridge.ts +1 -1
- package/src/__tests__/test-helpers/environment.ts +3 -0
- package/src/account/index.ts +6 -0
- package/src/account/recentAddresses.test.ts +104 -0
- package/src/account/recentAddresses.ts +84 -0
- package/src/account/serialization.ts +1 -1
- package/src/account/support.ts +1 -1
- package/src/bridge/generic-alpaca/accountBridge.ts +3 -2
- package/src/bridge/generic-alpaca/broadcast.ts +6 -3
- package/src/bridge/generic-alpaca/currencyBridge.ts +3 -3
- package/src/bridge/generic-alpaca/estimateMaxSpendable.ts +2 -1
- package/src/bridge/generic-alpaca/getAccountShape.ts +36 -13
- package/src/bridge/generic-alpaca/getTransactionStatus.ts +16 -1
- package/src/bridge/generic-alpaca/postSync.test.ts +97 -0
- package/src/bridge/generic-alpaca/postSync.ts +42 -0
- package/src/bridge/generic-alpaca/prepareTransaction.ts +51 -10
- package/src/bridge/generic-alpaca/signOperation.ts +18 -2
- package/src/bridge/generic-alpaca/signer/Eth.ts +5 -1
- package/src/bridge/generic-alpaca/signer/index.ts +7 -0
- package/src/bridge/generic-alpaca/tests/getAccountShape.test.ts +43 -10
- package/src/bridge/generic-alpaca/tests/prepareTransaction.test.ts +74 -0
- package/src/bridge/generic-alpaca/types.ts +4 -0
- package/src/bridge/generic-alpaca/utils.test.ts +4 -0
- package/src/bridge/generic-alpaca/utils.ts +15 -3
- package/src/bridge/impl.ts +16 -3
- package/src/bridge/react/BridgeSync.tsx +1 -1
- package/src/currencies/helpers.test.ts +10 -1
- package/src/currencies/helpers.ts +6 -0
- package/src/deposit/api.ts +2 -2
- package/src/domain/getTokensWithFunds.ts +18 -5
- package/src/domain/getTotalStakeableAssets.test.ts +267 -0
- package/src/domain/getTotalStakeableAssets.ts +47 -0
- package/src/e2e/data/deviceLabelsData.ts +1 -0
- package/src/e2e/data/regexes.ts +1 -0
- package/src/e2e/enum/Device.ts +1 -0
- package/src/e2e/families/cardano.ts +32 -14
- package/src/e2e/index.ts +20 -0
- package/src/e2e/speculos.ts +35 -4
- package/src/e2e/speculosAppVersion.ts +8 -2
- package/src/e2e/swap.ts +8 -7
- package/src/exchange/swap/api/v5/__tests__/fetchCurrencyAll.spec.ts +1 -1
- package/src/exchange/swap/api/v5/__tests__/fetchCurrencyFrom.spec.ts +1 -1
- package/src/exchange/swap/api/v5/__tests__/fetchCurrencyTo.spec.ts +1 -1
- package/src/exchange/swap/api/v5/fetchCurrencyAll.ts +1 -1
- package/src/exchange/swap/api/v5/fetchCurrencyFrom.ts +2 -2
- package/src/exchange/swap/api/v5/fetchCurrencyTo.ts +1 -1
- package/src/exchange/swap/api/v5/fetchRates.ts +1 -1
- package/src/exchange/swap/getIncompatibleCurrencyKeys.ts +4 -0
- package/src/exchange/swap/postSwapState.ts +10 -5
- package/src/exchange/swap/transactionStrategies.ts +30 -7
- package/src/exchange/swap/types.ts +3 -1
- package/src/families/bitcoin/bridge/api.ts +2 -2
- package/src/families/bitcoin/walletApiAdapter.test.ts +36 -0
- package/src/families/bitcoin/walletApiAdapter.ts +4 -0
- package/src/families/canton/config.ts +5 -4
- package/src/families/canton/react.test.ts +147 -0
- package/src/families/canton/react.ts +45 -1
- package/src/families/celo/setup.ts +12 -0
- package/src/families/cosmos/datasets/__snapshots__/cosmos.integration.test.ts.snap +73 -4
- package/src/families/cosmos/datasets/__snapshots__/cryptoOrg.integration.test.ts.snap +2 -2
- package/src/families/cosmos/datasets/__snapshots__/injective.integration.test.ts.snap +2 -2
- package/src/families/cosmos/datasets/__snapshots__/mantra.integration.test.ts.snap +2 -2
- package/src/families/cosmos/datasets/__snapshots__/osmosis.integration.test.ts.snap +2 -2
- package/src/families/cosmos/datasets/__snapshots__/persistence.integration.test.ts.snap +4 -4
- package/src/families/cosmos/datasets/__snapshots__/stargaze.integration.test.ts.snap +2 -2
- package/src/families/evm/bridge/mock.ts +14 -0
- package/src/families/evm/setup.ts +3 -22
- package/src/families/evm/walletApiAdapter.ts +33 -1
- package/src/families/hedera/__snapshots__/bridge.integration.test.ts.snap +278 -17
- package/src/families/hedera/react.test.ts +272 -0
- package/src/families/hedera/react.ts +63 -0
- package/src/families/polkadot/__snapshots__/bridge.integration.test.ts.snap +6 -3653
- package/src/families/polkadot/config.ts +1 -1
- package/src/families/stacks/__snapshots__/bridge.integration.test.ts.snap +1537 -18
- package/src/families/stacks/__tests__/sync.integration.test.ts +2 -2
- package/src/families/stacks/constants.ts +1 -1
- package/src/families/stellar/__snapshots__/bridge.integration.test.ts.snap +9 -9
- package/src/featureFlags/FeatureToggle.tsx +1 -1
- package/src/featureFlags/defaultFeatures.ts +22 -1
- package/src/featureFlags/firebaseFeatureFlags.ts +1 -1
- package/src/featureFlags/stakePrograms/index.ts +4 -4
- package/src/featureFlags/useHasOverriddenFeatureFlags.ts +1 -1
- package/src/generated/bridge/js.ts +0 -2
- package/src/helpers/cryptoIconSize.ts +25 -0
- package/src/helpers.ts +2 -0
- package/src/hooks/__tests__/useHtmlLinkSegments.test.ts +105 -0
- package/src/hooks/useHtmlLinkSegments.ts +158 -0
- package/src/hw/getAppAndVersion.ts +2 -1
- package/src/hw/getBitcoinLikeInfo.ts +1 -1
- package/src/hw/isFirmwareUpdateVersionSupported.test.ts +36 -32
- package/src/hw/isFirmwareUpdateVersionSupported.ts +23 -8
- package/src/load/speculos.ts +1 -0
- package/src/market/api/index.ts +8 -7
- package/src/market/utils/types.ts +6 -0
- package/src/mock/account.ts +1 -1
- package/src/modularDrawer/hooks/useCurrenciesUnderFeatureFlag.ts +6 -0
- package/src/notifications/AnnouncementProvider/api/api.ts +2 -2
- package/src/notifications/ServiceStatusProvider/api/api.ts +2 -2
- package/src/operation.ts +10 -2
- package/src/platform/providers/RampCatalogProvider/api/index.ts +3 -3
- package/src/platform/providers/RampCatalogProvider/index.tsx +1 -1
- package/src/platform/providers/RemoteLiveAppProvider/index.tsx +1 -1
- package/src/wallet-api/Exchange/SwapError.test.ts +126 -0
- package/src/wallet-api/Exchange/SwapError.ts +159 -0
- package/src/wallet-api/Exchange/handleSwapErrors.test.ts +46 -0
- package/src/wallet-api/Exchange/handleSwapErrors.ts +161 -0
- package/src/wallet-api/Exchange/index.ts +26 -0
- package/src/wallet-api/Exchange/parser.test.ts +86 -0
- package/src/wallet-api/Exchange/parser.ts +119 -0
- package/src/wallet-api/Exchange/server.ts +289 -232
- package/src/wallet-api/Exchange/tracking.ts +56 -13
- package/src/wallet-api/LocalLiveAppProvider/index.tsx +1 -1
- package/src/wallet-api/logic.ts +5 -4
- package/src/wallet-api/react.ts +10 -5
- package/src/wallet-api/tracking.ts +30 -10
- package/src/wallet-api/useDappLogic.ts +32 -20
- package/src/wallet-api/utils/extractDappURLFromManifest.ts +3 -3
- package/src/wallet-api/utils/extractURLFromManifest.ts +1 -1
- package/src/walletSync/getEnvironmentParams.ts +6 -6
- package/lib/currencies/cryptoIcons.d.ts +0 -3
- package/lib/currencies/cryptoIcons.d.ts.map +0 -1
- package/lib/currencies/cryptoIcons.js +0 -24
- package/lib/currencies/cryptoIcons.js.map +0 -1
- package/lib/react.d.ts +0 -16
- package/lib/react.d.ts.map +0 -1
- package/lib/react.js +0 -64
- package/lib/react.js.map +0 -1
- package/lib/reactNative.d.ts +0 -16
- package/lib/reactNative.d.ts.map +0 -1
- package/lib/reactNative.js +0 -43
- package/lib/reactNative.js.map +0 -1
- package/lib-es/currencies/cryptoIcons.d.ts +0 -3
- package/lib-es/currencies/cryptoIcons.d.ts.map +0 -1
- package/lib-es/currencies/cryptoIcons.js +0 -20
- package/lib-es/currencies/cryptoIcons.js.map +0 -1
- package/lib-es/react.d.ts +0 -16
- package/lib-es/react.d.ts.map +0 -1
- package/lib-es/react.js +0 -33
- package/lib-es/react.js.map +0 -1
- package/lib-es/reactNative.d.ts +0 -16
- package/lib-es/reactNative.d.ts.map +0 -1
- package/lib-es/reactNative.js +0 -15
- package/lib-es/reactNative.js.map +0 -1
- package/react.js +0 -1
- package/reactNative.js +0 -1
- package/src/currencies/cryptoIcons.test.ts +0 -54
- package/src/currencies/cryptoIcons.ts +0 -21
- package/src/react.tsx +0 -43
- package/src/reactNative.ts +0 -23
- package/src/reactNativeSvg.d.ts +0 -19
|
@@ -17,6 +17,19 @@ function isNftCoreOp(operation: Operation): boolean {
|
|
|
17
17
|
);
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
+
function isIncomingCoreOp(operation: Operation): boolean {
|
|
21
|
+
const type =
|
|
22
|
+
typeof operation.details?.ledgerOpType === "string"
|
|
23
|
+
? operation.details.ledgerOpType
|
|
24
|
+
: operation.type;
|
|
25
|
+
|
|
26
|
+
return type === "IN";
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
function isInternalLiveOp(operation: OperationCommon): boolean {
|
|
30
|
+
return !!operation.extra?.internal;
|
|
31
|
+
}
|
|
32
|
+
|
|
20
33
|
export function genericGetAccountShape(network: string, kind: string): GetAccountShape {
|
|
21
34
|
return async (info, syncConfig) => {
|
|
22
35
|
const { address, initialAccount, currency, derivationMode } = info;
|
|
@@ -58,14 +71,14 @@ export function genericGetAccountShape(network: string, kind: string): GetAccoun
|
|
|
58
71
|
|
|
59
72
|
// Calculate minHeight for pagination
|
|
60
73
|
const minHeight = syncFromScratch ? 0 : (oldOps[0]?.blockHeight ?? 0) + 1;
|
|
61
|
-
const paginationParams: Pagination = { minHeight, order: "
|
|
74
|
+
const paginationParams: Pagination = { minHeight, order: "desc" };
|
|
62
75
|
if (lastPagingToken && !syncFromScratch) {
|
|
63
76
|
paginationParams.lastPagingToken = lastPagingToken;
|
|
64
77
|
}
|
|
65
78
|
|
|
66
79
|
const [newCoreOps] = await alpacaApi.listOperations(address, paginationParams);
|
|
67
80
|
const newOps = newCoreOps
|
|
68
|
-
.filter(op => !isNftCoreOp(op))
|
|
81
|
+
.filter(op => !isNftCoreOp(op) && (!isIncomingCoreOp(op) || !op.tx.failed))
|
|
69
82
|
.map(op => adaptCoreOperationToLiveOperation(accountId, op)) as OperationCommon[];
|
|
70
83
|
|
|
71
84
|
const newAssetOperations = newOps.filter(
|
|
@@ -74,6 +87,7 @@ export function genericGetAccountShape(network: string, kind: string): GetAccoun
|
|
|
74
87
|
operation?.extra?.assetOwner &&
|
|
75
88
|
!["OPT_IN", "OPT_OUT"].includes(operation.type),
|
|
76
89
|
);
|
|
90
|
+
const newInternalOperations = newOps.filter(isInternalLiveOp);
|
|
77
91
|
const newSubAccounts = await buildSubAccounts({
|
|
78
92
|
accountId,
|
|
79
93
|
allTokenAssetsBalances,
|
|
@@ -85,22 +99,31 @@ export function genericGetAccountShape(network: string, kind: string): GetAccoun
|
|
|
85
99
|
? newSubAccounts
|
|
86
100
|
: mergeSubAccounts(initialAccount?.subAccounts ?? [], newSubAccounts);
|
|
87
101
|
|
|
88
|
-
const newOpsWithSubs = newOps
|
|
89
|
-
|
|
102
|
+
const newOpsWithSubs = newOps
|
|
103
|
+
.filter(operation => !isInternalLiveOp(operation))
|
|
104
|
+
.map(op => {
|
|
105
|
+
const subOperations = inferSubOperations(op.hash, newSubAccounts);
|
|
106
|
+
const internalOperations = newInternalOperations.filter(it => it.hash === op.hash);
|
|
90
107
|
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
108
|
+
return cleanedOperation({
|
|
109
|
+
...op,
|
|
110
|
+
subOperations,
|
|
111
|
+
internalOperations,
|
|
112
|
+
});
|
|
94
113
|
});
|
|
95
|
-
|
|
114
|
+
// Try to refresh known pending and broadcasted operations (if not already updated)
|
|
115
|
+
// Useful for integrations without explorers
|
|
116
|
+
const operationsToRefresh = initialAccount?.pendingOperations.filter(
|
|
117
|
+
pendingOp =>
|
|
118
|
+
pendingOp.hash && // operation has been broadcasted
|
|
119
|
+
!newOpsWithSubs.some(newOp => pendingOp.hash === newOp.hash), // operation is not confirmed yet
|
|
120
|
+
);
|
|
96
121
|
const confirmedOperations =
|
|
97
|
-
alpacaApi.refreshOperations &&
|
|
98
|
-
? await alpacaApi.refreshOperations(
|
|
122
|
+
alpacaApi.refreshOperations && operationsToRefresh?.length
|
|
123
|
+
? await alpacaApi.refreshOperations(operationsToRefresh)
|
|
99
124
|
: [];
|
|
100
125
|
const newOperations = [...confirmedOperations, ...newOpsWithSubs];
|
|
101
|
-
const operations = syncFromScratch
|
|
102
|
-
? newOperations
|
|
103
|
-
: (mergeOps(oldOps, newOperations) as OperationCommon[]);
|
|
126
|
+
const operations = mergeOps(syncFromScratch ? [] : oldOps, newOperations) as OperationCommon[];
|
|
104
127
|
|
|
105
128
|
const res: Partial<Account> = {
|
|
106
129
|
id: accountId,
|
|
@@ -26,6 +26,7 @@ export function genericGetTransactionStatus(
|
|
|
26
26
|
feesStrategy: transaction.feesStrategy,
|
|
27
27
|
data: transaction.data,
|
|
28
28
|
type: transaction.type,
|
|
29
|
+
sponsored: transaction.sponsored,
|
|
29
30
|
};
|
|
30
31
|
|
|
31
32
|
if (alpacaApi.getChainSpecificRules) {
|
|
@@ -37,10 +38,24 @@ export function genericGetTransactionStatus(
|
|
|
37
38
|
}
|
|
38
39
|
}
|
|
39
40
|
|
|
41
|
+
const fees = BigInt(transaction.fees?.toString() || "0");
|
|
42
|
+
const feesParameters = {
|
|
43
|
+
...(transaction.gasLimit ? { gasLimit: BigInt(transaction.gasLimit.toFixed()) } : {}),
|
|
44
|
+
...(transaction.gasPrice ? { gasPrice: BigInt(transaction.gasPrice.toFixed()) } : {}),
|
|
45
|
+
...(transaction.maxFeePerGas
|
|
46
|
+
? { maxFeePerGas: BigInt(transaction.maxFeePerGas.toFixed()) }
|
|
47
|
+
: {}),
|
|
48
|
+
...(transaction.maxPriorityFeePerGas
|
|
49
|
+
? { maxPriorityFeePerGas: BigInt(transaction.maxPriorityFeePerGas.toFixed()) }
|
|
50
|
+
: {}),
|
|
51
|
+
...(transaction.additionalFees
|
|
52
|
+
? { additionalFees: BigInt(transaction.additionalFees.toFixed()) }
|
|
53
|
+
: {}),
|
|
54
|
+
};
|
|
40
55
|
const { errors, warnings, estimatedFees, amount, totalSpent, totalFees } =
|
|
41
56
|
await alpacaApi.validateIntent(
|
|
42
57
|
transactionToIntent(account, draftTransaction, alpacaApi.computeIntentType),
|
|
43
|
-
{ value:
|
|
58
|
+
{ value: fees, parameters: feesParameters },
|
|
44
59
|
);
|
|
45
60
|
|
|
46
61
|
return {
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import type { Account } from "@ledgerhq/types-live";
|
|
2
|
+
import { postSync } from "./postSync";
|
|
3
|
+
import BigNumber from "bignumber.js";
|
|
4
|
+
|
|
5
|
+
describe("postSync", () => {
|
|
6
|
+
it("removes confirmed and outdated native operations from the pending pool", () => {
|
|
7
|
+
const initialAccount = {
|
|
8
|
+
operations: [{ hash: "hash0", transactionSequenceNumber: new BigNumber(4), type: "OUT" }],
|
|
9
|
+
pendingOperations: [
|
|
10
|
+
{ hash: "outdated", transactionSequenceNumber: new BigNumber(3), type: "IN" },
|
|
11
|
+
{ hash: "hash1", transactionSequenceNumber: new BigNumber(5), type: "OUT" },
|
|
12
|
+
{ hash: "hash2", transactionSequenceNumber: new BigNumber(6), type: "IN" },
|
|
13
|
+
],
|
|
14
|
+
} as Account;
|
|
15
|
+
const synced = {
|
|
16
|
+
operations: [
|
|
17
|
+
{ hash: "hash1", transactionSequenceNumber: new BigNumber(5), type: "OUT" },
|
|
18
|
+
{ hash: "hash0", transactionSequenceNumber: new BigNumber(4), type: "OUT" },
|
|
19
|
+
],
|
|
20
|
+
pendingOperations: [
|
|
21
|
+
{ hash: "outdated", transactionSequenceNumber: new BigNumber(3), type: "IN" },
|
|
22
|
+
{ hash: "hash1", transactionSequenceNumber: new BigNumber(5), type: "OUT" },
|
|
23
|
+
{ hash: "hash2", transactionSequenceNumber: new BigNumber(6), type: "IN" },
|
|
24
|
+
],
|
|
25
|
+
} as Account;
|
|
26
|
+
|
|
27
|
+
expect(postSync(initialAccount, synced)).toMatchObject({
|
|
28
|
+
operations: [
|
|
29
|
+
{ hash: "hash1", transactionSequenceNumber: new BigNumber(5), type: "OUT" },
|
|
30
|
+
{ hash: "hash0", transactionSequenceNumber: new BigNumber(4), type: "OUT" },
|
|
31
|
+
],
|
|
32
|
+
pendingOperations: [
|
|
33
|
+
{ hash: "hash2", transactionSequenceNumber: new BigNumber(6), type: "IN" },
|
|
34
|
+
],
|
|
35
|
+
});
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
it("removes confirmed and outdated token operations from the pending pool", () => {
|
|
39
|
+
const initialAccount = {
|
|
40
|
+
operations: [{ hash: "hash0", transactionSequenceNumber: new BigNumber(4), type: "OUT" }],
|
|
41
|
+
pendingOperations: [
|
|
42
|
+
{ hash: "outdated", transactionSequenceNumber: new BigNumber(3), type: "NONE" },
|
|
43
|
+
{ hash: "hash1", transactionSequenceNumber: new BigNumber(5), type: "FEES" },
|
|
44
|
+
{ hash: "hash2", transactionSequenceNumber: new BigNumber(6), type: "IN" },
|
|
45
|
+
],
|
|
46
|
+
subAccounts: [
|
|
47
|
+
{
|
|
48
|
+
pendingOperations: [
|
|
49
|
+
{ hash: "outdated", transactionSequenceNumber: new BigNumber(3), type: "IN" },
|
|
50
|
+
{ hash: "hash1", transactionSequenceNumber: new BigNumber(5), type: "FEES" },
|
|
51
|
+
],
|
|
52
|
+
},
|
|
53
|
+
],
|
|
54
|
+
} as Account;
|
|
55
|
+
const synced = {
|
|
56
|
+
operations: [
|
|
57
|
+
{ hash: "hash1", transactionSequenceNumber: new BigNumber(5), type: "FEES" },
|
|
58
|
+
{ hash: "hash0", transactionSequenceNumber: new BigNumber(4), type: "OUT" },
|
|
59
|
+
],
|
|
60
|
+
pendingOperations: [
|
|
61
|
+
{ hash: "outdated", transactionSequenceNumber: new BigNumber(3), type: "NONE" },
|
|
62
|
+
{ hash: "hash1", transactionSequenceNumber: new BigNumber(5), type: "FEES" },
|
|
63
|
+
{ hash: "hash2", transactionSequenceNumber: new BigNumber(6), type: "IN" },
|
|
64
|
+
],
|
|
65
|
+
subAccounts: [
|
|
66
|
+
{
|
|
67
|
+
operations: [{ hash: "hash1", transactionSequenceNumber: new BigNumber(5), type: "OUT" }],
|
|
68
|
+
pendingOperations: [
|
|
69
|
+
{ hash: "outdated", transactionSequenceNumber: new BigNumber(3), type: "IN" },
|
|
70
|
+
],
|
|
71
|
+
},
|
|
72
|
+
],
|
|
73
|
+
} as Account;
|
|
74
|
+
|
|
75
|
+
expect(postSync(initialAccount, synced)).toMatchObject({
|
|
76
|
+
operations: [
|
|
77
|
+
{ hash: "hash1", transactionSequenceNumber: new BigNumber(5), type: "FEES" },
|
|
78
|
+
{ hash: "hash0", transactionSequenceNumber: new BigNumber(4), type: "OUT" },
|
|
79
|
+
],
|
|
80
|
+
pendingOperations: [
|
|
81
|
+
{ hash: "hash2", transactionSequenceNumber: new BigNumber(6), type: "IN" },
|
|
82
|
+
],
|
|
83
|
+
subAccounts: [
|
|
84
|
+
{
|
|
85
|
+
operations: [
|
|
86
|
+
{
|
|
87
|
+
hash: "hash1",
|
|
88
|
+
transactionSequenceNumber: new BigNumber(5),
|
|
89
|
+
type: "OUT",
|
|
90
|
+
},
|
|
91
|
+
],
|
|
92
|
+
pendingOperations: [],
|
|
93
|
+
},
|
|
94
|
+
],
|
|
95
|
+
});
|
|
96
|
+
});
|
|
97
|
+
});
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { Account, AccountLike, Operation } from "@ledgerhq/types-live";
|
|
2
|
+
import BigNumber from "bignumber.js";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* After each sync or scan, remove operations from the pending pools if necessary
|
|
6
|
+
* Operations stay pending if and only if
|
|
7
|
+
* - they are confirmed, i.e. their hash appear in the operation list
|
|
8
|
+
* - they are not outdated, i.e. their sequence number is at least greater than the
|
|
9
|
+
* sequence number of the latest transaction
|
|
10
|
+
* NOTE Compared to the default behaviour
|
|
11
|
+
* - pending operations of token accounts are cleaned up, so we don't see both pending and completed
|
|
12
|
+
* sub operations in the operation details drawer
|
|
13
|
+
* - pending operations are cleaned if their hash already belong to the completed operations, preventing
|
|
14
|
+
* undesired replacement (ex: optimistic operation for self token sending on EVM is incomplete, since
|
|
15
|
+
* it only contains the OUT sub operation)
|
|
16
|
+
*/
|
|
17
|
+
export function postSync(initial: Account, synced: Account): Account {
|
|
18
|
+
const lastOperation = synced.operations.find(op => ["OUT", "FEES"].includes(op.type));
|
|
19
|
+
const latestSequence = lastOperation?.transactionSequenceNumber || new BigNumber(-1);
|
|
20
|
+
|
|
21
|
+
function isPending(account: AccountLike, op: Operation): boolean {
|
|
22
|
+
return (
|
|
23
|
+
// Operation is not confirmed
|
|
24
|
+
!account.operations.some(o => o.hash === op.hash) &&
|
|
25
|
+
// Operation is not outdated
|
|
26
|
+
op.transactionSequenceNumber !== undefined &&
|
|
27
|
+
op.transactionSequenceNumber.gt(latestSequence)
|
|
28
|
+
);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
const pendingOperations = initial.pendingOperations.length
|
|
32
|
+
? initial.pendingOperations.filter(op => isPending(synced, op))
|
|
33
|
+
: [];
|
|
34
|
+
const subAccounts = synced.subAccounts?.length
|
|
35
|
+
? synced.subAccounts.map(subAccount => ({
|
|
36
|
+
...subAccount,
|
|
37
|
+
pendingOperations: subAccount.pendingOperations.filter(op => isPending(subAccount, op)),
|
|
38
|
+
}))
|
|
39
|
+
: [];
|
|
40
|
+
|
|
41
|
+
return { ...synced, pendingOperations, subAccounts };
|
|
42
|
+
}
|
|
@@ -31,6 +31,11 @@ function propagateField(estimation: FeeEstimation, field: string, dest: GenericT
|
|
|
31
31
|
dest[field] = Number(value.toString());
|
|
32
32
|
return;
|
|
33
33
|
case "storageLimit":
|
|
34
|
+
case "gasLimit":
|
|
35
|
+
case "gasPrice":
|
|
36
|
+
case "maxFeePerGas":
|
|
37
|
+
case "maxPriorityFeePerGas":
|
|
38
|
+
case "additionalFees":
|
|
34
39
|
dest[field] = new BigNumber(value.toString());
|
|
35
40
|
return;
|
|
36
41
|
default:
|
|
@@ -51,17 +56,42 @@ export function genericPrepareTransaction(
|
|
|
51
56
|
? await getAssetInfos(transaction, account.freshAddress, getAssetFromToken)
|
|
52
57
|
: assetInfosFallback(transaction);
|
|
53
58
|
const customParametersFees = transaction.customFees?.parameters?.fees;
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Ticking `useAllAmount` constantly resets the amount to 0. This is problematic
|
|
62
|
+
* because some Blockchain need the actual transaction amount to compute the fees
|
|
63
|
+
* (Example with EVM and ERC20 transactions)
|
|
64
|
+
* In case of `useAllAmount` and token transaction, we read the token account spendable
|
|
65
|
+
* balance instead.
|
|
66
|
+
*/
|
|
67
|
+
let amount = transaction.amount;
|
|
68
|
+
if (transaction.useAllAmount && transaction.subAccountId) {
|
|
69
|
+
const subAccount = account.subAccounts?.find(acc => acc.id === transaction.subAccountId);
|
|
70
|
+
amount = subAccount?.spendableBalance ?? amount;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
// Pass any parameters that help estimating fees
|
|
74
|
+
// This includes `assetOwner` and `assetReference` that are not used by some apps that only rely on `subAccountId`
|
|
75
|
+
// TODO Remove `assetOwner` and `assetReference` in order to maintain one unique way of identifying the type of asset
|
|
76
|
+
// https://ledgerhq.atlassian.net/browse/LIVE-24044
|
|
77
|
+
const intent = transactionToIntent(
|
|
78
|
+
account,
|
|
79
|
+
{
|
|
80
|
+
...transaction,
|
|
81
|
+
assetOwner,
|
|
82
|
+
assetReference,
|
|
83
|
+
amount,
|
|
84
|
+
},
|
|
85
|
+
computeIntentType,
|
|
86
|
+
);
|
|
54
87
|
const estimation: FeeEstimation = customParametersFees
|
|
55
88
|
? { value: BigInt(customParametersFees.toFixed()) }
|
|
56
|
-
: await estimateFees(
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
computeIntentType,
|
|
63
|
-
),
|
|
64
|
-
);
|
|
89
|
+
: await estimateFees(intent, {
|
|
90
|
+
gasPrice: transaction.gasPrice,
|
|
91
|
+
maxFeePerGas: transaction.maxFeePerGas,
|
|
92
|
+
maxPriorityFeePerGas: transaction.maxPriorityFeePerGas,
|
|
93
|
+
gasOptions: transaction.gasOptions,
|
|
94
|
+
});
|
|
65
95
|
const fees = new BigNumber(estimation.value.toString());
|
|
66
96
|
|
|
67
97
|
if (!bnEq(transaction.fees, fees)) {
|
|
@@ -78,7 +108,15 @@ export function genericPrepareTransaction(
|
|
|
78
108
|
};
|
|
79
109
|
|
|
80
110
|
// Propagate needed fields
|
|
81
|
-
const fieldsToPropagate = [
|
|
111
|
+
const fieldsToPropagate = [
|
|
112
|
+
"type",
|
|
113
|
+
"storageLimit",
|
|
114
|
+
"gasLimit",
|
|
115
|
+
"gasPrice",
|
|
116
|
+
"maxFeePerGas",
|
|
117
|
+
"maxPriorityFeePerGas",
|
|
118
|
+
"additionalFees",
|
|
119
|
+
];
|
|
82
120
|
|
|
83
121
|
for (const field of fieldsToPropagate) {
|
|
84
122
|
propagateField(estimation, field, next);
|
|
@@ -86,11 +124,14 @@ export function genericPrepareTransaction(
|
|
|
86
124
|
|
|
87
125
|
// align with stellar/xrp: when send max (or staking intents), reflect validated amount in UI
|
|
88
126
|
if (transaction.useAllAmount || ["stake", "unstake"].includes(transaction.mode ?? "")) {
|
|
127
|
+
// TODO Remove the call to `validateIntent` https://ledgerhq.atlassian.net/browse/LIVE-22228
|
|
89
128
|
const { amount } = await validateIntent(
|
|
90
129
|
transactionToIntent(
|
|
91
130
|
account,
|
|
92
131
|
{
|
|
93
132
|
...transaction,
|
|
133
|
+
assetOwner,
|
|
134
|
+
assetReference,
|
|
94
135
|
},
|
|
95
136
|
computeIntentType,
|
|
96
137
|
),
|
|
@@ -86,6 +86,19 @@ export const genericSignOperation =
|
|
|
86
86
|
const alpacaApi = getAlpacaApi(account.currency.id, kind);
|
|
87
87
|
if (!transaction.fees) throw new FeeNotLoaded();
|
|
88
88
|
const fees = BigInt(transaction.fees?.toString() || "0");
|
|
89
|
+
const feesParameters = {
|
|
90
|
+
...(transaction.gasLimit ? { gasLimit: BigInt(transaction.gasLimit.toFixed()) } : {}),
|
|
91
|
+
...(transaction.gasPrice ? { gasPrice: BigInt(transaction.gasPrice.toFixed()) } : {}),
|
|
92
|
+
...(transaction.maxFeePerGas
|
|
93
|
+
? { maxFeePerGas: BigInt(transaction.maxFeePerGas.toFixed()) }
|
|
94
|
+
: {}),
|
|
95
|
+
...(transaction.maxPriorityFeePerGas
|
|
96
|
+
? { maxPriorityFeePerGas: BigInt(transaction.maxPriorityFeePerGas.toFixed()) }
|
|
97
|
+
: {}),
|
|
98
|
+
...(transaction.additionalFees
|
|
99
|
+
? { additionalFees: BigInt(transaction.additionalFees.toFixed()) }
|
|
100
|
+
: {}),
|
|
101
|
+
};
|
|
89
102
|
if (transaction.useAllAmount) {
|
|
90
103
|
const draftTransaction = {
|
|
91
104
|
mode: transaction.mode,
|
|
@@ -98,10 +111,12 @@ export const genericSignOperation =
|
|
|
98
111
|
family: transaction.family,
|
|
99
112
|
feesStrategy: transaction.feesStrategy,
|
|
100
113
|
data: transaction.data,
|
|
114
|
+
type: transaction.type,
|
|
101
115
|
};
|
|
116
|
+
// TODO Remove the call to `validateIntent` https://ledgerhq.atlassian.net/browse/LIVE-22227
|
|
102
117
|
const { amount } = await alpacaApi.validateIntent(
|
|
103
118
|
transactionToIntent(account, draftTransaction, alpacaApi.computeIntentType),
|
|
104
|
-
{ value: fees },
|
|
119
|
+
{ value: fees, parameters: feesParameters },
|
|
105
120
|
);
|
|
106
121
|
transaction.amount = new BigNumber(amount.toString());
|
|
107
122
|
}
|
|
@@ -119,7 +134,7 @@ export const genericSignOperation =
|
|
|
119
134
|
// Enrich with memo and asset information
|
|
120
135
|
transactionIntent = enrichTransactionIntent(transactionIntent, transaction, publicKey);
|
|
121
136
|
|
|
122
|
-
if (typeof transactionIntent.sequence !== "bigint") {
|
|
137
|
+
if (typeof transactionIntent.sequence !== "bigint" || transactionIntent.sequence < 0n) {
|
|
123
138
|
// TODO: should compute it and pass it down to craftTransaction (duplicate call right now)
|
|
124
139
|
const sequenceNumber = await alpacaApi.getSequence(transactionIntent.sender);
|
|
125
140
|
transactionIntent.sequence = sequenceNumber;
|
|
@@ -128,6 +143,7 @@ export const genericSignOperation =
|
|
|
128
143
|
/* Craft unsigned blob via Alpaca */
|
|
129
144
|
const { transaction: unsigned } = await alpacaApi.craftTransaction(transactionIntent, {
|
|
130
145
|
value: fees,
|
|
146
|
+
parameters: feesParameters,
|
|
131
147
|
});
|
|
132
148
|
|
|
133
149
|
/* Notify UI that the device is now showing the tx */
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { filter, firstValueFrom } from "rxjs";
|
|
2
2
|
import { EvmAddress, EvmSignature, EvmSigner } from "@ledgerhq/coin-evm/types/signer";
|
|
3
|
-
import { CreateSigner } from "../../setup";
|
|
3
|
+
import { CreateSigner, executeWithSigner } from "../../setup";
|
|
4
4
|
import { DeviceManagementKit } from "@ledgerhq/device-management-kit";
|
|
5
5
|
import { DmkSignerEth, LegacySignerEth } from "@ledgerhq/live-signer-evm";
|
|
6
6
|
import Transport from "@ledgerhq/hw-transport";
|
|
@@ -8,6 +8,7 @@ import { getEnv } from "@ledgerhq/live-env";
|
|
|
8
8
|
import { ResolutionConfig, LoadConfig } from "@ledgerhq/hw-app-eth/lib/services/types";
|
|
9
9
|
import { Signature } from "ethers";
|
|
10
10
|
import type { DomainServiceResolution } from "@ledgerhq/types-live";
|
|
11
|
+
import resolver from "@ledgerhq/coin-evm/hw-getAddress";
|
|
11
12
|
|
|
12
13
|
export type Signer = {
|
|
13
14
|
getAddress: (path: string) => Promise<EvmAddress>;
|
|
@@ -70,3 +71,6 @@ export const createSigner: CreateSigner<Signer> = (transport: Transport) => {
|
|
|
70
71
|
},
|
|
71
72
|
};
|
|
72
73
|
};
|
|
74
|
+
|
|
75
|
+
export const context = executeWithSigner(createSigner);
|
|
76
|
+
export const getAddress = resolver(context);
|
|
@@ -10,6 +10,7 @@ import { AlpacaSigner } from "./types";
|
|
|
10
10
|
import { DerivationType, LedgerSigner as TaquitoLedgerSigner } from "@taquito/ledger-signer";
|
|
11
11
|
import tezosGetAddress from "@ledgerhq/coin-tezos/signer/getAddress";
|
|
12
12
|
import Tezos from "@ledgerhq/hw-app-tezos";
|
|
13
|
+
import { context as evmContext, getAddress as evmGetAddress } from "./Eth";
|
|
13
14
|
|
|
14
15
|
const createSignerXrp: CreateSigner<Xrp> = (transport: Transport) => {
|
|
15
16
|
return new Xrp(transport);
|
|
@@ -97,6 +98,12 @@ export function getSigner(network: string): AlpacaSigner {
|
|
|
97
98
|
context: signerContextTezos,
|
|
98
99
|
};
|
|
99
100
|
}
|
|
101
|
+
case "evm": {
|
|
102
|
+
return {
|
|
103
|
+
getAddress: evmGetAddress,
|
|
104
|
+
context: evmContext,
|
|
105
|
+
};
|
|
106
|
+
}
|
|
100
107
|
}
|
|
101
108
|
throw new Error(`signer for ${network} not implemented`);
|
|
102
109
|
}
|
|
@@ -71,7 +71,7 @@ describe("genericGetAccountShape", () => {
|
|
|
71
71
|
"sync-hash",
|
|
72
72
|
{
|
|
73
73
|
minHeight: 11,
|
|
74
|
-
order: "
|
|
74
|
+
order: "desc",
|
|
75
75
|
lastPagingToken: "pt1",
|
|
76
76
|
},
|
|
77
77
|
[
|
|
@@ -82,11 +82,16 @@ describe("genericGetAccountShape", () => {
|
|
|
82
82
|
},
|
|
83
83
|
{
|
|
84
84
|
hash: "h2",
|
|
85
|
-
type: "
|
|
85
|
+
type: "OUT",
|
|
86
86
|
blockHeight: 12,
|
|
87
87
|
subOperations: [{ id: `${currency.id}_subOp1` }],
|
|
88
88
|
extra: { assetReference: "ar2", assetOwner: "ow2" },
|
|
89
89
|
},
|
|
90
|
+
{
|
|
91
|
+
blockHeight: 16,
|
|
92
|
+
hash: "h4",
|
|
93
|
+
type: "IN",
|
|
94
|
+
},
|
|
90
95
|
{
|
|
91
96
|
hash: "h1",
|
|
92
97
|
blockHeight: 10,
|
|
@@ -100,7 +105,7 @@ describe("genericGetAccountShape", () => {
|
|
|
100
105
|
"outdated-sync-hash",
|
|
101
106
|
{
|
|
102
107
|
minHeight: 0,
|
|
103
|
-
order: "
|
|
108
|
+
order: "desc",
|
|
104
109
|
},
|
|
105
110
|
[
|
|
106
111
|
{
|
|
@@ -110,11 +115,16 @@ describe("genericGetAccountShape", () => {
|
|
|
110
115
|
},
|
|
111
116
|
{
|
|
112
117
|
hash: "h2",
|
|
113
|
-
type: "
|
|
118
|
+
type: "OUT",
|
|
114
119
|
blockHeight: 12,
|
|
115
120
|
subOperations: [{ id: `${currency.id}_subOp1` }],
|
|
116
121
|
extra: { assetReference: "ar2", assetOwner: "ow2" },
|
|
117
122
|
},
|
|
123
|
+
{
|
|
124
|
+
blockHeight: 16,
|
|
125
|
+
hash: "h4",
|
|
126
|
+
type: "IN",
|
|
127
|
+
},
|
|
118
128
|
],
|
|
119
129
|
],
|
|
120
130
|
])(
|
|
@@ -150,8 +160,13 @@ describe("genericGetAccountShape", () => {
|
|
|
150
160
|
asset.symbol === "TOK1" ? { id: `${currency.id}_token1` } : null,
|
|
151
161
|
);
|
|
152
162
|
|
|
153
|
-
|
|
154
|
-
|
|
163
|
+
listOperationsMock.mockResolvedValue([
|
|
164
|
+
[
|
|
165
|
+
{ hash: "h2", type: "OUT", height: 12 },
|
|
166
|
+
{ hash: "h3", type: "IN", tx: { failed: true }, height: 14 }, // won't appear in final shape
|
|
167
|
+
{ hash: "h4", type: "IN", tx: { failed: false }, height: 16 },
|
|
168
|
+
],
|
|
169
|
+
]);
|
|
155
170
|
refreshOperationsMock.mockImplementation(ops => {
|
|
156
171
|
const op = ops[0];
|
|
157
172
|
if (op?.hash === "h0") {
|
|
@@ -162,8 +177,8 @@ describe("genericGetAccountShape", () => {
|
|
|
162
177
|
|
|
163
178
|
adaptCoreOperationToLiveOperationMock.mockImplementation((_accId, op) => ({
|
|
164
179
|
hash: op.hash,
|
|
165
|
-
type:
|
|
166
|
-
blockHeight:
|
|
180
|
+
type: op.type,
|
|
181
|
+
blockHeight: op.height,
|
|
167
182
|
extra: { assetReference: "ar2", assetOwner: "ow2" },
|
|
168
183
|
}));
|
|
169
184
|
|
|
@@ -206,8 +221,26 @@ describe("genericGetAccountShape", () => {
|
|
|
206
221
|
]);
|
|
207
222
|
|
|
208
223
|
const assetOpsPassed = buildSubAccountsMock.mock.calls[0][0].operations;
|
|
209
|
-
expect(assetOpsPassed).
|
|
210
|
-
|
|
224
|
+
expect(assetOpsPassed).toEqual([
|
|
225
|
+
{
|
|
226
|
+
blockHeight: 12,
|
|
227
|
+
extra: {
|
|
228
|
+
assetOwner: "ow2",
|
|
229
|
+
assetReference: "ar2",
|
|
230
|
+
},
|
|
231
|
+
hash: "h2",
|
|
232
|
+
type: "OUT",
|
|
233
|
+
},
|
|
234
|
+
{
|
|
235
|
+
blockHeight: 16,
|
|
236
|
+
extra: {
|
|
237
|
+
assetOwner: "ow2",
|
|
238
|
+
assetReference: "ar2",
|
|
239
|
+
},
|
|
240
|
+
hash: "h4",
|
|
241
|
+
type: "IN",
|
|
242
|
+
},
|
|
243
|
+
]);
|
|
211
244
|
|
|
212
245
|
expect(result).toMatchObject({
|
|
213
246
|
balance: new BigNumber(1000),
|
|
@@ -2,6 +2,9 @@ import { genericPrepareTransaction } from "../prepareTransaction";
|
|
|
2
2
|
import { getAlpacaApi } from "../alpaca";
|
|
3
3
|
import { transactionToIntent } from "../utils";
|
|
4
4
|
import BigNumber from "bignumber.js";
|
|
5
|
+
import { GenericTransaction } from "../types";
|
|
6
|
+
import { setupMockCryptoAssetsStore } from "@ledgerhq/cryptoassets/cal-client/test-helpers";
|
|
7
|
+
import { TokenCurrency } from "@ledgerhq/types-cryptoassets";
|
|
5
8
|
|
|
6
9
|
jest.mock("../alpaca", () => ({
|
|
7
10
|
getAlpacaApi: jest.fn(),
|
|
@@ -95,6 +98,11 @@ describe("genericPrepareTransaction", () => {
|
|
|
95
98
|
it.each([
|
|
96
99
|
["type", 2, 2],
|
|
97
100
|
["storageLimit", 300n, new BigNumber(300)],
|
|
101
|
+
["gasLimit", 300n, new BigNumber(300)],
|
|
102
|
+
["gasPrice", 300n, new BigNumber(300)],
|
|
103
|
+
["maxFeePerGas", 300n, new BigNumber(300)],
|
|
104
|
+
["maxPriorityFeePerGas", 300n, new BigNumber(300)],
|
|
105
|
+
["additionalFees", 300n, new BigNumber(300)],
|
|
98
106
|
])(
|
|
99
107
|
"propagates %s from estimation parameters",
|
|
100
108
|
async (parameterName, parameterValue, expectedValue) => {
|
|
@@ -122,4 +130,70 @@ describe("genericPrepareTransaction", () => {
|
|
|
122
130
|
);
|
|
123
131
|
},
|
|
124
132
|
);
|
|
133
|
+
|
|
134
|
+
it("estimates using the token account spendable balance when sending all amount", async () => {
|
|
135
|
+
const estimateFees = jest.fn().mockResolvedValue({ value: new BigNumber(50) });
|
|
136
|
+
(transactionToIntent as jest.Mock).mockImplementation((_, transaction) => ({
|
|
137
|
+
amount: BigInt(transaction.amount.toFixed()),
|
|
138
|
+
}));
|
|
139
|
+
(getAlpacaApi as jest.Mock).mockReturnValue({
|
|
140
|
+
estimateFees,
|
|
141
|
+
validateIntent: intent => Promise.resolve({ amount: intent.amount }),
|
|
142
|
+
});
|
|
143
|
+
const prepareTransaction = genericPrepareTransaction(network, kind);
|
|
144
|
+
|
|
145
|
+
await prepareTransaction(
|
|
146
|
+
{
|
|
147
|
+
...account,
|
|
148
|
+
subAccounts: [{ id: "test-sub-account", spendableBalance: new BigNumber(100) }],
|
|
149
|
+
},
|
|
150
|
+
{
|
|
151
|
+
subAccountId: "test-sub-account",
|
|
152
|
+
useAllAmount: true,
|
|
153
|
+
amount: new BigNumber(0),
|
|
154
|
+
} as GenericTransaction,
|
|
155
|
+
);
|
|
156
|
+
|
|
157
|
+
expect(estimateFees).toHaveBeenCalledWith(expect.objectContaining({ amount: 100n }), {});
|
|
158
|
+
});
|
|
159
|
+
|
|
160
|
+
it("fills 'assetOwner' and 'assetReference' from 'subAccountId' for retro compatibility", async () => {
|
|
161
|
+
setupMockCryptoAssetsStore({
|
|
162
|
+
findTokenById: tokenId =>
|
|
163
|
+
Promise.resolve(tokenId === "usdc" ? ({ id: tokenId } as TokenCurrency) : undefined),
|
|
164
|
+
});
|
|
165
|
+
(getAlpacaApi as jest.Mock).mockReturnValue({
|
|
166
|
+
estimateFees: () => Promise.resolve({ value: 0n }),
|
|
167
|
+
getAssetFromToken: (token, owner) =>
|
|
168
|
+
token.id === "usdc" ? { assetOwner: owner, assetReference: token.id } : undefined,
|
|
169
|
+
});
|
|
170
|
+
const prepareTransaction = genericPrepareTransaction(network, kind);
|
|
171
|
+
|
|
172
|
+
await prepareTransaction(
|
|
173
|
+
{
|
|
174
|
+
...account,
|
|
175
|
+
freshAddress: "test-account-address",
|
|
176
|
+
subAccounts: [{ id: "test-sub-account+usdc" }],
|
|
177
|
+
},
|
|
178
|
+
{
|
|
179
|
+
subAccountId: "test-sub-account+usdc",
|
|
180
|
+
amount: new BigNumber(10),
|
|
181
|
+
} as GenericTransaction,
|
|
182
|
+
);
|
|
183
|
+
|
|
184
|
+
expect(transactionToIntent).toHaveBeenCalledWith(
|
|
185
|
+
{
|
|
186
|
+
...account,
|
|
187
|
+
freshAddress: "test-account-address",
|
|
188
|
+
subAccounts: [{ id: "test-sub-account+usdc" }],
|
|
189
|
+
},
|
|
190
|
+
{
|
|
191
|
+
subAccountId: "test-sub-account+usdc",
|
|
192
|
+
amount: new BigNumber(10),
|
|
193
|
+
assetOwner: "test-account-address",
|
|
194
|
+
assetReference: "usdc",
|
|
195
|
+
},
|
|
196
|
+
undefined,
|
|
197
|
+
);
|
|
198
|
+
});
|
|
125
199
|
});
|
|
@@ -70,7 +70,9 @@ export type GenericTransaction = TransactionCommon & {
|
|
|
70
70
|
gasPrice?: BigNumber | null;
|
|
71
71
|
maxFeePerGas?: BigNumber | null;
|
|
72
72
|
maxPriorityFeePerGas?: BigNumber | null;
|
|
73
|
+
additionalFees?: BigNumber | null;
|
|
73
74
|
gasOptions?: GasOptions;
|
|
75
|
+
sponsored?: boolean;
|
|
74
76
|
};
|
|
75
77
|
|
|
76
78
|
export type GenericTransactionRaw = TransactionCommonRaw & {
|
|
@@ -104,7 +106,9 @@ export type GenericTransactionRaw = TransactionCommonRaw & {
|
|
|
104
106
|
gasPrice?: string | null;
|
|
105
107
|
maxFeePerGas?: string | null;
|
|
106
108
|
maxPriorityFeePerGas?: string | null;
|
|
109
|
+
additionalFees?: string | null;
|
|
107
110
|
gasOptions?: GasOptionsRaw;
|
|
111
|
+
sponsored?: boolean;
|
|
108
112
|
};
|
|
109
113
|
|
|
110
114
|
export interface OperationCommon extends Operation {
|