@ledgerhq/live-common 34.3.0-nightly.9 → 35.0.0-next.6
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/environment.js +4 -0
- package/lib/__tests__/test-helpers/environment.js.map +1 -1
- package/lib/apps/listApps/v2.d.ts +2 -2
- package/lib/apps/listApps/v2.d.ts.map +1 -1
- package/lib/apps/listApps/v2.test.js +122 -0
- package/lib/apps/listApps/v2.test.js.map +1 -1
- package/lib/apps/mock.d.ts +2 -1
- package/lib/apps/mock.d.ts.map +1 -1
- package/lib/apps/mock.js +6 -1
- package/lib/apps/mock.js.map +1 -1
- package/lib/apps/react.test.js +1 -0
- package/lib/apps/react.test.js.map +1 -1
- package/lib/device/use-cases/listAppsUseCase.d.ts.map +1 -1
- package/lib/device/use-cases/listAppsUseCase.js +1 -0
- package/lib/device/use-cases/listAppsUseCase.js.map +1 -1
- package/lib/deviceSDK/actions/getLatestAvailableFirmware.test.js +3 -3
- package/lib/deviceSDK/actions/getLatestAvailableFirmware.test.js.map +1 -1
- package/lib/deviceSDK/tasks/core.js +1 -1
- package/lib/deviceSDK/tasks/core.js.map +1 -1
- package/lib/env.react.d.ts +1 -1
- package/lib/env.react.d.ts.map +1 -1
- package/lib/exchange/providers/swap.d.ts.map +1 -1
- package/lib/exchange/providers/swap.js +6 -1
- package/lib/exchange/providers/swap.js.map +1 -1
- package/lib/exchange/swap/api/v5/__tests__/fetchCurrencyAll.spec.js +2 -1
- package/lib/exchange/swap/api/v5/__tests__/fetchCurrencyAll.spec.js.map +1 -1
- package/lib/exchange/swap/api/v5/__tests__/fetchCurrencyFrom.spec.js +2 -0
- package/lib/exchange/swap/api/v5/__tests__/fetchCurrencyFrom.spec.js.map +1 -1
- package/lib/exchange/swap/api/v5/__tests__/fetchCurrencyTo.spec.js +3 -0
- package/lib/exchange/swap/api/v5/__tests__/fetchCurrencyTo.spec.js.map +1 -1
- package/lib/exchange/swap/api/v5/fetchCurrencyAll.d.ts +2 -1
- package/lib/exchange/swap/api/v5/fetchCurrencyAll.d.ts.map +1 -1
- package/lib/exchange/swap/api/v5/fetchCurrencyAll.js +1 -2
- package/lib/exchange/swap/api/v5/fetchCurrencyAll.js.map +1 -1
- package/lib/exchange/swap/api/v5/fetchCurrencyFrom.d.ts +2 -1
- package/lib/exchange/swap/api/v5/fetchCurrencyFrom.d.ts.map +1 -1
- package/lib/exchange/swap/api/v5/fetchCurrencyFrom.js +1 -2
- package/lib/exchange/swap/api/v5/fetchCurrencyFrom.js.map +1 -1
- package/lib/exchange/swap/api/v5/fetchCurrencyTo.d.ts +2 -1
- package/lib/exchange/swap/api/v5/fetchCurrencyTo.d.ts.map +1 -1
- package/lib/exchange/swap/api/v5/fetchCurrencyTo.js +1 -2
- package/lib/exchange/swap/api/v5/fetchCurrencyTo.js.map +1 -1
- package/lib/exchange/swap/api/v5/fetchRates.d.ts +2 -2
- package/lib/exchange/swap/api/v5/fetchRates.d.ts.map +1 -1
- package/lib/exchange/swap/api/v5/fetchRates.js +1 -5
- package/lib/exchange/swap/api/v5/fetchRates.js.map +1 -1
- package/lib/exchange/swap/completeExchange.d.ts.map +1 -1
- package/lib/exchange/swap/completeExchange.js +2 -1
- package/lib/exchange/swap/completeExchange.js.map +1 -1
- package/lib/exchange/swap/hooks/useSwapTransaction.d.ts +4 -3
- package/lib/exchange/swap/hooks/useSwapTransaction.d.ts.map +1 -1
- package/lib/exchange/swap/hooks/useSwapTransaction.js +5 -4
- package/lib/exchange/swap/hooks/useSwapTransaction.js.map +1 -1
- package/lib/exchange/swap/hooks/v5/useFetchCurrencyAll.d.ts.map +1 -1
- package/lib/exchange/swap/hooks/v5/useFetchCurrencyAll.js +4 -0
- package/lib/exchange/swap/hooks/v5/useFetchCurrencyAll.js.map +1 -1
- package/lib/exchange/swap/hooks/v5/useFetchCurrencyFrom.d.ts.map +1 -1
- package/lib/exchange/swap/hooks/v5/useFetchCurrencyFrom.js +4 -1
- package/lib/exchange/swap/hooks/v5/useFetchCurrencyFrom.js.map +1 -1
- package/lib/exchange/swap/hooks/v5/useFetchCurrencyTo.d.ts.map +1 -1
- package/lib/exchange/swap/hooks/v5/useFetchCurrencyTo.js +4 -2
- package/lib/exchange/swap/hooks/v5/useFetchCurrencyTo.js.map +1 -1
- package/lib/exchange/swap/hooks/v5/useFetchRates.d.ts +3 -2
- package/lib/exchange/swap/hooks/v5/useFetchRates.d.ts.map +1 -1
- package/lib/exchange/swap/hooks/v5/useFetchRates.js +12 -9
- package/lib/exchange/swap/hooks/v5/useFetchRates.js.map +1 -1
- package/lib/exchange/swap/hooks/v5/useFilteredProviders.d.ts +6 -0
- package/lib/exchange/swap/hooks/v5/useFilteredProviders.d.ts.map +1 -0
- package/lib/exchange/swap/hooks/v5/useFilteredProviders.js +51 -0
- package/lib/exchange/swap/hooks/v5/useFilteredProviders.js.map +1 -0
- package/lib/exchange/swap/hooks/v5/useProviderRates.d.ts +2 -1
- package/lib/exchange/swap/hooks/v5/useProviderRates.d.ts.map +1 -1
- package/lib/exchange/swap/hooks/v5/useProviderRates.js +5 -12
- package/lib/exchange/swap/hooks/v5/useProviderRates.js.map +1 -1
- package/lib/exchange/swap/initSwap.d.ts.map +1 -1
- package/lib/exchange/swap/initSwap.js +2 -1
- package/lib/exchange/swap/initSwap.js.map +1 -1
- package/lib/families/cosmos/bridge/mock.js +1 -1
- package/lib/families/evm/config.d.ts.map +1 -1
- package/lib/families/evm/config.js +32 -0
- package/lib/families/evm/config.js.map +1 -1
- package/lib/families/stacks/__tests__/sync.integration.test.js +1 -1
- package/lib/families/stacks/__tests__/sync.integration.test.js.map +1 -1
- package/lib/families/stacks/bridge/utils/api.d.ts.map +1 -1
- package/lib/families/stacks/bridge/utils/api.js +9 -3
- package/lib/families/stacks/bridge/utils/api.js.map +1 -1
- package/lib/families/stacks/bridge/utils/api.types.d.ts +80 -10
- package/lib/families/stacks/bridge/utils/api.types.d.ts.map +1 -1
- package/lib/families/stacks/bridge/utils/misc.d.ts +1 -1
- package/lib/families/stacks/bridge/utils/misc.d.ts.map +1 -1
- package/lib/families/stacks/bridge/utils/misc.js +29 -21
- package/lib/families/stacks/bridge/utils/misc.js.map +1 -1
- package/lib/families/stacks/bridge/utils/misc.unit.test.js +83 -69
- package/lib/families/stacks/bridge/utils/misc.unit.test.js.map +1 -1
- package/lib/families/stacks/synchronization.js +1 -1
- package/lib/families/stacks/synchronization.js.map +1 -1
- package/lib/families/tron/api/index.js +2 -2
- package/lib/families/tron/api/index.js.map +1 -1
- package/lib/families/tron/signOperation.d.ts.map +1 -1
- package/lib/families/tron/signOperation.js +0 -11
- package/lib/families/tron/signOperation.js.map +1 -1
- package/lib/families/tron/synchronization.d.ts.map +1 -1
- package/lib/families/tron/synchronization.js +35 -3
- package/lib/families/tron/synchronization.js.map +1 -1
- package/lib/featureFlags/defaultFeatures.d.ts +5 -1
- package/lib/featureFlags/defaultFeatures.d.ts.map +1 -1
- package/lib/featureFlags/defaultFeatures.js +11 -5
- package/lib/featureFlags/defaultFeatures.js.map +1 -1
- package/lib/featureFlags/firebaseFeatureFlags.d.ts +9 -3
- package/lib/featureFlags/firebaseFeatureFlags.d.ts.map +1 -1
- package/lib/featureFlags/groupedFeatures.d.ts +2 -1
- package/lib/featureFlags/groupedFeatures.d.ts.map +1 -1
- package/lib/featureFlags/groupedFeatures.js +0 -3
- package/lib/featureFlags/groupedFeatures.js.map +1 -1
- package/lib/featureFlags/useFeature.d.ts +1 -1
- package/lib/featureFlags/useFeature.d.ts.map +1 -1
- package/lib/generated/deviceTransactionConfig.d.ts +1 -1
- package/lib/generated/transaction.d.ts +2 -2
- package/lib/helpers.d.ts +1 -0
- package/lib/helpers.d.ts.map +1 -1
- package/lib/helpers.js +5 -1
- package/lib/helpers.js.map +1 -1
- package/lib/hw/getOnboardingStatePolling.js +1 -1
- package/lib/hw/getOnboardingStatePolling.js.map +1 -1
- package/lib/market/api/index.d.ts +8 -0
- package/lib/market/api/index.d.ts.map +1 -0
- package/lib/market/api/index.js +112 -0
- package/lib/market/api/index.js.map +1 -0
- package/lib/market/hooks/useMarketDataProvider.d.ts +13 -0
- package/lib/market/hooks/useMarketDataProvider.d.ts.map +1 -0
- package/lib/market/{v2 → hooks}/useMarketDataProvider.js +36 -39
- package/lib/market/hooks/useMarketDataProvider.js.map +1 -0
- package/lib/market/{v2 → hooks}/useMarketPerformers.d.ts +1 -1
- package/lib/market/hooks/useMarketPerformers.d.ts.map +1 -0
- package/lib/market/{v2 → hooks}/useMarketPerformers.js +3 -3
- package/lib/market/hooks/useMarketPerformers.js.map +1 -0
- package/lib/market/utils/currencyFormatter.d.ts +3 -26
- package/lib/market/utils/currencyFormatter.d.ts.map +1 -1
- package/lib/market/utils/currencyFormatter.js +35 -31
- package/lib/market/utils/currencyFormatter.js.map +1 -1
- package/lib/market/utils/index.d.ts +5 -0
- package/lib/market/utils/index.d.ts.map +1 -0
- package/lib/market/utils/index.js +37 -0
- package/lib/market/utils/index.js.map +1 -0
- package/lib/market/utils/queryKeys.d.ts.map +1 -0
- package/lib/market/utils/queryKeys.js.map +1 -0
- package/lib/market/utils/timers.d.ts.map +1 -0
- package/lib/market/utils/timers.js.map +1 -0
- package/lib/market/{types.d.ts → utils/types.d.ts} +35 -53
- package/lib/market/utils/types.d.ts.map +1 -0
- package/lib/market/utils/types.js +19 -0
- package/lib/market/utils/types.js.map +1 -0
- package/lib/platform/converters.d.ts.map +1 -1
- package/lib/platform/converters.js +4 -5
- package/lib/platform/converters.js.map +1 -1
- package/lib/platform/types.d.ts +6 -1
- package/lib/platform/types.d.ts.map +1 -1
- package/lib/platform/types.js +11 -2
- package/lib/platform/types.js.map +1 -1
- package/lib/wallet-api/constants.d.ts +6 -1
- package/lib/wallet-api/constants.d.ts.map +1 -1
- package/lib/wallet-api/constants.js +8 -2
- package/lib/wallet-api/constants.js.map +1 -1
- package/lib/wallet-api/converters.d.ts +1 -1
- package/lib/wallet-api/converters.d.ts.map +1 -1
- package/lib/wallet-api/converters.js +6 -5
- package/lib/wallet-api/converters.js.map +1 -1
- package/lib-es/__tests__/test-helpers/environment.js +4 -0
- package/lib-es/__tests__/test-helpers/environment.js.map +1 -1
- package/lib-es/apps/listApps/v2.d.ts +2 -2
- package/lib-es/apps/listApps/v2.d.ts.map +1 -1
- package/lib-es/apps/listApps/v2.test.js +122 -0
- package/lib-es/apps/listApps/v2.test.js.map +1 -1
- package/lib-es/apps/mock.d.ts +2 -1
- package/lib-es/apps/mock.d.ts.map +1 -1
- package/lib-es/apps/mock.js +4 -0
- package/lib-es/apps/mock.js.map +1 -1
- package/lib-es/apps/react.test.js +1 -0
- package/lib-es/apps/react.test.js.map +1 -1
- package/lib-es/device/use-cases/listAppsUseCase.d.ts.map +1 -1
- package/lib-es/device/use-cases/listAppsUseCase.js +1 -0
- package/lib-es/device/use-cases/listAppsUseCase.js.map +1 -1
- package/lib-es/deviceSDK/actions/getLatestAvailableFirmware.test.js +4 -4
- package/lib-es/deviceSDK/actions/getLatestAvailableFirmware.test.js.map +1 -1
- package/lib-es/deviceSDK/tasks/core.js +2 -2
- package/lib-es/deviceSDK/tasks/core.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/providers/swap.d.ts.map +1 -1
- package/lib-es/exchange/providers/swap.js +6 -1
- package/lib-es/exchange/providers/swap.js.map +1 -1
- package/lib-es/exchange/swap/api/v5/__tests__/fetchCurrencyAll.spec.js +2 -1
- package/lib-es/exchange/swap/api/v5/__tests__/fetchCurrencyAll.spec.js.map +1 -1
- package/lib-es/exchange/swap/api/v5/__tests__/fetchCurrencyFrom.spec.js +2 -0
- package/lib-es/exchange/swap/api/v5/__tests__/fetchCurrencyFrom.spec.js.map +1 -1
- package/lib-es/exchange/swap/api/v5/__tests__/fetchCurrencyTo.spec.js +3 -0
- package/lib-es/exchange/swap/api/v5/__tests__/fetchCurrencyTo.spec.js.map +1 -1
- package/lib-es/exchange/swap/api/v5/fetchCurrencyAll.d.ts +2 -1
- package/lib-es/exchange/swap/api/v5/fetchCurrencyAll.d.ts.map +1 -1
- package/lib-es/exchange/swap/api/v5/fetchCurrencyAll.js +2 -3
- package/lib-es/exchange/swap/api/v5/fetchCurrencyAll.js.map +1 -1
- package/lib-es/exchange/swap/api/v5/fetchCurrencyFrom.d.ts +2 -1
- package/lib-es/exchange/swap/api/v5/fetchCurrencyFrom.d.ts.map +1 -1
- package/lib-es/exchange/swap/api/v5/fetchCurrencyFrom.js +2 -3
- package/lib-es/exchange/swap/api/v5/fetchCurrencyFrom.js.map +1 -1
- package/lib-es/exchange/swap/api/v5/fetchCurrencyTo.d.ts +2 -1
- package/lib-es/exchange/swap/api/v5/fetchCurrencyTo.d.ts.map +1 -1
- package/lib-es/exchange/swap/api/v5/fetchCurrencyTo.js +2 -3
- package/lib-es/exchange/swap/api/v5/fetchCurrencyTo.js.map +1 -1
- package/lib-es/exchange/swap/api/v5/fetchRates.d.ts +2 -2
- package/lib-es/exchange/swap/api/v5/fetchRates.d.ts.map +1 -1
- package/lib-es/exchange/swap/api/v5/fetchRates.js +2 -6
- package/lib-es/exchange/swap/api/v5/fetchRates.js.map +1 -1
- package/lib-es/exchange/swap/completeExchange.d.ts.map +1 -1
- package/lib-es/exchange/swap/completeExchange.js +2 -1
- package/lib-es/exchange/swap/completeExchange.js.map +1 -1
- package/lib-es/exchange/swap/hooks/useSwapTransaction.d.ts +4 -3
- package/lib-es/exchange/swap/hooks/useSwapTransaction.d.ts.map +1 -1
- package/lib-es/exchange/swap/hooks/useSwapTransaction.js +5 -4
- package/lib-es/exchange/swap/hooks/useSwapTransaction.js.map +1 -1
- package/lib-es/exchange/swap/hooks/v5/useFetchCurrencyAll.d.ts.map +1 -1
- package/lib-es/exchange/swap/hooks/v5/useFetchCurrencyAll.js +4 -0
- package/lib-es/exchange/swap/hooks/v5/useFetchCurrencyAll.js.map +1 -1
- package/lib-es/exchange/swap/hooks/v5/useFetchCurrencyFrom.d.ts.map +1 -1
- package/lib-es/exchange/swap/hooks/v5/useFetchCurrencyFrom.js +4 -1
- package/lib-es/exchange/swap/hooks/v5/useFetchCurrencyFrom.js.map +1 -1
- package/lib-es/exchange/swap/hooks/v5/useFetchCurrencyTo.d.ts.map +1 -1
- package/lib-es/exchange/swap/hooks/v5/useFetchCurrencyTo.js +4 -2
- package/lib-es/exchange/swap/hooks/v5/useFetchCurrencyTo.js.map +1 -1
- package/lib-es/exchange/swap/hooks/v5/useFetchRates.d.ts +3 -2
- package/lib-es/exchange/swap/hooks/v5/useFetchRates.d.ts.map +1 -1
- package/lib-es/exchange/swap/hooks/v5/useFetchRates.js +12 -9
- package/lib-es/exchange/swap/hooks/v5/useFetchRates.js.map +1 -1
- package/lib-es/exchange/swap/hooks/v5/useFilteredProviders.d.ts +6 -0
- package/lib-es/exchange/swap/hooks/v5/useFilteredProviders.d.ts.map +1 -0
- package/lib-es/exchange/swap/hooks/v5/useFilteredProviders.js +47 -0
- package/lib-es/exchange/swap/hooks/v5/useFilteredProviders.js.map +1 -0
- package/lib-es/exchange/swap/hooks/v5/useProviderRates.d.ts +2 -1
- package/lib-es/exchange/swap/hooks/v5/useProviderRates.d.ts.map +1 -1
- package/lib-es/exchange/swap/hooks/v5/useProviderRates.js +6 -13
- package/lib-es/exchange/swap/hooks/v5/useProviderRates.js.map +1 -1
- package/lib-es/exchange/swap/initSwap.d.ts.map +1 -1
- package/lib-es/exchange/swap/initSwap.js +2 -1
- package/lib-es/exchange/swap/initSwap.js.map +1 -1
- package/lib-es/families/cosmos/bridge/mock.js +1 -1
- package/lib-es/families/evm/config.d.ts.map +1 -1
- package/lib-es/families/evm/config.js +32 -0
- package/lib-es/families/evm/config.js.map +1 -1
- package/lib-es/families/stacks/__tests__/sync.integration.test.js +1 -1
- package/lib-es/families/stacks/__tests__/sync.integration.test.js.map +1 -1
- package/lib-es/families/stacks/bridge/utils/api.d.ts.map +1 -1
- package/lib-es/families/stacks/bridge/utils/api.js +9 -3
- package/lib-es/families/stacks/bridge/utils/api.js.map +1 -1
- package/lib-es/families/stacks/bridge/utils/api.types.d.ts +80 -10
- package/lib-es/families/stacks/bridge/utils/api.types.d.ts.map +1 -1
- package/lib-es/families/stacks/bridge/utils/misc.d.ts +1 -1
- package/lib-es/families/stacks/bridge/utils/misc.d.ts.map +1 -1
- package/lib-es/families/stacks/bridge/utils/misc.js +30 -22
- package/lib-es/families/stacks/bridge/utils/misc.js.map +1 -1
- package/lib-es/families/stacks/bridge/utils/misc.unit.test.js +83 -66
- package/lib-es/families/stacks/bridge/utils/misc.unit.test.js.map +1 -1
- package/lib-es/families/stacks/synchronization.js +1 -1
- package/lib-es/families/stacks/synchronization.js.map +1 -1
- package/lib-es/families/tron/api/index.js +2 -2
- package/lib-es/families/tron/api/index.js.map +1 -1
- package/lib-es/families/tron/signOperation.d.ts.map +1 -1
- package/lib-es/families/tron/signOperation.js +1 -12
- package/lib-es/families/tron/signOperation.js.map +1 -1
- package/lib-es/families/tron/synchronization.d.ts.map +1 -1
- package/lib-es/families/tron/synchronization.js +35 -3
- package/lib-es/families/tron/synchronization.js.map +1 -1
- package/lib-es/featureFlags/defaultFeatures.d.ts +5 -1
- package/lib-es/featureFlags/defaultFeatures.d.ts.map +1 -1
- package/lib-es/featureFlags/defaultFeatures.js +11 -5
- package/lib-es/featureFlags/defaultFeatures.js.map +1 -1
- package/lib-es/featureFlags/firebaseFeatureFlags.d.ts +9 -3
- package/lib-es/featureFlags/firebaseFeatureFlags.d.ts.map +1 -1
- package/lib-es/featureFlags/groupedFeatures.d.ts +2 -1
- package/lib-es/featureFlags/groupedFeatures.d.ts.map +1 -1
- package/lib-es/featureFlags/groupedFeatures.js +0 -3
- package/lib-es/featureFlags/groupedFeatures.js.map +1 -1
- package/lib-es/featureFlags/useFeature.d.ts +1 -1
- package/lib-es/featureFlags/useFeature.d.ts.map +1 -1
- package/lib-es/generated/deviceTransactionConfig.d.ts +1 -1
- package/lib-es/generated/transaction.d.ts +2 -2
- package/lib-es/helpers.d.ts +1 -0
- package/lib-es/helpers.d.ts.map +1 -1
- package/lib-es/helpers.js +3 -0
- package/lib-es/helpers.js.map +1 -1
- package/lib-es/hw/getOnboardingStatePolling.js +2 -2
- package/lib-es/hw/getOnboardingStatePolling.js.map +1 -1
- package/lib-es/market/api/index.d.ts +8 -0
- package/lib-es/market/api/index.d.ts.map +1 -0
- package/lib-es/market/api/index.js +100 -0
- package/lib-es/market/api/index.js.map +1 -0
- package/lib-es/market/hooks/useMarketDataProvider.d.ts +13 -0
- package/lib-es/market/hooks/useMarketDataProvider.d.ts.map +1 -0
- package/lib-es/market/{v2 → hooks}/useMarketDataProvider.js +34 -37
- package/lib-es/market/hooks/useMarketDataProvider.js.map +1 -0
- package/lib-es/market/{v2 → hooks}/useMarketPerformers.d.ts +1 -1
- package/lib-es/market/hooks/useMarketPerformers.d.ts.map +1 -0
- package/lib-es/market/{v2 → hooks}/useMarketPerformers.js +3 -3
- package/lib-es/market/hooks/useMarketPerformers.js.map +1 -0
- package/lib-es/market/utils/currencyFormatter.d.ts +3 -26
- package/lib-es/market/utils/currencyFormatter.d.ts.map +1 -1
- package/lib-es/market/utils/currencyFormatter.js +35 -31
- package/lib-es/market/utils/currencyFormatter.js.map +1 -1
- package/lib-es/market/utils/index.d.ts +5 -0
- package/lib-es/market/utils/index.d.ts.map +1 -0
- package/lib-es/market/utils/index.js +32 -0
- package/lib-es/market/utils/index.js.map +1 -0
- package/lib-es/market/utils/queryKeys.d.ts.map +1 -0
- package/lib-es/market/utils/queryKeys.js.map +1 -0
- package/lib-es/market/utils/timers.d.ts.map +1 -0
- package/lib-es/market/utils/timers.js.map +1 -0
- package/lib-es/market/{types.d.ts → utils/types.d.ts} +35 -53
- package/lib-es/market/utils/types.d.ts.map +1 -0
- package/lib-es/market/utils/types.js +16 -0
- package/lib-es/market/utils/types.js.map +1 -0
- package/lib-es/platform/converters.d.ts.map +1 -1
- package/lib-es/platform/converters.js +5 -6
- package/lib-es/platform/converters.js.map +1 -1
- package/lib-es/platform/types.d.ts +6 -1
- package/lib-es/platform/types.d.ts.map +1 -1
- package/lib-es/platform/types.js +10 -1
- package/lib-es/platform/types.js.map +1 -1
- package/lib-es/wallet-api/constants.d.ts +6 -1
- package/lib-es/wallet-api/constants.d.ts.map +1 -1
- package/lib-es/wallet-api/constants.js +7 -1
- package/lib-es/wallet-api/constants.js.map +1 -1
- package/lib-es/wallet-api/converters.d.ts +1 -1
- package/lib-es/wallet-api/converters.d.ts.map +1 -1
- package/lib-es/wallet-api/converters.js +6 -5
- package/lib-es/wallet-api/converters.js.map +1 -1
- package/package.json +45 -45
- package/src/__tests__/test-helpers/environment.ts +4 -0
- package/src/apps/listApps/v2.test.ts +151 -0
- package/src/apps/listApps/v2.ts +2 -2
- package/src/apps/mock.ts +30 -1
- package/src/apps/react.test.ts +1 -0
- package/src/currencies/__snapshots__/sortByMarketcap.test.ts.snap +358 -1
- package/src/device/use-cases/listAppsUseCase.ts +1 -0
- package/src/deviceSDK/actions/getLatestAvailableFirmware.test.ts +4 -4
- package/src/deviceSDK/tasks/core.ts +2 -2
- package/src/exchange/providers/swap.ts +9 -1
- package/src/exchange/swap/api/v5/__tests__/fetchCurrencyAll.spec.ts +2 -1
- package/src/exchange/swap/api/v5/__tests__/fetchCurrencyFrom.spec.ts +3 -0
- package/src/exchange/swap/api/v5/__tests__/fetchCurrencyTo.spec.ts +3 -1
- package/src/exchange/swap/api/v5/fetchCurrencyAll.ts +3 -3
- package/src/exchange/swap/api/v5/fetchCurrencyFrom.ts +7 -3
- package/src/exchange/swap/api/v5/fetchCurrencyTo.ts +7 -3
- package/src/exchange/swap/api/v5/fetchRates.ts +3 -7
- package/src/exchange/swap/completeExchange.ts +5 -1
- package/src/exchange/swap/hooks/useSwapTransaction.ts +12 -9
- package/src/exchange/swap/hooks/v5/useFetchCurrencyAll.ts +4 -0
- package/src/exchange/swap/hooks/v5/useFetchCurrencyFrom.ts +4 -1
- package/src/exchange/swap/hooks/v5/useFetchCurrencyTo.ts +4 -2
- package/src/exchange/swap/hooks/v5/useFetchRates.ts +15 -9
- package/src/exchange/swap/hooks/v5/useFilteredProviders.ts +42 -0
- package/src/exchange/swap/hooks/v5/useProviderRates.ts +7 -14
- package/src/exchange/swap/initSwap.ts +5 -1
- package/src/families/cosmos/bridge/mock.ts +1 -1
- package/src/families/evm/config.ts +32 -0
- package/src/families/stacks/__snapshots__/bridge.integration.test.ts.snap +7 -7
- package/src/families/stacks/__tests__/sync.integration.test.ts +1 -1
- package/src/families/stacks/bridge/utils/api.ts +10 -5
- package/src/families/stacks/bridge/utils/api.types.ts +81 -10
- package/src/families/stacks/bridge/utils/misc.ts +43 -38
- package/src/families/stacks/bridge/utils/misc.unit.test.ts +88 -70
- package/src/families/stacks/synchronization.ts +1 -1
- package/src/families/tron/api/index.ts +2 -2
- package/src/families/tron/signOperation.ts +0 -15
- package/src/families/tron/synchronization.ts +45 -3
- package/src/featureFlags/defaultFeatures.ts +14 -3
- package/src/featureFlags/groupedFeatures.ts +3 -4
- package/src/helpers.ts +6 -0
- package/src/hw/getOnboardingStatePolling.ts +2 -2
- package/src/market/api/index.ts +138 -0
- package/src/market/{v2 → hooks}/useMarketDataProvider.ts +34 -33
- package/src/market/{v2 → hooks}/useMarketPerformers.ts +4 -4
- package/src/market/utils/currencyFormatter.ts +32 -28
- package/src/market/utils/index.ts +34 -0
- package/src/market/{types.ts → utils/types.ts} +38 -48
- package/src/platform/converters.ts +4 -5
- package/src/platform/types.ts +12 -1
- package/src/wallet-api/constants.ts +9 -1
- package/src/wallet-api/converters.ts +5 -6
- package/lib/market/MarketDataProvider.d.ts +0 -27
- package/lib/market/MarketDataProvider.d.ts.map +0 -1
- package/lib/market/MarketDataProvider.js +0 -261
- package/lib/market/MarketDataProvider.js.map +0 -1
- package/lib/market/api/api.d.ts +0 -18
- package/lib/market/api/api.d.ts.map +0 -1
- package/lib/market/api/api.js +0 -246
- package/lib/market/api/api.js.map +0 -1
- package/lib/market/api/api.mock.d.ts +0 -15
- package/lib/market/api/api.mock.d.ts.map +0 -1
- package/lib/market/api/api.mock.js +0 -395
- package/lib/market/api/api.mock.js.map +0 -1
- package/lib/market/types.d.ts.map +0 -1
- package/lib/market/types.js +0 -3
- package/lib/market/types.js.map +0 -1
- package/lib/market/utils/rangeFormatter.d.ts +0 -3
- package/lib/market/utils/rangeFormatter.d.ts.map +0 -1
- package/lib/market/utils/rangeFormatter.js +0 -18
- package/lib/market/utils/rangeFormatter.js.map +0 -1
- package/lib/market/v2/queryKeys.d.ts.map +0 -1
- package/lib/market/v2/queryKeys.js.map +0 -1
- package/lib/market/v2/timers.d.ts.map +0 -1
- package/lib/market/v2/timers.js.map +0 -1
- package/lib/market/v2/useMarketDataProvider.d.ts +0 -63
- package/lib/market/v2/useMarketDataProvider.d.ts.map +0 -1
- package/lib/market/v2/useMarketDataProvider.js.map +0 -1
- package/lib/market/v2/useMarketPerformers.d.ts.map +0 -1
- package/lib/market/v2/useMarketPerformers.js.map +0 -1
- package/lib-es/market/MarketDataProvider.d.ts +0 -27
- package/lib-es/market/MarketDataProvider.d.ts.map +0 -1
- package/lib-es/market/MarketDataProvider.js +0 -229
- package/lib-es/market/MarketDataProvider.js.map +0 -1
- package/lib-es/market/api/api.d.ts +0 -18
- package/lib-es/market/api/api.d.ts.map +0 -1
- package/lib-es/market/api/api.js +0 -232
- package/lib-es/market/api/api.js.map +0 -1
- package/lib-es/market/api/api.mock.d.ts +0 -15
- package/lib-es/market/api/api.mock.d.ts.map +0 -1
- package/lib-es/market/api/api.mock.js +0 -393
- package/lib-es/market/api/api.mock.js.map +0 -1
- package/lib-es/market/types.d.ts.map +0 -1
- package/lib-es/market/types.js +0 -2
- package/lib-es/market/types.js.map +0 -1
- package/lib-es/market/utils/rangeFormatter.d.ts +0 -3
- package/lib-es/market/utils/rangeFormatter.d.ts.map +0 -1
- package/lib-es/market/utils/rangeFormatter.js +0 -14
- package/lib-es/market/utils/rangeFormatter.js.map +0 -1
- package/lib-es/market/v2/queryKeys.d.ts.map +0 -1
- package/lib-es/market/v2/queryKeys.js.map +0 -1
- package/lib-es/market/v2/timers.d.ts.map +0 -1
- package/lib-es/market/v2/timers.js.map +0 -1
- package/lib-es/market/v2/useMarketDataProvider.d.ts +0 -63
- package/lib-es/market/v2/useMarketDataProvider.d.ts.map +0 -1
- package/lib-es/market/v2/useMarketDataProvider.js.map +0 -1
- package/lib-es/market/v2/useMarketPerformers.d.ts.map +0 -1
- package/lib-es/market/v2/useMarketPerformers.js.map +0 -1
- package/src/market/MarketDataProvider.tsx +0 -403
- package/src/market/api/api.mock.ts +0 -403
- package/src/market/api/api.ts +0 -310
- package/src/market/utils/rangeFormatter.ts +0 -15
- /package/lib/market/{v2 → utils}/queryKeys.d.ts +0 -0
- /package/lib/market/{v2 → utils}/queryKeys.js +0 -0
- /package/lib/market/{v2 → utils}/timers.d.ts +0 -0
- /package/lib/market/{v2 → utils}/timers.js +0 -0
- /package/lib-es/market/{v2 → utils}/queryKeys.d.ts +0 -0
- /package/lib-es/market/{v2 → utils}/queryKeys.js +0 -0
- /package/lib-es/market/{v2 → utils}/timers.d.ts +0 -0
- /package/lib-es/market/{v2 → utils}/timers.js +0 -0
- /package/src/market/{v2 → utils}/queryKeys.ts +0 -0
- /package/src/market/{v2 → utils}/timers.ts +0 -0
@@ -685,6 +685,38 @@ const evmConfig: CurrencyLiveConfigDefinition = {
|
|
685
685
|
explorer: { type: "etherscan", uri: "https://api-sepolia.lineascan.build/api" },
|
686
686
|
},
|
687
687
|
},
|
688
|
+
config_currency_blast: {
|
689
|
+
type: "object",
|
690
|
+
default: {
|
691
|
+
status: { type: "active" },
|
692
|
+
node: { type: "external", uri: "https://rpc.blast.io" },
|
693
|
+
explorer: { type: "etherscan", uri: "https://api.blastscan.io/api" },
|
694
|
+
},
|
695
|
+
},
|
696
|
+
config_currency_blast_sepolia: {
|
697
|
+
type: "object",
|
698
|
+
default: {
|
699
|
+
status: { type: "active" },
|
700
|
+
node: { type: "external", uri: "https://sepolia.blast.io" },
|
701
|
+
explorer: { type: "etherscan", uri: "https://api-sepolia.blastscan.io/api" },
|
702
|
+
},
|
703
|
+
},
|
704
|
+
config_currency_scroll: {
|
705
|
+
type: "object",
|
706
|
+
default: {
|
707
|
+
status: { type: "active" },
|
708
|
+
node: { type: "external", uri: "https://rpc.scroll.io" },
|
709
|
+
explorer: { type: "etherscan", uri: "https://api.scrollscan.com/api" },
|
710
|
+
},
|
711
|
+
},
|
712
|
+
config_currency_scroll_sepolia: {
|
713
|
+
type: "object",
|
714
|
+
default: {
|
715
|
+
status: { type: "active" },
|
716
|
+
node: { type: "external", uri: "https://sepolia-rpc.scroll.io" },
|
717
|
+
explorer: { type: "etherscan", uri: "https://api-sepolia.scrollscan.com/api" },
|
718
|
+
},
|
719
|
+
},
|
688
720
|
};
|
689
721
|
|
690
722
|
export { evmConfig };
|
@@ -131,20 +131,20 @@ exports[`stacks currency bridge scanAccounts stacks seed 1 2`] = `
|
|
131
131
|
"contract": "send-many",
|
132
132
|
"date": "2024-03-18T19:57:38.000Z",
|
133
133
|
"extra": {
|
134
|
-
"memo": "",
|
134
|
+
"memo": "123",
|
135
135
|
},
|
136
136
|
"fee": "19031",
|
137
137
|
"hash": "0x6a0a4b48b7f25954d4fa99a71da697c064e45064dd45d99ba341734d7fb9bf47",
|
138
138
|
"id": "js:2:stacks:022a460decc9dba8c452927fecb33d7ae25a8d79dc5442b84feaf8f3aa0e2b575d:-0x6a0a4b48b7f25954d4fa99a71da697c064e45064dd45d99ba341734d7fb9bf47-OUT-i0",
|
139
139
|
"recipients": [
|
140
|
-
"
|
140
|
+
"SP2DV2RVZP1A69Q6VAG5PHEQ6ZHQHZPCV84TMYNGN",
|
141
141
|
],
|
142
142
|
"senders": [
|
143
143
|
"SP3KS7VMY2ZNE6SB88PHR4SKRK2EEPHS8N8MCCBR9",
|
144
144
|
],
|
145
145
|
"transactionSequenceNumber": 0,
|
146
146
|
"type": "OUT",
|
147
|
-
"value": "
|
147
|
+
"value": "1000",
|
148
148
|
},
|
149
149
|
{
|
150
150
|
"accountId": "js:2:stacks:022a460decc9dba8c452927fecb33d7ae25a8d79dc5442b84feaf8f3aa0e2b575d:",
|
@@ -153,7 +153,7 @@ exports[`stacks currency bridge scanAccounts stacks seed 1 2`] = `
|
|
153
153
|
"contract": "send-many",
|
154
154
|
"date": "2024-03-18T19:57:38.000Z",
|
155
155
|
"extra": {
|
156
|
-
"memo": "",
|
156
|
+
"memo": "456",
|
157
157
|
},
|
158
158
|
"fee": "19031",
|
159
159
|
"hash": "0x6a0a4b48b7f25954d4fa99a71da697c064e45064dd45d99ba341734d7fb9bf47",
|
@@ -175,20 +175,20 @@ exports[`stacks currency bridge scanAccounts stacks seed 1 2`] = `
|
|
175
175
|
"contract": "send-many",
|
176
176
|
"date": "2024-03-18T19:57:38.000Z",
|
177
177
|
"extra": {
|
178
|
-
"memo": "",
|
178
|
+
"memo": "789",
|
179
179
|
},
|
180
180
|
"fee": "19031",
|
181
181
|
"hash": "0x6a0a4b48b7f25954d4fa99a71da697c064e45064dd45d99ba341734d7fb9bf47",
|
182
182
|
"id": "js:2:stacks:022a460decc9dba8c452927fecb33d7ae25a8d79dc5442b84feaf8f3aa0e2b575d:-0x6a0a4b48b7f25954d4fa99a71da697c064e45064dd45d99ba341734d7fb9bf47-OUT-i2",
|
183
183
|
"recipients": [
|
184
|
-
"
|
184
|
+
"SP1VM0XEFWBQ4ZT888FT34G30GGF52DY9YQWZCAQ0",
|
185
185
|
],
|
186
186
|
"senders": [
|
187
187
|
"SP3KS7VMY2ZNE6SB88PHR4SKRK2EEPHS8N8MCCBR9",
|
188
188
|
],
|
189
189
|
"transactionSequenceNumber": 0,
|
190
190
|
"type": "OUT",
|
191
|
-
"value": "
|
191
|
+
"value": "3000",
|
192
192
|
},
|
193
193
|
],
|
194
194
|
"recipients": [],
|
@@ -19,7 +19,7 @@ describe("sync for token transfers", () => {
|
|
19
19
|
const rawTxs = await fetchFullTxs(address);
|
20
20
|
|
21
21
|
// Contains operations for txn of type token_transfer
|
22
|
-
const operations = flatMap(rawTxs, mapTxToOps(accountId));
|
22
|
+
const operations = flatMap(rawTxs, mapTxToOps(accountId, address));
|
23
23
|
|
24
24
|
expect(operations.length).toBeTruthy();
|
25
25
|
});
|
@@ -88,15 +88,20 @@ export const fetchEstimatedFees = async (
|
|
88
88
|
};
|
89
89
|
|
90
90
|
export const fetchBlockHeight = async (): Promise<NetworkStatusResponse> => {
|
91
|
-
const data = await fetch<NetworkStatusResponse>("/extended
|
91
|
+
const data = await fetch<NetworkStatusResponse>("/extended");
|
92
92
|
return data as NetworkStatusResponse; // TODO Validate if the response fits this interface
|
93
93
|
};
|
94
94
|
|
95
95
|
export const fetchTxs = async (addr: string, offset = 0): Promise<TransactionsResponse> => {
|
96
|
-
const
|
97
|
-
|
98
|
-
|
99
|
-
|
96
|
+
const limit = 50;
|
97
|
+
try {
|
98
|
+
const response = await fetch<TransactionsResponse>(
|
99
|
+
`/extended/v2/addresses/${addr}/transactions?offset=${offset}&limit=${limit}`,
|
100
|
+
);
|
101
|
+
return response; // TODO Validate if the response fits this interface
|
102
|
+
} catch (e) {
|
103
|
+
return { limit, offset, total: 0, results: [] };
|
104
|
+
}
|
100
105
|
};
|
101
106
|
|
102
107
|
export const fetchFullTxs = async (addr: string): Promise<TransactionResponse[]> => {
|
@@ -23,39 +23,110 @@ export interface TransactionResponse {
|
|
23
23
|
tx: {
|
24
24
|
tx_id: string;
|
25
25
|
nonce: number;
|
26
|
-
tx_status: string;
|
27
|
-
tx_type: string;
|
28
26
|
fee_rate: string;
|
29
27
|
sender_address: string;
|
30
28
|
sponsored: boolean;
|
29
|
+
post_condition_mode: string;
|
30
|
+
post_conditions: Array<{
|
31
|
+
type: string;
|
32
|
+
condition_code: string;
|
33
|
+
amount: string;
|
34
|
+
principal: {
|
35
|
+
type_id: string;
|
36
|
+
address: string;
|
37
|
+
};
|
38
|
+
}>;
|
39
|
+
anchor_mode: string;
|
40
|
+
is_unanchored: boolean;
|
31
41
|
block_hash: string;
|
42
|
+
parent_block_hash: string;
|
32
43
|
block_height: number;
|
33
|
-
|
44
|
+
block_time: number;
|
45
|
+
block_time_iso: string;
|
34
46
|
burn_block_time: number;
|
47
|
+
burn_block_time_iso: string;
|
48
|
+
parent_burn_block_time: number;
|
49
|
+
parent_burn_block_time_iso: string;
|
50
|
+
canonical: boolean;
|
51
|
+
tx_index: number;
|
52
|
+
tx_status: string;
|
53
|
+
tx_result: {
|
54
|
+
hex: string;
|
55
|
+
repr: string;
|
56
|
+
};
|
57
|
+
microblock_hash: string;
|
58
|
+
microblock_sequence: number;
|
59
|
+
microblock_canonical: boolean;
|
60
|
+
event_count: number;
|
61
|
+
events: Array<any>;
|
62
|
+
execution_cost_read_count: number;
|
63
|
+
execution_cost_read_length: number;
|
64
|
+
execution_cost_runtime: number;
|
65
|
+
execution_cost_write_count: number;
|
66
|
+
execution_cost_write_length: number;
|
67
|
+
tx_type: "token_transfer" | "contract_call";
|
35
68
|
token_transfer?: {
|
36
69
|
recipient_address: string;
|
37
70
|
amount: string;
|
38
71
|
memo: string;
|
39
72
|
};
|
73
|
+
smart_contract?: {
|
74
|
+
clarity_version: number;
|
75
|
+
contract_id: string;
|
76
|
+
source_code: string;
|
77
|
+
};
|
40
78
|
contract_call?: {
|
41
79
|
contract_id: string;
|
42
80
|
function_name: string;
|
43
81
|
function_signature: string;
|
44
|
-
function_args: {
|
82
|
+
function_args: Array<{
|
45
83
|
hex: string;
|
46
84
|
repr: string;
|
47
85
|
name: string;
|
48
86
|
type: string;
|
49
|
-
}
|
87
|
+
}>;
|
50
88
|
};
|
51
89
|
};
|
52
|
-
stx_transfers: {
|
53
|
-
amount: string;
|
54
|
-
sender: string;
|
55
|
-
recipient: string;
|
56
|
-
}[];
|
57
90
|
stx_sent: string;
|
58
91
|
stx_received: string;
|
92
|
+
events: {
|
93
|
+
stx: {
|
94
|
+
transfer: number;
|
95
|
+
mint: number;
|
96
|
+
burn: number;
|
97
|
+
};
|
98
|
+
ft: {
|
99
|
+
transfer: number;
|
100
|
+
mint: number;
|
101
|
+
burn: number;
|
102
|
+
};
|
103
|
+
nft: {
|
104
|
+
transfer: number;
|
105
|
+
mint: number;
|
106
|
+
burn: number;
|
107
|
+
};
|
108
|
+
};
|
109
|
+
}
|
110
|
+
|
111
|
+
export interface DecodedSendManyFunctionArgsCV {
|
112
|
+
type: string;
|
113
|
+
value: Array<{
|
114
|
+
type: string;
|
115
|
+
value: {
|
116
|
+
memo?: {
|
117
|
+
type: string;
|
118
|
+
value: string;
|
119
|
+
};
|
120
|
+
to: {
|
121
|
+
type: string;
|
122
|
+
value: string;
|
123
|
+
};
|
124
|
+
ustx: {
|
125
|
+
type: string;
|
126
|
+
value: string;
|
127
|
+
};
|
128
|
+
};
|
129
|
+
}>;
|
59
130
|
}
|
60
131
|
|
61
132
|
export interface MempoolTransaction {
|
@@ -4,11 +4,13 @@ import {
|
|
4
4
|
makeUnsignedSTXTokenTransfer,
|
5
5
|
UnsignedTokenTransferOptions,
|
6
6
|
createMessageSignature,
|
7
|
+
deserializeCV,
|
8
|
+
cvToJSON,
|
7
9
|
} from "@stacks/transactions";
|
8
10
|
|
9
11
|
import { decodeAccountId } from "../../../../account";
|
10
12
|
import { fetchFullMempoolTxs, fetchNonce } from "../../bridge/utils/api";
|
11
|
-
import { StacksNetwork, TransactionResponse } from "./api.types";
|
13
|
+
import { DecodedSendManyFunctionArgsCV, StacksNetwork, TransactionResponse } from "./api.types";
|
12
14
|
import { getCryptoCurrencyById } from "../../../../currencies";
|
13
15
|
import { encodeOperationId, encodeSubOperationId } from "../../../../operation";
|
14
16
|
import { StacksOperation } from "../../types";
|
@@ -57,8 +59,16 @@ export const getAddress = (
|
|
57
59
|
derivationPath: string;
|
58
60
|
} => ({ address: account.freshAddress, derivationPath: account.freshAddressPath });
|
59
61
|
|
62
|
+
const getMemo = (memoHex: string): string => {
|
63
|
+
if (memoHex?.substring(0, 2) === "0x") {
|
64
|
+
return Buffer.from(memoHex.substring(2), "hex").toString().replaceAll("\x00", "");
|
65
|
+
}
|
66
|
+
|
67
|
+
return "";
|
68
|
+
};
|
69
|
+
|
60
70
|
export const mapTxToOps =
|
61
|
-
(accountID: string) =>
|
71
|
+
(accountID: string, address: string) =>
|
62
72
|
(tx: TransactionResponse): StacksOperation[] => {
|
63
73
|
try {
|
64
74
|
const {
|
@@ -70,16 +80,15 @@ export const mapTxToOps =
|
|
70
80
|
sender_address,
|
71
81
|
block_hash: blockHash,
|
72
82
|
} = tx.tx;
|
73
|
-
const { stx_received: receivedValue, stx_sent: sentValue
|
83
|
+
const { stx_received: receivedValue, stx_sent: sentValue } = tx;
|
74
84
|
|
75
|
-
|
76
|
-
|
85
|
+
let recipients: string[] = [];
|
86
|
+
if (tx.tx.tx_type === "token_transfer" && tx.tx.token_transfer) {
|
87
|
+
recipients = [tx.tx.token_transfer.recipient_address];
|
88
|
+
}
|
77
89
|
|
78
90
|
const memoHex = tx.tx.token_transfer?.memo;
|
79
|
-
|
80
|
-
if (memoHex?.substring(0, 2) === "0x") {
|
81
|
-
memo = Buffer.from(memoHex.substring(2), "hex").toString().replaceAll("\x00", "");
|
82
|
-
}
|
91
|
+
const memo: string = getMemo(memoHex ?? "");
|
83
92
|
|
84
93
|
const ops: StacksOperation[] = [];
|
85
94
|
|
@@ -87,7 +96,7 @@ export const mapTxToOps =
|
|
87
96
|
const feeToUse = new BigNumber(fee_rate || "0");
|
88
97
|
|
89
98
|
const isSending = sentValue !== "0" && receivedValue === "0";
|
90
|
-
const isReceiving = receivedValue !== "0"
|
99
|
+
const isReceiving = receivedValue !== "0";
|
91
100
|
|
92
101
|
const operationCommons = {
|
93
102
|
hash: tx_id,
|
@@ -105,26 +114,35 @@ export const mapTxToOps =
|
|
105
114
|
|
106
115
|
if (isSending) {
|
107
116
|
const type: OperationType = "OUT";
|
117
|
+
let internalOperations: StacksOperation[] | undefined = undefined;
|
118
|
+
|
119
|
+
if (tx.tx.tx_type === "contract_call" && tx.tx.contract_call) {
|
120
|
+
internalOperations = [];
|
121
|
+
const deserialized = deserializeCV(tx.tx.contract_call.function_args[0].hex);
|
122
|
+
const decodedArgs: DecodedSendManyFunctionArgsCV = cvToJSON(deserialized);
|
123
|
+
for (const [idx, t] of decodedArgs.value.entries()) {
|
124
|
+
internalOperations.push({
|
125
|
+
...operationCommons,
|
126
|
+
id: encodeSubOperationId(accountID, tx_id, type, idx),
|
127
|
+
contract: "send-many",
|
128
|
+
type,
|
129
|
+
value: new BigNumber(t.value.ustx.value),
|
130
|
+
senders: [sender_address],
|
131
|
+
recipients: [t.value.to.value],
|
132
|
+
extra: {
|
133
|
+
memo: getMemo(t.value.memo?.value ?? ""),
|
134
|
+
},
|
135
|
+
});
|
136
|
+
}
|
137
|
+
}
|
138
|
+
|
108
139
|
ops.push({
|
109
140
|
...operationCommons,
|
110
141
|
id: encodeOperationId(accountID, tx_id, type),
|
111
142
|
value: new BigNumber(sentValue),
|
112
143
|
recipients,
|
113
144
|
type,
|
114
|
-
internalOperations
|
115
|
-
stx_transfers.length > 1
|
116
|
-
? stx_transfers.map((t, idx) => {
|
117
|
-
return {
|
118
|
-
...operationCommons,
|
119
|
-
id: encodeSubOperationId(accountID, tx_id, type, idx),
|
120
|
-
contract: "send-many",
|
121
|
-
type,
|
122
|
-
value: new BigNumber(t.amount),
|
123
|
-
senders: [t.sender],
|
124
|
-
recipients: [t.recipient],
|
125
|
-
};
|
126
|
-
})
|
127
|
-
: undefined,
|
145
|
+
internalOperations,
|
128
146
|
});
|
129
147
|
}
|
130
148
|
|
@@ -134,21 +152,8 @@ export const mapTxToOps =
|
|
134
152
|
...operationCommons,
|
135
153
|
id: encodeOperationId(accountID, tx_id, type),
|
136
154
|
value: new BigNumber(receivedValue),
|
137
|
-
recipients,
|
155
|
+
recipients: recipients.length ? recipients : [address],
|
138
156
|
type,
|
139
|
-
internalOperations:
|
140
|
-
stx_transfers.length > 1
|
141
|
-
? stx_transfers.map((t, idx) => {
|
142
|
-
return {
|
143
|
-
...operationCommons,
|
144
|
-
id: encodeSubOperationId(accountID, tx_id, type, idx),
|
145
|
-
type,
|
146
|
-
value: new BigNumber(t.amount),
|
147
|
-
senders: [t.sender],
|
148
|
-
recipients: [t.recipient],
|
149
|
-
};
|
150
|
-
})
|
151
|
-
: undefined,
|
152
157
|
});
|
153
158
|
}
|
154
159
|
|
@@ -1,39 +1,43 @@
|
|
1
|
-
import flatMap from "lodash/flatMap";
|
2
1
|
import { mapTxToOps } from "./misc";
|
3
2
|
import { encodeAccountId } from "../../../../account";
|
4
|
-
import { StacksOperation } from "../../types";
|
5
3
|
import { TransactionResponse } from "./api.types";
|
4
|
+
import { fetchFullTxs } from "./api";
|
5
|
+
import { Operation } from "@ledgerhq/types-live";
|
6
|
+
|
7
|
+
const Address = "SP26AZ1JSFZQ82VH5W2NJSB2QW15EW5YKT6WMD69J";
|
6
8
|
|
7
9
|
const sendManyTransfer = {
|
8
10
|
tx: {
|
9
|
-
tx_id: "
|
10
|
-
nonce:
|
11
|
-
fee_rate: "
|
12
|
-
sender_address: "
|
11
|
+
tx_id: "0x68bdba90cdbd4e2e112fd008c8c396bd4ca365e482dc68fe25c7aeb5d8eb4c3f",
|
12
|
+
nonce: 18,
|
13
|
+
fee_rate: "500000",
|
14
|
+
sender_address: "SP26AZ1JSFZQ82VH5W2NJSB2QW15EW5YKT6WMD69J",
|
13
15
|
sponsored: false,
|
14
16
|
post_condition_mode: "deny",
|
15
17
|
post_conditions: [
|
16
18
|
{
|
17
19
|
type: "stx",
|
18
20
|
condition_code: "sent_equal_to",
|
19
|
-
amount: "
|
21
|
+
amount: "345000",
|
20
22
|
principal: {
|
21
23
|
type_id: "principal_standard",
|
22
|
-
address: "
|
24
|
+
address: "SP26AZ1JSFZQ82VH5W2NJSB2QW15EW5YKT6WMD69J",
|
23
25
|
},
|
24
26
|
},
|
25
27
|
],
|
26
28
|
anchor_mode: "any",
|
27
29
|
is_unanchored: false,
|
28
|
-
block_hash: "
|
29
|
-
parent_block_hash: "
|
30
|
-
block_height:
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
30
|
+
block_hash: "0xc8dd294972d86b09d4226fe99f8bfcdf2c55a7280ca87b7dc8b0fd119a7059f1",
|
31
|
+
parent_block_hash: "0xc8f2c105e37544ce27a3a470651d950c6e8fe5f6c072aef653e7ea1fbd97a429",
|
32
|
+
block_height: 137791,
|
33
|
+
block_time: 1706802438,
|
34
|
+
block_time_iso: "2024-02-01T15:47:18.000Z",
|
35
|
+
burn_block_time: 1706802438,
|
36
|
+
burn_block_time_iso: "2024-02-01T15:47:18.000Z",
|
37
|
+
parent_burn_block_time: 1706801557,
|
38
|
+
parent_burn_block_time_iso: "2024-02-01T15:32:37.000Z",
|
35
39
|
canonical: true,
|
36
|
-
tx_index:
|
40
|
+
tx_index: 121,
|
37
41
|
tx_status: "success",
|
38
42
|
tx_result: {
|
39
43
|
hex: "0x0703",
|
@@ -53,68 +57,67 @@ const sendManyTransfer = {
|
|
53
57
|
contract_call: {
|
54
58
|
contract_id: "SP3FBR2AGK5H9QBDH3EEN6DF8EK8JY7RX8QJ5SVTE.send-many-memo",
|
55
59
|
function_name: "send-many",
|
56
|
-
function_signature:
|
57
|
-
"(define-public (send-many (recipients (list 200 (tuple (memo (buff 34)) (to principal) (ustx uint))))))",
|
60
|
+
function_signature: "",
|
58
61
|
function_args: [
|
59
62
|
{
|
60
|
-
hex: "
|
61
|
-
repr: "(list (tuple (memo
|
62
|
-
name: "
|
63
|
-
type: "(list
|
63
|
+
hex: "0x0b000000030c00000003046d656d6f020000000333333302746f05162bd4fbc3d1218275b9ae37c58a8dbed9a952c35c047573747801000000000000000000000000000027100c00000003046d656d6f020000000334343402746f051601a0369ffa2faa8fe74faada53e2e3d215b4d42a047573747801000000000000000000000000000088b80c00000003046d656d6f020000000335353502746f051660cc6b74d6d317918d0a7717069da56d775d817e047573747801000000000000000000000000000493e0",
|
64
|
+
repr: "(list (tuple (memo 0x333333) (to 'SPNX9YY3T4GR4XDSNRVWB2MDQVCTJMP3BGT7VCZA) (ustx u10000)) (tuple (memo 0x343434) (to 'SPT0DMZZ8QTN3Z79YNDMMZ2WF91BD6M59S9Z10Y) (ustx u35000)) (tuple (memo 0x353535) (to 'SP1GCRTVMTV9HF4CD19VHE1MXMNPQEQC1FT6YWF5Y) (ustx u300000)))",
|
65
|
+
name: "",
|
66
|
+
type: "(list 3 (tuple (memo (buff 3)) (to principal) (ustx uint)))",
|
64
67
|
},
|
65
68
|
],
|
66
69
|
},
|
67
70
|
},
|
68
|
-
stx_sent: "
|
71
|
+
stx_sent: "845000",
|
69
72
|
stx_received: "0",
|
70
|
-
|
71
|
-
{
|
72
|
-
|
73
|
-
|
74
|
-
|
73
|
+
events: {
|
74
|
+
stx: {
|
75
|
+
transfer: 3,
|
76
|
+
mint: 0,
|
77
|
+
burn: 0,
|
75
78
|
},
|
76
|
-
{
|
77
|
-
|
78
|
-
|
79
|
-
|
79
|
+
ft: {
|
80
|
+
transfer: 0,
|
81
|
+
mint: 0,
|
82
|
+
burn: 0,
|
80
83
|
},
|
81
|
-
{
|
82
|
-
|
83
|
-
|
84
|
-
|
84
|
+
nft: {
|
85
|
+
transfer: 0,
|
86
|
+
mint: 0,
|
87
|
+
burn: 0,
|
85
88
|
},
|
86
|
-
|
87
|
-
ft_transfers: [],
|
88
|
-
nft_transfers: [],
|
89
|
+
},
|
89
90
|
};
|
90
91
|
|
91
92
|
const basicTransfer = {
|
92
93
|
tx: {
|
93
|
-
tx_id: "
|
94
|
-
nonce:
|
95
|
-
fee_rate: "
|
96
|
-
sender_address: "
|
94
|
+
tx_id: "0x84254bb1e50b9e4f1dd48161ba5e87dff4ba8718117e8c364769067614dfb99a",
|
95
|
+
nonce: 22,
|
96
|
+
fee_rate: "125250",
|
97
|
+
sender_address: "SP26AZ1JSFZQ82VH5W2NJSB2QW15EW5YKT6WMD69J",
|
97
98
|
sponsored: false,
|
98
99
|
post_condition_mode: "deny",
|
99
100
|
post_conditions: [],
|
100
101
|
anchor_mode: "any",
|
101
102
|
is_unanchored: false,
|
102
|
-
block_hash: "
|
103
|
-
parent_block_hash: "
|
104
|
-
block_height:
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
103
|
+
block_hash: "0xd3272fbbc264eec8f8b7857541d7a5e6c043b54dd799274544a72d185dc34f1d",
|
104
|
+
parent_block_hash: "0x7bc3a3adae166f4a876697ad4c4f924d29dcea2c84607fc7765c0ed0855c3e90",
|
105
|
+
block_height: 151738,
|
106
|
+
block_time: 1716831904,
|
107
|
+
block_time_iso: "2024-05-27T17:45:04.000Z",
|
108
|
+
burn_block_time: 1716831849,
|
109
|
+
burn_block_time_iso: "2024-05-27T17:44:09.000Z",
|
110
|
+
parent_burn_block_time: 1716831377,
|
111
|
+
parent_burn_block_time_iso: "2024-05-27T17:36:17.000Z",
|
109
112
|
canonical: true,
|
110
|
-
tx_index:
|
113
|
+
tx_index: 29,
|
111
114
|
tx_status: "success",
|
112
115
|
tx_result: {
|
113
116
|
hex: "0x0703",
|
114
117
|
repr: "(ok true)",
|
115
118
|
},
|
116
|
-
microblock_hash: "
|
117
|
-
microblock_sequence:
|
119
|
+
microblock_hash: "0x",
|
120
|
+
microblock_sequence: 2147483647,
|
118
121
|
microblock_canonical: true,
|
119
122
|
event_count: 1,
|
120
123
|
events: [],
|
@@ -125,22 +128,30 @@ const basicTransfer = {
|
|
125
128
|
execution_cost_write_length: 0,
|
126
129
|
tx_type: "token_transfer",
|
127
130
|
token_transfer: {
|
128
|
-
recipient_address: "
|
129
|
-
amount: "
|
130
|
-
memo: "
|
131
|
+
recipient_address: "SPNX9YY3T4GR4XDSNRVWB2MDQVCTJMP3BGT7VCZA",
|
132
|
+
amount: "827695",
|
133
|
+
memo: "0x31323333333334000000000000000000000000000000000000000000000000000000",
|
131
134
|
},
|
132
135
|
},
|
133
|
-
stx_sent: "
|
134
|
-
stx_received: "
|
135
|
-
|
136
|
-
{
|
137
|
-
|
138
|
-
|
139
|
-
|
136
|
+
stx_sent: "952945",
|
137
|
+
stx_received: "0",
|
138
|
+
events: {
|
139
|
+
stx: {
|
140
|
+
transfer: 1,
|
141
|
+
mint: 0,
|
142
|
+
burn: 0,
|
143
|
+
},
|
144
|
+
ft: {
|
145
|
+
transfer: 0,
|
146
|
+
mint: 0,
|
147
|
+
burn: 0,
|
140
148
|
},
|
141
|
-
|
142
|
-
|
143
|
-
|
149
|
+
nft: {
|
150
|
+
transfer: 0,
|
151
|
+
mint: 0,
|
152
|
+
burn: 0,
|
153
|
+
},
|
154
|
+
},
|
144
155
|
};
|
145
156
|
|
146
157
|
describe("operation building from raw", () => {
|
@@ -154,9 +165,8 @@ describe("operation building from raw", () => {
|
|
154
165
|
});
|
155
166
|
|
156
167
|
// Contains operations for txn of type token_transfer
|
157
|
-
const operations =
|
158
|
-
|
159
|
-
mapTxToOps(accountId),
|
168
|
+
const operations = ([sendManyTransfer, basicTransfer] as any).flatMap(
|
169
|
+
mapTxToOps(accountId, Address),
|
160
170
|
);
|
161
171
|
|
162
172
|
expect(operations.length).toBe(2);
|
@@ -169,9 +179,17 @@ describe("operation building from raw", () => {
|
|
169
179
|
expect(opSenMany.senders).toHaveLength(1);
|
170
180
|
expect(opSenMany.recipients).toHaveLength(0);
|
171
181
|
|
172
|
-
expect(opBasic.type).toBe("
|
182
|
+
expect(opBasic.type).toBe("OUT");
|
173
183
|
expect(opBasic.internalOperations).toBeUndefined();
|
174
184
|
expect(opBasic.senders).toHaveLength(1);
|
175
185
|
expect(opBasic.recipients).toHaveLength(1);
|
176
186
|
});
|
177
187
|
});
|
188
|
+
|
189
|
+
test("convert raw transactions to live operations", async () => {
|
190
|
+
const rawTxs: TransactionResponse[] = await fetchFullTxs(Address);
|
191
|
+
const operations: Operation[] = rawTxs.flatMap(mapTxToOps("dummyAccountID", Address));
|
192
|
+
|
193
|
+
expect(operations).toBeDefined();
|
194
|
+
expect(operations.length).toBeGreaterThan(0);
|
195
|
+
});
|
@@ -48,7 +48,7 @@ export const getAccountShape: GetAccountShape = async info => {
|
|
48
48
|
freshAddress: address,
|
49
49
|
balance,
|
50
50
|
spendableBalance,
|
51
|
-
operations: rawTxs.flatMap(mapTxToOps(accountId)),
|
51
|
+
operations: rawTxs.flatMap(mapTxToOps(accountId, address)),
|
52
52
|
blockHeight: blockHeight.chain_tip.block_height,
|
53
53
|
};
|
54
54
|
|
@@ -215,8 +215,8 @@ export const createTronTransaction = async (
|
|
215
215
|
owner_address: decode58Check(account.freshAddress),
|
216
216
|
};
|
217
217
|
const url = `${getBaseApiUrl()}/wallet/triggersmartcontract`;
|
218
|
-
const
|
219
|
-
return
|
218
|
+
const { transaction: preparedTransaction } = await post(url, txData);
|
219
|
+
return extendTronTxExpirationTimeBy10mn(preparedTransaction);
|
220
220
|
} else {
|
221
221
|
// trx/trc10
|
222
222
|
const txData: SendTransactionData = {
|