@ledgerhq/live-common 34.47.0-nightly.8 → 34.47.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/bridge/crypto-assets/index.d.ts.map +1 -1
- package/lib/bridge/crypto-assets/index.js +0 -4
- package/lib/bridge/crypto-assets/index.js.map +1 -1
- package/lib/bridge/crypto-assets/index.test.js +0 -36
- package/lib/bridge/crypto-assets/index.test.js.map +1 -1
- package/lib/bridge/generic-alpaca/alpaca/index.d.ts.map +1 -1
- package/lib/bridge/generic-alpaca/alpaca/index.js +1 -6
- package/lib/bridge/generic-alpaca/alpaca/index.js.map +1 -1
- package/lib/bridge/generic-alpaca/alpaca/network/network-alpaca.js +1 -1
- package/lib/bridge/generic-alpaca/alpaca/network/network-alpaca.js.map +1 -1
- package/lib/bridge/generic-alpaca/buildSubAccounts.d.ts +3 -2
- package/lib/bridge/generic-alpaca/buildSubAccounts.d.ts.map +1 -1
- package/lib/bridge/generic-alpaca/buildSubAccounts.js +14 -4
- package/lib/bridge/generic-alpaca/buildSubAccounts.js.map +1 -1
- package/lib/bridge/generic-alpaca/getAccountShape.d.ts.map +1 -1
- package/lib/bridge/generic-alpaca/getAccountShape.js +4 -4
- package/lib/bridge/generic-alpaca/getAccountShape.js.map +1 -1
- package/lib/bridge/generic-alpaca/getTransactionStatus.d.ts.map +1 -1
- package/lib/bridge/generic-alpaca/getTransactionStatus.js +1 -0
- package/lib/bridge/generic-alpaca/getTransactionStatus.js.map +1 -1
- package/lib/bridge/generic-alpaca/prepareTransaction.d.ts +3 -14
- package/lib/bridge/generic-alpaca/prepareTransaction.d.ts.map +1 -1
- package/lib/bridge/generic-alpaca/prepareTransaction.js +5 -21
- package/lib/bridge/generic-alpaca/prepareTransaction.js.map +1 -1
- package/lib/bridge/generic-alpaca/tests/utils.test.d.ts.map +1 -0
- package/lib/bridge/generic-alpaca/tests/utils.test.js +20 -0
- package/lib/bridge/generic-alpaca/tests/utils.test.js.map +1 -0
- package/lib/bridge/generic-alpaca/utils.d.ts.map +1 -1
- package/lib/bridge/generic-alpaca/utils.js +5 -6
- package/lib/bridge/generic-alpaca/utils.js.map +1 -1
- package/lib/e2e/enum/DeviceLabels.d.ts +1 -3
- package/lib/e2e/enum/DeviceLabels.d.ts.map +1 -1
- package/lib/e2e/enum/DeviceLabels.js +0 -2
- package/lib/e2e/enum/DeviceLabels.js.map +1 -1
- package/lib/e2e/families/tezos.d.ts.map +1 -1
- package/lib/e2e/families/tezos.js +0 -2
- package/lib/e2e/families/tezos.js.map +1 -1
- package/lib/e2e/index.d.ts +6 -4
- package/lib/e2e/index.d.ts.map +1 -1
- package/lib/e2e/speculos.d.ts +0 -1
- package/lib/e2e/speculos.d.ts.map +1 -1
- package/lib/e2e/speculos.js +2 -12
- package/lib/e2e/speculos.js.map +1 -1
- package/lib/exchange/platform/transfer/completeExchange.d.ts.map +1 -1
- package/lib/exchange/platform/transfer/completeExchange.js +5 -3
- package/lib/exchange/platform/transfer/completeExchange.js.map +1 -1
- package/lib/exchange/swap/completeExchange.d.ts.map +1 -1
- package/lib/exchange/swap/completeExchange.js +2 -5
- package/lib/exchange/swap/completeExchange.js.map +1 -1
- package/lib/exchange/swap/initSwap.d.ts.map +1 -1
- package/lib/exchange/swap/initSwap.js +2 -5
- package/lib/exchange/swap/initSwap.js.map +1 -1
- package/lib/families/canton/config.d.ts.map +1 -1
- package/lib/families/canton/config.js +0 -4
- package/lib/families/canton/config.js.map +1 -1
- package/lib/families/solana/setup.d.ts.map +1 -1
- package/lib/families/solana/setup.js +0 -9
- package/lib/families/solana/setup.js.map +1 -1
- package/lib/featureFlags/defaultFeatures.d.ts.map +1 -1
- package/lib/featureFlags/defaultFeatures.js +2 -1
- package/lib/featureFlags/defaultFeatures.js.map +1 -1
- package/lib/featureFlags/useFeature.d.ts +1 -1
- package/lib/featureFlags/useFeature.d.ts.map +1 -1
- package/lib/modularDrawer/data/state-manager/api.d.ts +37 -727
- package/lib/modularDrawer/data/state-manager/api.d.ts.map +1 -1
- package/lib/modularDrawer/data/state-manager/api.js +17 -38
- package/lib/modularDrawer/data/state-manager/api.js.map +1 -1
- package/lib/modularDrawer/hooks/__test__/useAssetsData.test.js +78 -134
- package/lib/modularDrawer/hooks/__test__/useAssetsData.test.js.map +1 -1
- package/{lib-es/modularDrawer/hooks → lib/modularDrawer/hooks/modules}/useAssetAccountCounts.d.ts +1 -1
- package/lib/modularDrawer/hooks/modules/useAssetAccountCounts.d.ts.map +1 -0
- package/lib/modularDrawer/hooks/{useAssetAccountCounts.js → modules/useAssetAccountCounts.js} +1 -1
- package/lib/modularDrawer/hooks/modules/useAssetAccountCounts.js.map +1 -0
- package/lib/modularDrawer/hooks/modules/useLeftApyModule.d.ts +3 -3
- package/lib/modularDrawer/hooks/modules/useLeftApyModule.d.ts.map +1 -1
- package/lib/modularDrawer/hooks/modules/useLeftApyModule.js +10 -59
- package/lib/modularDrawer/hooks/modules/useLeftApyModule.js.map +1 -1
- package/lib/modularDrawer/hooks/useAssetsData.d.ts +6 -10
- package/lib/modularDrawer/hooks/useAssetsData.d.ts.map +1 -1
- package/lib/modularDrawer/hooks/useAssetsData.js +17 -40
- package/lib/modularDrawer/hooks/useAssetsData.js.map +1 -1
- package/lib/modularDrawer/types.d.ts +2 -0
- package/lib/modularDrawer/types.d.ts.map +1 -0
- package/lib/modularDrawer/types.js +3 -0
- package/lib/modularDrawer/types.js.map +1 -0
- package/lib/modularDrawer/utils/type.d.ts +1 -89
- package/lib/modularDrawer/utils/type.d.ts.map +1 -1
- package/lib/wallet-api/Exchange/server.js +2 -2
- package/lib/wallet-api/Exchange/server.js.map +1 -1
- package/lib/wallet-api/react.d.ts +0 -2
- package/lib/wallet-api/react.d.ts.map +1 -1
- package/lib/wallet-api/react.js +1 -3
- package/lib/wallet-api/react.js.map +1 -1
- package/lib-es/bridge/crypto-assets/index.d.ts.map +1 -1
- package/lib-es/bridge/crypto-assets/index.js +0 -4
- package/lib-es/bridge/crypto-assets/index.js.map +1 -1
- package/lib-es/bridge/crypto-assets/index.test.js +0 -36
- package/lib-es/bridge/crypto-assets/index.test.js.map +1 -1
- package/lib-es/bridge/generic-alpaca/alpaca/index.d.ts.map +1 -1
- package/lib-es/bridge/generic-alpaca/alpaca/index.js +1 -6
- package/lib-es/bridge/generic-alpaca/alpaca/index.js.map +1 -1
- package/lib-es/bridge/generic-alpaca/alpaca/network/network-alpaca.js +1 -1
- package/lib-es/bridge/generic-alpaca/alpaca/network/network-alpaca.js.map +1 -1
- package/lib-es/bridge/generic-alpaca/buildSubAccounts.d.ts +3 -2
- package/lib-es/bridge/generic-alpaca/buildSubAccounts.d.ts.map +1 -1
- package/lib-es/bridge/generic-alpaca/buildSubAccounts.js +12 -4
- package/lib-es/bridge/generic-alpaca/buildSubAccounts.js.map +1 -1
- package/lib-es/bridge/generic-alpaca/getAccountShape.d.ts.map +1 -1
- package/lib-es/bridge/generic-alpaca/getAccountShape.js +3 -3
- package/lib-es/bridge/generic-alpaca/getAccountShape.js.map +1 -1
- package/lib-es/bridge/generic-alpaca/getTransactionStatus.d.ts.map +1 -1
- package/lib-es/bridge/generic-alpaca/getTransactionStatus.js +1 -0
- package/lib-es/bridge/generic-alpaca/getTransactionStatus.js.map +1 -1
- package/lib-es/bridge/generic-alpaca/prepareTransaction.d.ts +3 -14
- package/lib-es/bridge/generic-alpaca/prepareTransaction.d.ts.map +1 -1
- package/lib-es/bridge/generic-alpaca/prepareTransaction.js +5 -21
- package/lib-es/bridge/generic-alpaca/prepareTransaction.js.map +1 -1
- package/lib-es/bridge/generic-alpaca/tests/utils.test.d.ts.map +1 -0
- package/lib-es/bridge/generic-alpaca/tests/utils.test.js +18 -0
- package/lib-es/bridge/generic-alpaca/tests/utils.test.js.map +1 -0
- package/lib-es/bridge/generic-alpaca/utils.d.ts.map +1 -1
- package/lib-es/bridge/generic-alpaca/utils.js +5 -6
- package/lib-es/bridge/generic-alpaca/utils.js.map +1 -1
- package/lib-es/e2e/enum/DeviceLabels.d.ts +1 -3
- package/lib-es/e2e/enum/DeviceLabels.d.ts.map +1 -1
- package/lib-es/e2e/enum/DeviceLabels.js +0 -2
- package/lib-es/e2e/enum/DeviceLabels.js.map +1 -1
- package/lib-es/e2e/families/tezos.d.ts.map +1 -1
- package/lib-es/e2e/families/tezos.js +0 -2
- package/lib-es/e2e/families/tezos.js.map +1 -1
- package/lib-es/e2e/index.d.ts +6 -4
- package/lib-es/e2e/index.d.ts.map +1 -1
- package/lib-es/e2e/speculos.d.ts +0 -1
- package/lib-es/e2e/speculos.d.ts.map +1 -1
- package/lib-es/e2e/speculos.js +1 -10
- package/lib-es/e2e/speculos.js.map +1 -1
- package/lib-es/exchange/platform/transfer/completeExchange.d.ts.map +1 -1
- package/lib-es/exchange/platform/transfer/completeExchange.js +2 -3
- package/lib-es/exchange/platform/transfer/completeExchange.js.map +1 -1
- package/lib-es/exchange/swap/completeExchange.d.ts.map +1 -1
- package/lib-es/exchange/swap/completeExchange.js +2 -5
- package/lib-es/exchange/swap/completeExchange.js.map +1 -1
- package/lib-es/exchange/swap/initSwap.d.ts.map +1 -1
- package/lib-es/exchange/swap/initSwap.js +2 -5
- package/lib-es/exchange/swap/initSwap.js.map +1 -1
- package/lib-es/families/canton/config.d.ts.map +1 -1
- package/lib-es/families/canton/config.js +0 -4
- package/lib-es/families/canton/config.js.map +1 -1
- package/lib-es/families/solana/setup.d.ts.map +1 -1
- package/lib-es/families/solana/setup.js +0 -9
- package/lib-es/families/solana/setup.js.map +1 -1
- package/lib-es/featureFlags/defaultFeatures.d.ts.map +1 -1
- package/lib-es/featureFlags/defaultFeatures.js +2 -1
- package/lib-es/featureFlags/defaultFeatures.js.map +1 -1
- package/lib-es/featureFlags/useFeature.d.ts +1 -1
- package/lib-es/featureFlags/useFeature.d.ts.map +1 -1
- package/lib-es/modularDrawer/data/state-manager/api.d.ts +37 -727
- package/lib-es/modularDrawer/data/state-manager/api.d.ts.map +1 -1
- package/lib-es/modularDrawer/data/state-manager/api.js +14 -35
- package/lib-es/modularDrawer/data/state-manager/api.js.map +1 -1
- package/lib-es/modularDrawer/hooks/__test__/useAssetsData.test.js +79 -135
- package/lib-es/modularDrawer/hooks/__test__/useAssetsData.test.js.map +1 -1
- package/{lib/modularDrawer/hooks → lib-es/modularDrawer/hooks/modules}/useAssetAccountCounts.d.ts +1 -1
- package/lib-es/modularDrawer/hooks/modules/useAssetAccountCounts.d.ts.map +1 -0
- package/lib-es/modularDrawer/hooks/{useAssetAccountCounts.js → modules/useAssetAccountCounts.js} +1 -1
- package/lib-es/modularDrawer/hooks/modules/useAssetAccountCounts.js.map +1 -0
- package/lib-es/modularDrawer/hooks/modules/useLeftApyModule.d.ts +3 -3
- package/lib-es/modularDrawer/hooks/modules/useLeftApyModule.d.ts.map +1 -1
- package/lib-es/modularDrawer/hooks/modules/useLeftApyModule.js +8 -37
- package/lib-es/modularDrawer/hooks/modules/useLeftApyModule.js.map +1 -1
- package/lib-es/modularDrawer/hooks/useAssetsData.d.ts +6 -10
- package/lib-es/modularDrawer/hooks/useAssetsData.d.ts.map +1 -1
- package/lib-es/modularDrawer/hooks/useAssetsData.js +19 -42
- package/lib-es/modularDrawer/hooks/useAssetsData.js.map +1 -1
- package/lib-es/modularDrawer/types.d.ts +2 -0
- package/lib-es/modularDrawer/types.d.ts.map +1 -0
- package/lib-es/modularDrawer/types.js +2 -0
- package/lib-es/modularDrawer/types.js.map +1 -0
- package/lib-es/modularDrawer/utils/type.d.ts +1 -89
- package/lib-es/modularDrawer/utils/type.d.ts.map +1 -1
- package/lib-es/wallet-api/Exchange/server.js +2 -2
- package/lib-es/wallet-api/Exchange/server.js.map +1 -1
- package/lib-es/wallet-api/react.d.ts +0 -2
- package/lib-es/wallet-api/react.d.ts.map +1 -1
- package/lib-es/wallet-api/react.js +1 -3
- package/lib-es/wallet-api/react.js.map +1 -1
- package/package.json +77 -77
- package/src/bridge/crypto-assets/index.test.ts +0 -47
- package/src/bridge/crypto-assets/index.ts +0 -5
- package/src/bridge/generic-alpaca/alpaca/index.ts +1 -14
- package/src/bridge/generic-alpaca/alpaca/network/network-alpaca.ts +1 -1
- package/src/bridge/generic-alpaca/buildSubAccounts.ts +14 -5
- package/src/bridge/generic-alpaca/getAccountShape.ts +4 -3
- package/src/bridge/generic-alpaca/getTransactionStatus.ts +1 -0
- package/src/bridge/generic-alpaca/prepareTransaction.ts +17 -44
- package/src/bridge/generic-alpaca/tests/utils.test.ts +19 -0
- package/src/bridge/generic-alpaca/utils.ts +5 -7
- package/src/e2e/enum/DeviceLabels.ts +0 -2
- package/src/e2e/families/tezos.ts +0 -2
- package/src/e2e/speculos.ts +1 -11
- package/src/exchange/platform/transfer/completeExchange.ts +2 -3
- package/src/exchange/swap/completeExchange.ts +2 -5
- package/src/exchange/swap/initSwap.ts +4 -5
- package/src/families/canton/config.ts +0 -5
- package/src/families/solana/setup.ts +0 -9
- package/src/featureFlags/defaultFeatures.ts +2 -1
- package/src/modularDrawer/data/state-manager/api.ts +27 -42
- package/src/modularDrawer/hooks/__test__/useAssetsData.test.ts +80 -141
- package/src/modularDrawer/hooks/{useAssetAccountCounts.tsx → modules/useAssetAccountCounts.tsx} +2 -2
- package/src/modularDrawer/hooks/modules/useLeftApyModule.tsx +9 -42
- package/src/modularDrawer/hooks/useAssetsData.ts +22 -59
- package/src/modularDrawer/types.ts +1 -0
- package/src/modularDrawer/utils/type.ts +0 -97
- package/src/wallet-api/Exchange/server.ts +2 -2
- package/src/wallet-api/react.ts +1 -5
- package/lib/bridge/crypto-assets/cal-integration.d.ts +0 -4
- package/lib/bridge/crypto-assets/cal-integration.d.ts.map +0 -1
- package/lib/bridge/crypto-assets/cal-integration.js +0 -26
- package/lib/bridge/crypto-assets/cal-integration.js.map +0 -1
- package/lib/bridge/crypto-assets/cal-integration.test.d.ts +0 -2
- package/lib/bridge/crypto-assets/cal-integration.test.d.ts.map +0 -1
- package/lib/bridge/crypto-assets/cal-integration.test.js +0 -45
- package/lib/bridge/crypto-assets/cal-integration.test.js.map +0 -1
- package/lib/bridge/crypto-assets/cal-store.d.ts +0 -14
- package/lib/bridge/crypto-assets/cal-store.d.ts.map +0 -1
- package/lib/bridge/crypto-assets/cal-store.js +0 -58
- package/lib/bridge/crypto-assets/cal-store.js.map +0 -1
- package/lib/bridge/crypto-assets/cal-store.test.d.ts +0 -2
- package/lib/bridge/crypto-assets/cal-store.test.d.ts.map +0 -1
- package/lib/bridge/crypto-assets/cal-store.test.js +0 -70
- package/lib/bridge/crypto-assets/cal-store.test.js.map +0 -1
- package/lib/bridge/generic-alpaca/alpaca/index.unit.test.d.ts +0 -2
- package/lib/bridge/generic-alpaca/alpaca/index.unit.test.d.ts.map +0 -1
- package/lib/bridge/generic-alpaca/alpaca/index.unit.test.js +0 -89
- package/lib/bridge/generic-alpaca/alpaca/index.unit.test.js.map +0 -1
- package/lib/bridge/generic-alpaca/utils.test.d.ts.map +0 -1
- package/lib/bridge/generic-alpaca/utils.test.js +0 -123
- package/lib/bridge/generic-alpaca/utils.test.js.map +0 -1
- package/lib/modularDrawer/__mocks__/dada.mock.d.ts +0 -3336
- package/lib/modularDrawer/__mocks__/dada.mock.d.ts.map +0 -1
- package/lib/modularDrawer/__mocks__/dada.mock.js +0 -3879
- package/lib/modularDrawer/__mocks__/dada.mock.js.map +0 -1
- package/lib/modularDrawer/data/entities/interestRateSelectors.d.ts +0 -16
- package/lib/modularDrawer/data/entities/interestRateSelectors.d.ts.map +0 -1
- package/lib/modularDrawer/data/entities/interestRateSelectors.js +0 -21
- package/lib/modularDrawer/data/entities/interestRateSelectors.js.map +0 -1
- package/lib/modularDrawer/data/state-manager/types.d.ts +0 -24
- package/lib/modularDrawer/data/state-manager/types.d.ts.map +0 -1
- package/lib/modularDrawer/data/state-manager/types.js +0 -13
- package/lib/modularDrawer/data/state-manager/types.js.map +0 -1
- package/lib/modularDrawer/hooks/useAssetAccountCounts.d.ts.map +0 -1
- package/lib/modularDrawer/hooks/useAssetAccountCounts.js.map +0 -1
- package/lib/modularDrawer/hooks/useLeftAccounts.d.ts +0 -13
- package/lib/modularDrawer/hooks/useLeftAccounts.d.ts.map +0 -1
- package/lib/modularDrawer/hooks/useLeftAccounts.js +0 -15
- package/lib/modularDrawer/hooks/useLeftAccounts.js.map +0 -1
- package/lib/modularDrawer/hooks/useLeftAccountsApy.d.ts +0 -6
- package/lib/modularDrawer/hooks/useLeftAccountsApy.d.ts.map +0 -1
- package/lib/modularDrawer/hooks/useLeftAccountsApy.js +0 -19
- package/lib/modularDrawer/hooks/useLeftAccountsApy.js.map +0 -1
- package/lib/modularDrawer/hooks/useLeftApy.d.ts +0 -54
- package/lib/modularDrawer/hooks/useLeftApy.d.ts.map +0 -1
- package/lib/modularDrawer/hooks/useLeftApy.js +0 -15
- package/lib/modularDrawer/hooks/useLeftApy.js.map +0 -1
- package/lib/modularDrawer/hooks/useRightBalanceAsset.d.ts +0 -57
- package/lib/modularDrawer/hooks/useRightBalanceAsset.d.ts.map +0 -1
- package/lib/modularDrawer/hooks/useRightBalanceAsset.js +0 -87
- package/lib/modularDrawer/hooks/useRightBalanceAsset.js.map +0 -1
- package/lib/modularDrawer/hooks/useRightBalanceNetwork.d.ts +0 -63
- package/lib/modularDrawer/hooks/useRightBalanceNetwork.d.ts.map +0 -1
- package/lib/modularDrawer/hooks/useRightBalanceNetwork.js +0 -66
- package/lib/modularDrawer/hooks/useRightBalanceNetwork.js.map +0 -1
- package/lib/modularDrawer/modules/createAssetConfiguration.d.ts +0 -4
- package/lib/modularDrawer/modules/createAssetConfiguration.d.ts.map +0 -1
- package/lib/modularDrawer/modules/createAssetConfiguration.js +0 -41
- package/lib/modularDrawer/modules/createAssetConfiguration.js.map +0 -1
- package/lib/modularDrawer/modules/createNetworkConfiguration.d.ts +0 -6
- package/lib/modularDrawer/modules/createNetworkConfiguration.d.ts.map +0 -1
- package/lib/modularDrawer/modules/createNetworkConfiguration.js +0 -56
- package/lib/modularDrawer/modules/createNetworkConfiguration.js.map +0 -1
- package/lib/modularDrawer/utils/buildProviderCurrenciesMap.d.ts +0 -9
- package/lib/modularDrawer/utils/buildProviderCurrenciesMap.d.ts.map +0 -1
- package/lib/modularDrawer/utils/buildProviderCurrenciesMap.js +0 -17
- package/lib/modularDrawer/utils/buildProviderCurrenciesMap.js.map +0 -1
- package/lib/modularDrawer/utils/getLoadingStatus.d.ts +0 -9
- package/lib/modularDrawer/utils/getLoadingStatus.d.ts.map +0 -1
- package/lib/modularDrawer/utils/getLoadingStatus.js +0 -18
- package/lib/modularDrawer/utils/getLoadingStatus.js.map +0 -1
- package/lib/modularDrawer/utils/sortByBalance.d.ts +0 -6
- package/lib/modularDrawer/utils/sortByBalance.d.ts.map +0 -1
- package/lib/modularDrawer/utils/sortByBalance.js +0 -32
- package/lib/modularDrawer/utils/sortByBalance.js.map +0 -1
- package/lib-es/bridge/crypto-assets/cal-integration.d.ts +0 -4
- package/lib-es/bridge/crypto-assets/cal-integration.d.ts.map +0 -1
- package/lib-es/bridge/crypto-assets/cal-integration.js +0 -21
- package/lib-es/bridge/crypto-assets/cal-integration.js.map +0 -1
- package/lib-es/bridge/crypto-assets/cal-integration.test.d.ts +0 -2
- package/lib-es/bridge/crypto-assets/cal-integration.test.d.ts.map +0 -1
- package/lib-es/bridge/crypto-assets/cal-integration.test.js +0 -43
- package/lib-es/bridge/crypto-assets/cal-integration.test.js.map +0 -1
- package/lib-es/bridge/crypto-assets/cal-store.d.ts +0 -14
- package/lib-es/bridge/crypto-assets/cal-store.d.ts.map +0 -1
- package/lib-es/bridge/crypto-assets/cal-store.js +0 -54
- package/lib-es/bridge/crypto-assets/cal-store.js.map +0 -1
- package/lib-es/bridge/crypto-assets/cal-store.test.d.ts +0 -2
- package/lib-es/bridge/crypto-assets/cal-store.test.d.ts.map +0 -1
- package/lib-es/bridge/crypto-assets/cal-store.test.js +0 -68
- package/lib-es/bridge/crypto-assets/cal-store.test.js.map +0 -1
- package/lib-es/bridge/generic-alpaca/alpaca/index.unit.test.d.ts +0 -2
- package/lib-es/bridge/generic-alpaca/alpaca/index.unit.test.d.ts.map +0 -1
- package/lib-es/bridge/generic-alpaca/alpaca/index.unit.test.js +0 -64
- package/lib-es/bridge/generic-alpaca/alpaca/index.unit.test.js.map +0 -1
- package/lib-es/bridge/generic-alpaca/utils.test.d.ts.map +0 -1
- package/lib-es/bridge/generic-alpaca/utils.test.js +0 -118
- package/lib-es/bridge/generic-alpaca/utils.test.js.map +0 -1
- package/lib-es/modularDrawer/__mocks__/dada.mock.d.ts +0 -3336
- package/lib-es/modularDrawer/__mocks__/dada.mock.d.ts.map +0 -1
- package/lib-es/modularDrawer/__mocks__/dada.mock.js +0 -3876
- package/lib-es/modularDrawer/__mocks__/dada.mock.js.map +0 -1
- package/lib-es/modularDrawer/data/entities/interestRateSelectors.d.ts +0 -16
- package/lib-es/modularDrawer/data/entities/interestRateSelectors.d.ts.map +0 -1
- package/lib-es/modularDrawer/data/entities/interestRateSelectors.js +0 -18
- package/lib-es/modularDrawer/data/entities/interestRateSelectors.js.map +0 -1
- package/lib-es/modularDrawer/data/state-manager/types.d.ts +0 -24
- package/lib-es/modularDrawer/data/state-manager/types.d.ts.map +0 -1
- package/lib-es/modularDrawer/data/state-manager/types.js +0 -10
- package/lib-es/modularDrawer/data/state-manager/types.js.map +0 -1
- package/lib-es/modularDrawer/hooks/useAssetAccountCounts.d.ts.map +0 -1
- package/lib-es/modularDrawer/hooks/useAssetAccountCounts.js.map +0 -1
- package/lib-es/modularDrawer/hooks/useLeftAccounts.d.ts +0 -13
- package/lib-es/modularDrawer/hooks/useLeftAccounts.d.ts.map +0 -1
- package/lib-es/modularDrawer/hooks/useLeftAccounts.js +0 -11
- package/lib-es/modularDrawer/hooks/useLeftAccounts.js.map +0 -1
- package/lib-es/modularDrawer/hooks/useLeftAccountsApy.d.ts +0 -6
- package/lib-es/modularDrawer/hooks/useLeftAccountsApy.d.ts.map +0 -1
- package/lib-es/modularDrawer/hooks/useLeftAccountsApy.js +0 -15
- package/lib-es/modularDrawer/hooks/useLeftAccountsApy.js.map +0 -1
- package/lib-es/modularDrawer/hooks/useLeftApy.d.ts +0 -54
- package/lib-es/modularDrawer/hooks/useLeftApy.d.ts.map +0 -1
- package/lib-es/modularDrawer/hooks/useLeftApy.js +0 -11
- package/lib-es/modularDrawer/hooks/useLeftApy.js.map +0 -1
- package/lib-es/modularDrawer/hooks/useRightBalanceAsset.d.ts +0 -57
- package/lib-es/modularDrawer/hooks/useRightBalanceAsset.d.ts.map +0 -1
- package/lib-es/modularDrawer/hooks/useRightBalanceAsset.js +0 -83
- package/lib-es/modularDrawer/hooks/useRightBalanceAsset.js.map +0 -1
- package/lib-es/modularDrawer/hooks/useRightBalanceNetwork.d.ts +0 -63
- package/lib-es/modularDrawer/hooks/useRightBalanceNetwork.d.ts.map +0 -1
- package/lib-es/modularDrawer/hooks/useRightBalanceNetwork.js +0 -62
- package/lib-es/modularDrawer/hooks/useRightBalanceNetwork.js.map +0 -1
- package/lib-es/modularDrawer/modules/createAssetConfiguration.d.ts +0 -4
- package/lib-es/modularDrawer/modules/createAssetConfiguration.d.ts.map +0 -1
- package/lib-es/modularDrawer/modules/createAssetConfiguration.js +0 -39
- package/lib-es/modularDrawer/modules/createAssetConfiguration.js.map +0 -1
- package/lib-es/modularDrawer/modules/createNetworkConfiguration.d.ts +0 -6
- package/lib-es/modularDrawer/modules/createNetworkConfiguration.d.ts.map +0 -1
- package/lib-es/modularDrawer/modules/createNetworkConfiguration.js +0 -50
- package/lib-es/modularDrawer/modules/createNetworkConfiguration.js.map +0 -1
- package/lib-es/modularDrawer/utils/buildProviderCurrenciesMap.d.ts +0 -9
- package/lib-es/modularDrawer/utils/buildProviderCurrenciesMap.d.ts.map +0 -1
- package/lib-es/modularDrawer/utils/buildProviderCurrenciesMap.js +0 -13
- package/lib-es/modularDrawer/utils/buildProviderCurrenciesMap.js.map +0 -1
- package/lib-es/modularDrawer/utils/getLoadingStatus.d.ts +0 -9
- package/lib-es/modularDrawer/utils/getLoadingStatus.d.ts.map +0 -1
- package/lib-es/modularDrawer/utils/getLoadingStatus.js +0 -14
- package/lib-es/modularDrawer/utils/getLoadingStatus.js.map +0 -1
- package/lib-es/modularDrawer/utils/sortByBalance.d.ts +0 -6
- package/lib-es/modularDrawer/utils/sortByBalance.d.ts.map +0 -1
- package/lib-es/modularDrawer/utils/sortByBalance.js +0 -25
- package/lib-es/modularDrawer/utils/sortByBalance.js.map +0 -1
- package/src/bridge/crypto-assets/cal-integration.test.ts +0 -53
- package/src/bridge/crypto-assets/cal-integration.ts +0 -23
- package/src/bridge/crypto-assets/cal-store.test.ts +0 -93
- package/src/bridge/crypto-assets/cal-store.ts +0 -63
- package/src/bridge/generic-alpaca/alpaca/index.unit.test.ts +0 -78
- package/src/bridge/generic-alpaca/utils.test.ts +0 -133
- package/src/modularDrawer/__mocks__/dada.mock.ts +0 -3890
- package/src/modularDrawer/data/entities/interestRateSelectors.ts +0 -39
- package/src/modularDrawer/data/state-manager/types.ts +0 -28
- package/src/modularDrawer/hooks/useLeftAccounts.tsx +0 -23
- package/src/modularDrawer/hooks/useLeftAccountsApy.tsx +0 -28
- package/src/modularDrawer/hooks/useLeftApy.tsx +0 -19
- package/src/modularDrawer/hooks/useRightBalanceAsset.tsx +0 -140
- package/src/modularDrawer/hooks/useRightBalanceNetwork.tsx +0 -116
- package/src/modularDrawer/modules/createAssetConfiguration.ts +0 -61
- package/src/modularDrawer/modules/createNetworkConfiguration.ts +0 -79
- package/src/modularDrawer/utils/buildProviderCurrenciesMap.tsx +0 -25
- package/src/modularDrawer/utils/getLoadingStatus.ts +0 -24
- package/src/modularDrawer/utils/sortByBalance.tsx +0 -32
- /package/lib/bridge/generic-alpaca/{utils.test.d.ts → tests/utils.test.d.ts} +0 -0
- /package/lib-es/bridge/generic-alpaca/{utils.test.d.ts → tests/utils.test.d.ts} +0 -0
@@ -2,22 +2,8 @@ import { LiveConfig } from "@ledgerhq/live-config/LiveConfig";
|
|
2
2
|
import { getCryptoAssetsStore, setCryptoAssetsStore } from ".";
|
3
3
|
import * as legacy from "@ledgerhq/cryptoassets/tokens";
|
4
4
|
import type { CryptoAssetsStore } from "@ledgerhq/types-live";
|
5
|
-
import * as calIntegration from "./cal-integration";
|
6
5
|
|
7
6
|
describe("Testing CryptoAssetStore", () => {
|
8
|
-
let isCALIntegrationEnabledSpy: jest.SpyInstance;
|
9
|
-
let getCALStoreSpy: jest.SpyInstance;
|
10
|
-
|
11
|
-
beforeEach(() => {
|
12
|
-
isCALIntegrationEnabledSpy = jest
|
13
|
-
.spyOn(calIntegration, "isCALIntegrationEnabled")
|
14
|
-
.mockReturnValue(false);
|
15
|
-
getCALStoreSpy = jest.spyOn(calIntegration, "getCALStore");
|
16
|
-
});
|
17
|
-
|
18
|
-
afterEach(() => {
|
19
|
-
jest.restoreAllMocks();
|
20
|
-
});
|
21
7
|
it("should return the default methods from cryptoassets libs when feature flag does not exists", () => {
|
22
8
|
LiveConfig.setConfig({
|
23
9
|
some_other_feature: {
|
@@ -82,37 +68,4 @@ describe("Testing CryptoAssetStore", () => {
|
|
82
68
|
const store = getCryptoAssetsStore();
|
83
69
|
expect(store).toBe(newStore);
|
84
70
|
});
|
85
|
-
|
86
|
-
it("should return CAL store when CAL integration is enabled", () => {
|
87
|
-
isCALIntegrationEnabledSpy.mockReturnValue(true);
|
88
|
-
|
89
|
-
const mockCALStore = {} as unknown as CryptoAssetsStore;
|
90
|
-
getCALStoreSpy.mockReturnValue(mockCALStore);
|
91
|
-
|
92
|
-
const store = getCryptoAssetsStore();
|
93
|
-
|
94
|
-
expect(isCALIntegrationEnabledSpy).toHaveBeenCalled();
|
95
|
-
expect(getCALStoreSpy).toHaveBeenCalled();
|
96
|
-
expect(store).toBe(mockCALStore);
|
97
|
-
});
|
98
|
-
|
99
|
-
it("should prioritize CAL integration over feature flags", () => {
|
100
|
-
isCALIntegrationEnabledSpy.mockReturnValue(true);
|
101
|
-
|
102
|
-
LiveConfig.setConfig({
|
103
|
-
feature_cal_lazy_loading: {
|
104
|
-
type: "boolean",
|
105
|
-
default: true,
|
106
|
-
},
|
107
|
-
});
|
108
|
-
|
109
|
-
const mockCALStore = {} as unknown as CryptoAssetsStore;
|
110
|
-
getCALStoreSpy.mockReturnValue(mockCALStore);
|
111
|
-
|
112
|
-
const store = getCryptoAssetsStore();
|
113
|
-
|
114
|
-
expect(store).toBe(mockCALStore);
|
115
|
-
expect(isCALIntegrationEnabledSpy).toHaveBeenCalled();
|
116
|
-
expect(getCALStoreSpy).toHaveBeenCalled();
|
117
|
-
});
|
118
71
|
});
|
@@ -1,7 +1,6 @@
|
|
1
1
|
import { LiveConfig } from "@ledgerhq/live-config/LiveConfig";
|
2
2
|
import * as legacy from "@ledgerhq/cryptoassets/tokens";
|
3
3
|
import type { CryptoAssetsStore } from "@ledgerhq/types-live";
|
4
|
-
import { isCALIntegrationEnabled, getCALStore } from "./cal-integration";
|
5
4
|
|
6
5
|
const legacyStore: CryptoAssetsStore = {
|
7
6
|
findTokenByAddress: legacy.findTokenByAddress,
|
@@ -18,10 +17,6 @@ export function setCryptoAssetsStore(store: CryptoAssetsStore) {
|
|
18
17
|
}
|
19
18
|
|
20
19
|
export function getCryptoAssetsStore(): CryptoAssetsStore {
|
21
|
-
if (isCALIntegrationEnabled()) {
|
22
|
-
return getCALStore();
|
23
|
-
}
|
24
|
-
|
25
20
|
const featureEnabled =
|
26
21
|
LiveConfig.isConfigSet() && LiveConfig.getValueByKey("feature_cal_lazy_loading");
|
27
22
|
if (!featureEnabled) {
|
@@ -1,19 +1,16 @@
|
|
1
1
|
import { createApi as createXrpApi } from "@ledgerhq/coin-xrp/api/index";
|
2
2
|
import { createApi as createStellarApi } from "@ledgerhq/coin-stellar/api/index";
|
3
|
-
import { createApi as createCantonApi } from "@ledgerhq/coin-canton/api/index";
|
4
|
-
import { createApi as createTronApi } from "@ledgerhq/coin-tron/api/index";
|
5
3
|
import { getCurrencyConfiguration } from "../../../config";
|
6
4
|
import { getCryptoCurrencyById } from "@ledgerhq/cryptoassets/currencies";
|
7
5
|
import { getNetworkAlpacaApi } from "./network/network-alpaca";
|
8
6
|
import { Api } from "@ledgerhq/coin-framework/api/types";
|
9
7
|
import { XrpCoinConfig } from "@ledgerhq/coin-xrp/config";
|
10
8
|
import { StellarCoinConfig } from "@ledgerhq/coin-stellar/config";
|
11
|
-
import { CantonCoinConfig } from "@ledgerhq/coin-canton/config";
|
12
|
-
import { TronCoinConfig } from "@ledgerhq/coin-tron/config";
|
13
9
|
|
14
10
|
export function getAlpacaApi(network, kind): Api<any> {
|
15
11
|
if (kind === "local") {
|
16
12
|
switch (network) {
|
13
|
+
case "ripple":
|
17
14
|
case "xrp":
|
18
15
|
return createXrpApi(
|
19
16
|
getCurrencyConfiguration<XrpCoinConfig>(getCryptoCurrencyById("ripple")),
|
@@ -22,16 +19,6 @@ export function getAlpacaApi(network, kind): Api<any> {
|
|
22
19
|
return createStellarApi(
|
23
20
|
getCurrencyConfiguration<StellarCoinConfig>(getCryptoCurrencyById("stellar")),
|
24
21
|
) as Api<any>;
|
25
|
-
case "canton":
|
26
|
-
return createCantonApi(
|
27
|
-
getCurrencyConfiguration<CantonCoinConfig>(
|
28
|
-
getCryptoCurrencyById("canton_network_devnet"),
|
29
|
-
),
|
30
|
-
) as Api<any>;
|
31
|
-
case "tron":
|
32
|
-
return createTronApi(
|
33
|
-
getCurrencyConfiguration<TronCoinConfig>(getCryptoCurrencyById("tron")),
|
34
|
-
) as Api<any>;
|
35
22
|
}
|
36
23
|
}
|
37
24
|
return getNetworkAlpacaApi(network) satisfies Partial<Api<any>> as Api<any>;
|
@@ -134,7 +134,7 @@ const buildGetSequence = (networkFamily: string) =>
|
|
134
134
|
const buildListOperations = networkFamily =>
|
135
135
|
async function listOperations(
|
136
136
|
address: string,
|
137
|
-
pagination: Pagination = { minHeight: 0
|
137
|
+
pagination: Pagination = { minHeight: 0 },
|
138
138
|
): Promise<[Operation<any>[], string]> {
|
139
139
|
const { data } = await network<{ operations: Operation<any>[] }, unknown>({
|
140
140
|
method: "GET",
|
@@ -1,10 +1,11 @@
|
|
1
1
|
import BigNumber from "bignumber.js";
|
2
|
-
import { emptyHistoryCache
|
2
|
+
import { emptyHistoryCache } from "@ledgerhq/coin-framework/account/index";
|
3
3
|
import type { CryptoCurrency, TokenCurrency } from "@ledgerhq/types-cryptoassets";
|
4
4
|
import type { Operation, SyncConfig, TokenAccount } from "@ledgerhq/types-live";
|
5
5
|
import { encodeOperationId } from "@ledgerhq/coin-framework/operation";
|
6
6
|
import { listTokensForCryptoCurrency } from "@ledgerhq/cryptoassets";
|
7
7
|
import { AssetInfo, Balance } from "@ledgerhq/coin-framework/api/types";
|
8
|
+
import { findTokenById } from "@ledgerhq/cryptoassets/tokens";
|
8
9
|
|
9
10
|
export interface OperationCommon extends Operation {
|
10
11
|
extra: Record<string, any>;
|
@@ -12,6 +13,11 @@ export interface OperationCommon extends Operation {
|
|
12
13
|
|
13
14
|
export const getAssetIdFromTokenId = (tokenId: string): string => tokenId.split("/")[2];
|
14
15
|
|
16
|
+
export const getAssetIdFromAsset = (asset: AssetInfo) =>
|
17
|
+
asset.type !== "native" && "assetReference" in asset && "assetOwner" in asset
|
18
|
+
? `${asset.assetReference}:${asset.assetOwner}`
|
19
|
+
: "";
|
20
|
+
|
15
21
|
function buildTokenAccount({
|
16
22
|
parentAccountId,
|
17
23
|
assetBalance,
|
@@ -23,7 +29,8 @@ function buildTokenAccount({
|
|
23
29
|
token: TokenCurrency;
|
24
30
|
operations: OperationCommon[];
|
25
31
|
}): TokenAccount {
|
26
|
-
const
|
32
|
+
const assetId = getAssetIdFromTokenId(token.id);
|
33
|
+
const id = `${parentAccountId}+${assetId}`;
|
27
34
|
const balance = new BigNumber(assetBalance.value.toString() || "0");
|
28
35
|
|
29
36
|
// TODO: recheck this logic
|
@@ -61,14 +68,12 @@ export function buildSubAccounts({
|
|
61
68
|
assetsBalance,
|
62
69
|
syncConfig,
|
63
70
|
operations,
|
64
|
-
getTokenFromAsset,
|
65
71
|
}: {
|
66
72
|
currency: CryptoCurrency;
|
67
73
|
accountId: string;
|
68
74
|
assetsBalance: Balance[];
|
69
75
|
syncConfig: SyncConfig;
|
70
76
|
operations: OperationCommon[];
|
71
|
-
getTokenFromAsset?: (asset: AssetInfo) => TokenCurrency | undefined;
|
72
77
|
}): TokenAccount[] | undefined {
|
73
78
|
const { blacklistedTokenIds = [] } = syncConfig;
|
74
79
|
const allTokens = listTokensForCryptoCurrency(currency);
|
@@ -80,7 +85,7 @@ export function buildSubAccounts({
|
|
80
85
|
assetsBalance
|
81
86
|
.filter(b => b.asset.type !== "native") // NOTE: this could be removed, keeping here while fixing things up
|
82
87
|
.map(balance => {
|
83
|
-
const token =
|
88
|
+
const token = findToken(currency, balance);
|
84
89
|
// NOTE: for future tokens, will need to check over currencyName/standard(erc20,trc10,trc20, etc)/id
|
85
90
|
if (token && !blacklistedTokenIds.includes(token.id)) {
|
86
91
|
tokenAccounts.push(
|
@@ -99,3 +104,7 @@ export function buildSubAccounts({
|
|
99
104
|
});
|
100
105
|
return tokenAccounts;
|
101
106
|
}
|
107
|
+
|
108
|
+
export function findToken(currency: CryptoCurrency, balance: Balance): TokenCurrency | undefined {
|
109
|
+
return findTokenById(`${currency.family}/asset/${getAssetIdFromAsset(balance.asset)}`);
|
110
|
+
}
|
@@ -4,6 +4,7 @@ import BigNumber from "bignumber.js";
|
|
4
4
|
import { getAlpacaApi } from "./alpaca";
|
5
5
|
import { adaptCoreOperationToLiveOperation, extractBalance } from "./utils";
|
6
6
|
import { inferSubOperations } from "@ledgerhq/coin-framework/serialization";
|
7
|
+
import { findToken } from "./buildSubAccounts";
|
7
8
|
import { buildSubAccounts, OperationCommon } from "./buildSubAccounts";
|
8
9
|
|
9
10
|
export function genericGetAccountShape(network: string, kind: string): GetAccountShape {
|
@@ -32,7 +33,8 @@ export function genericGetAccountShape(network: string, kind: string): GetAccoun
|
|
32
33
|
|
33
34
|
const assetsBalance = balanceRes
|
34
35
|
.filter(b => b.asset.type !== "native")
|
35
|
-
.filter(b =>
|
36
|
+
.filter(b => findToken(currency, b));
|
37
|
+
|
36
38
|
const nativeBalance = BigInt(nativeAsset?.value ?? "0");
|
37
39
|
|
38
40
|
const spendableBalance = BigInt(nativeBalance - BigInt(nativeAsset?.locked ?? "0"));
|
@@ -41,7 +43,7 @@ export function genericGetAccountShape(network: string, kind: string): GetAccoun
|
|
41
43
|
const lastPagingToken = oldOps[0]?.extra?.pagingToken || "";
|
42
44
|
|
43
45
|
const blockHeight = oldOps.length ? (oldOps[0].blockHeight ?? 0) + 1 : 0;
|
44
|
-
const paginationParams: any = { minHeight: blockHeight
|
46
|
+
const paginationParams: any = { minHeight: blockHeight };
|
45
47
|
if (lastPagingToken) {
|
46
48
|
paginationParams.lastPagingToken = lastPagingToken;
|
47
49
|
}
|
@@ -70,7 +72,6 @@ export function genericGetAccountShape(network: string, kind: string): GetAccoun
|
|
70
72
|
assetsBalance,
|
71
73
|
syncConfig,
|
72
74
|
operations: assetOperations,
|
73
|
-
getTokenFromAsset: alpacaApi.getTokenFromAsset,
|
74
75
|
}) || [];
|
75
76
|
|
76
77
|
const operationsWithSubs = mergedOps.map(op => {
|
@@ -3,6 +3,7 @@ import { AccountAwaitingSendPendingOperations } from "@ledgerhq/errors";
|
|
3
3
|
import BigNumber from "bignumber.js";
|
4
4
|
import { getAlpacaApi } from "./alpaca";
|
5
5
|
import { transactionToIntent } from "./utils";
|
6
|
+
// import { FeeEstimation } from "@ledgerhq/coin-framework/api/types";
|
6
7
|
|
7
8
|
// => alpaca validateIntent
|
8
9
|
export function genericGetTransactionStatus(
|
@@ -2,41 +2,27 @@ import { Account, AccountBridge, TransactionCommon } from "@ledgerhq/types-live"
|
|
2
2
|
import { getAlpacaApi } from "./alpaca";
|
3
3
|
import { transactionToIntent } from "./utils";
|
4
4
|
import BigNumber from "bignumber.js";
|
5
|
-
import {
|
6
|
-
import { decodeTokenAccountId } from "@ledgerhq/coin-framework/account/index";
|
7
|
-
import { TokenCurrency } from "@ledgerhq/types-cryptoassets";
|
5
|
+
import { FeeEstimation } from "@ledgerhq/coin-framework/api/types";
|
8
6
|
|
9
7
|
function bnEq(a: BigNumber | null | undefined, b: BigNumber | null | undefined): boolean {
|
10
8
|
return !a && !b ? true : !a || !b ? false : a.eq(b);
|
11
9
|
}
|
12
10
|
|
13
|
-
type TransactionParam = TransactionCommon & {
|
14
|
-
fees: BigNumber | null | undefined;
|
15
|
-
customFees?: FeeEstimation;
|
16
|
-
assetReference?: string;
|
17
|
-
assetOwner?: string;
|
18
|
-
subAccountId?: string;
|
19
|
-
};
|
20
|
-
|
21
|
-
function assetInfosFallback(transaction: TransactionParam): {
|
22
|
-
assetReference: string;
|
23
|
-
assetOwner: string;
|
24
|
-
} {
|
25
|
-
return {
|
26
|
-
assetReference: transaction.assetReference ?? "",
|
27
|
-
assetOwner: transaction.assetOwner ?? "",
|
28
|
-
};
|
29
|
-
}
|
30
|
-
|
31
11
|
export function genericPrepareTransaction(
|
32
12
|
network: string,
|
33
13
|
kind,
|
34
14
|
): AccountBridge<TransactionCommon, Account, any, any>["prepareTransaction"] {
|
35
|
-
return async (
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
15
|
+
return async (
|
16
|
+
account,
|
17
|
+
transaction: TransactionCommon & {
|
18
|
+
fees: BigNumber | null | undefined;
|
19
|
+
customFees?: FeeEstimation;
|
20
|
+
assetReference?: string;
|
21
|
+
assetOwner?: string;
|
22
|
+
subAccountId?: string;
|
23
|
+
},
|
24
|
+
) => {
|
25
|
+
const [assetReference, assetOwner] = getAssetInfos(transaction);
|
40
26
|
|
41
27
|
let fees = transaction.customFees?.parameters?.fees || null;
|
42
28
|
if (fees === null) {
|
@@ -68,24 +54,11 @@ export function genericPrepareTransaction(
|
|
68
54
|
}
|
69
55
|
|
70
56
|
export function getAssetInfos(
|
71
|
-
tr:
|
72
|
-
|
73
|
-
getAssetFromToken: (token: TokenCurrency, owner: string) => AssetInfo,
|
74
|
-
): {
|
75
|
-
assetReference: string;
|
76
|
-
assetOwner: string;
|
77
|
-
} {
|
57
|
+
tr: TransactionCommon & { assetReference?: string; assetOwner?: string },
|
58
|
+
): string[] {
|
78
59
|
if (tr.subAccountId) {
|
79
|
-
const
|
80
|
-
|
81
|
-
if (!token) return assetInfosFallback(tr);
|
82
|
-
|
83
|
-
const asset = getAssetFromToken(token, owner);
|
84
|
-
|
85
|
-
return {
|
86
|
-
assetOwner: ("assetOwner" in asset && asset.assetOwner) || "",
|
87
|
-
assetReference: ("assetReference" in asset && asset.assetReference) || "",
|
88
|
-
};
|
60
|
+
const assetString = tr.subAccountId.split("+")[1];
|
61
|
+
return assetString.split(":");
|
89
62
|
}
|
90
|
-
return
|
63
|
+
return [tr.assetReference || "", tr.assetOwner || ""];
|
91
64
|
}
|
@@ -0,0 +1,19 @@
|
|
1
|
+
import { extractBalance } from "../utils";
|
2
|
+
|
3
|
+
describe("Alpaca utils", () => {
|
4
|
+
describe("extractBalance", () => {
|
5
|
+
it("extracts an existing balance", () => {
|
6
|
+
expect(extractBalance([{ value: 4n, asset: { type: "type1" } }], "type1")).toEqual({
|
7
|
+
value: 4n,
|
8
|
+
asset: { type: "type1" },
|
9
|
+
});
|
10
|
+
});
|
11
|
+
|
12
|
+
it("generates an empty balance for a missing type", () => {
|
13
|
+
expect(extractBalance([{ value: 4n, asset: { type: "type1" } }], "type2")).toEqual({
|
14
|
+
value: 0n,
|
15
|
+
asset: { type: "type2" },
|
16
|
+
});
|
17
|
+
});
|
18
|
+
});
|
19
|
+
});
|
@@ -44,17 +44,15 @@ export function adaptCoreOperationToLiveOperation(accountId: string, op: CoreOpe
|
|
44
44
|
if (op.details?.memo) {
|
45
45
|
extra.memo = op.details.memo as string;
|
46
46
|
}
|
47
|
-
const bnFees = new BigNumber(op.tx.fees.toString());
|
48
47
|
const res = {
|
49
|
-
id:
|
48
|
+
id: extra.ledgerOpType
|
49
|
+
? encodeOperationId(accountId, op.tx.hash, extra.ledgerOpType)
|
50
|
+
: encodeOperationId(accountId, op.tx.hash, op.type),
|
50
51
|
hash: op.tx.hash,
|
51
52
|
accountId,
|
52
53
|
type: opType,
|
53
|
-
value:
|
54
|
-
|
55
|
-
? new BigNumber(op.value.toString()).plus(bnFees)
|
56
|
-
: new BigNumber(op.value.toString()),
|
57
|
-
fee: bnFees,
|
54
|
+
value: new BigNumber(op.value.toString()),
|
55
|
+
fee: new BigNumber(op.tx.fees.toString()),
|
58
56
|
blockHash: op.tx.block.hash,
|
59
57
|
blockHeight: op.tx.block.height,
|
60
58
|
senders: op.senders,
|
@@ -6,7 +6,6 @@ export enum DeviceLabels {
|
|
6
6
|
SIGN = "Sign",
|
7
7
|
APPROVE = "Approve",
|
8
8
|
ACCEPT = "Accept",
|
9
|
-
ACCEPT_RISK = "Accept risk",
|
10
9
|
TRANSFER = "Transfer",
|
11
10
|
RECIPIENT = "Recipient",
|
12
11
|
DEST = "Dest",
|
@@ -55,5 +54,4 @@ export enum DeviceLabels {
|
|
55
54
|
VERIFY_POLYGON = "Verify Polygon",
|
56
55
|
VERIFY_SOLANA_ADDRESS = "Verify Solana address",
|
57
56
|
REVIEW_TRANSACTION = "Review transaction",
|
58
|
-
I_UNDERSTAND = "I understand",
|
59
57
|
}
|
@@ -3,8 +3,6 @@ import { DeviceLabels } from "../enum/DeviceLabels";
|
|
3
3
|
|
4
4
|
export async function delegateTezos() {
|
5
5
|
await waitFor(DeviceLabels.REVIEW_OPERATION);
|
6
|
-
await pressUntilTextFound(DeviceLabels.ACCEPT_RISK);
|
7
|
-
await pressBoth();
|
8
6
|
await pressUntilTextFound(DeviceLabels.ACCEPT);
|
9
7
|
await pressBoth();
|
10
8
|
}
|
package/src/e2e/speculos.ts
CHANGED
@@ -460,7 +460,7 @@ async function retryAxiosRequest<T>(
|
|
460
460
|
throw lastError!;
|
461
461
|
}
|
462
462
|
|
463
|
-
export async function waitFor(text: string, maxAttempts =
|
463
|
+
export async function waitFor(text: string, maxAttempts = 15): Promise<string[]> {
|
464
464
|
const port = getEnv("SPECULOS_API_PORT");
|
465
465
|
const address = getSpeculosAddress();
|
466
466
|
const url = `${address}:${port}/events?stream=false¤tscreenonly=true`;
|
@@ -731,22 +731,12 @@ export async function signDelegationTransaction(delegatingAccount: Delegate) {
|
|
731
731
|
}
|
732
732
|
|
733
733
|
export async function verifyAmountsAndAcceptSwap(swap: Swap, amount: string) {
|
734
|
-
await waitFor(DeviceLabels.REVIEW_TRANSACTION);
|
735
|
-
const events = await pressUntilTextFound(DeviceLabels.SIGN_TRANSACTION);
|
736
|
-
await verifySwapData(swap, events, amount);
|
737
|
-
await pressBoth();
|
738
|
-
}
|
739
|
-
|
740
|
-
export async function verifyAmountsAndAcceptSwapForDifferentSeed(swap: Swap, amount: string) {
|
741
|
-
await pressUntilTextFound(DeviceLabels.I_UNDERSTAND);
|
742
|
-
await pressBoth();
|
743
734
|
const events = await pressUntilTextFound(DeviceLabels.SIGN_TRANSACTION);
|
744
735
|
await verifySwapData(swap, events, amount);
|
745
736
|
await pressBoth();
|
746
737
|
}
|
747
738
|
|
748
739
|
export async function verifyAmountsAndRejectSwap(swap: Swap, amount: string) {
|
749
|
-
await waitFor(DeviceLabels.REVIEW_TRANSACTION);
|
750
740
|
const events = await pressUntilTextFound(DeviceLabels.REJECT);
|
751
741
|
await verifySwapData(swap, events, amount);
|
752
742
|
await pressBoth();
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import
|
1
|
+
import secp256k1 from "secp256k1";
|
2
2
|
import { firstValueFrom, from, Observable } from "rxjs";
|
3
3
|
import { TransportStatusError, WrongDeviceForAccount } from "@ledgerhq/errors";
|
4
4
|
|
@@ -187,8 +187,7 @@ function convertSignature(signature: string, exchangeType: ExchangeTypes): Buffe
|
|
187
187
|
return Buffer.from(base64Signature, "base64");
|
188
188
|
}
|
189
189
|
if (exchangeType === ExchangeTypes.Sell) return Buffer.from(signature, "hex");
|
190
|
-
|
191
|
-
return Buffer.from(sig.toDERRawBytes());
|
190
|
+
return <Buffer>secp256k1.signatureExport(Buffer.from(signature, "hex"));
|
192
191
|
}
|
193
192
|
|
194
193
|
export default completeExchange;
|
@@ -14,7 +14,7 @@ import { getDefaultAccountName } from "@ledgerhq/live-wallet/accountName";
|
|
14
14
|
import { log } from "@ledgerhq/logs";
|
15
15
|
import BigNumber from "bignumber.js";
|
16
16
|
import { Observable } from "rxjs";
|
17
|
-
import
|
17
|
+
import secp256k1 from "secp256k1";
|
18
18
|
import { getCurrencyExchangeConfig } from "../";
|
19
19
|
import { getAccountCurrency, getMainAccount } from "../../account";
|
20
20
|
import { getAccountBridge } from "../../bridge";
|
@@ -271,10 +271,7 @@ const completeExchange = (
|
|
271
271
|
function convertSignature(signature: string, exchangeType: ExchangeTypes): Buffer {
|
272
272
|
return exchangeType === ExchangeTypes.SwapNg
|
273
273
|
? base64UrlDecode(signature)
|
274
|
-
: (()
|
275
|
-
const sig = secp256k1.Signature.fromCompact(Buffer.from(signature, "hex"));
|
276
|
-
return Buffer.from(sig.toDERRawBytes());
|
277
|
-
})();
|
274
|
+
: <Buffer>secp256k1.signatureExport(Buffer.from(signature, "hex"));
|
278
275
|
}
|
279
276
|
|
280
277
|
function base64UrlDecode(base64Url: string): Buffer {
|
@@ -14,7 +14,7 @@ import { log } from "@ledgerhq/logs";
|
|
14
14
|
import { BigNumber } from "bignumber.js";
|
15
15
|
import invariant from "invariant";
|
16
16
|
import { firstValueFrom, from, Observable } from "rxjs";
|
17
|
-
import
|
17
|
+
import secp256k1 from "secp256k1";
|
18
18
|
import { getCurrencyExchangeConfig } from "../";
|
19
19
|
import { getAccountCurrency, getMainAccount } from "../../account";
|
20
20
|
import { getAccountBridge } from "../../bridge";
|
@@ -184,10 +184,9 @@ const initSwap = (input: InitSwapInput): Observable<SwapRequestEvent> => {
|
|
184
184
|
|
185
185
|
await swap.processTransaction(Buffer.from(swapResult.binaryPayload, "hex"), estimatedFees);
|
186
186
|
if (unsubscribed) return;
|
187
|
-
const goodSign = <Buffer>(
|
188
|
-
|
189
|
-
|
190
|
-
})();
|
187
|
+
const goodSign = <Buffer>(
|
188
|
+
secp256k1.signatureExport(Buffer.from(swapResult.signature, "hex"))
|
189
|
+
);
|
191
190
|
await swap.checkTransactionSignature(goodSign);
|
192
191
|
if (unsubscribed) return;
|
193
192
|
const mainPayoutCurrency = getAccountCurrency(payoutAccount);
|
@@ -9,7 +9,6 @@ export const cantonConfig: Record<string, ConfigInfo> = {
|
|
9
9
|
},
|
10
10
|
// TBC
|
11
11
|
nodeUrl: "https://wallet-validator-canton.ledger.com",
|
12
|
-
nodeId: "figment",
|
13
12
|
// TBC
|
14
13
|
gatewayUrl: "https://canton-gateway.api.live.ledger.com",
|
15
14
|
minReserve: 0,
|
@@ -23,12 +22,9 @@ export const cantonConfig: Record<string, ConfigInfo> = {
|
|
23
22
|
type: "active",
|
24
23
|
},
|
25
24
|
nodeUrl: "https://wallet-validator-devnet-canton.ledger-test.com",
|
26
|
-
nodeId: "ledger-live-devnet-prd",
|
27
25
|
gatewayUrl: "https://canton-gateway.api.live.ledger-test.com",
|
28
26
|
minReserve: 0,
|
29
27
|
useGateway: true,
|
30
|
-
nativeInstrumentId:
|
31
|
-
"6e9fc50fb94e56751b49f09ba2dc84da53a9d7cff08115ebb4f6b7a12d0c990c:Splice.Amulet:Amulet",
|
32
28
|
},
|
33
29
|
},
|
34
30
|
config_currency_canton_network_localnet: {
|
@@ -38,7 +34,6 @@ export const cantonConfig: Record<string, ConfigInfo> = {
|
|
38
34
|
type: "active",
|
39
35
|
},
|
40
36
|
nodeUrl: "http://localhost:2975/v2",
|
41
|
-
nodeId: undefined,
|
42
37
|
gatewayUrl: undefined,
|
43
38
|
minReserve: 0,
|
44
39
|
useGateway: false,
|
@@ -19,8 +19,6 @@ import { SolanaCoinConfig } from "@ledgerhq/coin-solana/config";
|
|
19
19
|
import { getCryptoCurrencyById } from "../../currencies";
|
20
20
|
import { signMessage } from "@ledgerhq/coin-solana/hw-signMessage";
|
21
21
|
import { LegacySignerSolana } from "@ledgerhq/live-signer-solana";
|
22
|
-
import { setShouldSkipTokenLoading } from "@ledgerhq/coin-solana/preload";
|
23
|
-
import { LiveConfig } from "@ledgerhq/live-config/LiveConfig";
|
24
22
|
import { getCryptoAssetsStore } from "../../bridge/crypto-assets";
|
25
23
|
|
26
24
|
const createSigner: CreateSigner<SolanaSigner> = (transport: Transport) =>
|
@@ -30,13 +28,6 @@ const getCurrencyConfig = () => {
|
|
30
28
|
return getCurrencyConfiguration<SolanaCoinConfig>(getCryptoCurrencyById("solana"));
|
31
29
|
};
|
32
30
|
|
33
|
-
try {
|
34
|
-
const isCALLazyLoadingEnabled = LiveConfig.getValueByKey("feature_cal_lazy_loading");
|
35
|
-
setShouldSkipTokenLoading(Boolean(isCALLazyLoadingEnabled));
|
36
|
-
} catch (error) {
|
37
|
-
setShouldSkipTokenLoading(false);
|
38
|
-
}
|
39
|
-
|
40
31
|
const bridge: Bridge<Transaction, SolanaAccount, TransactionStatus> = createBridges(
|
41
32
|
executeWithSigner(createSigner),
|
42
33
|
getCurrencyConfig,
|
@@ -108,7 +108,6 @@ export const DEFAULT_FEATURES: Features = {
|
|
108
108
|
postOnboardingAssetsTransfer: DEFAULT_FEATURE,
|
109
109
|
counterValue: DEFAULT_FEATURE,
|
110
110
|
mockFeature: DEFAULT_FEATURE,
|
111
|
-
calLedgerService: DEFAULT_FEATURE,
|
112
111
|
ptxServiceCtaExchangeDrawer: DEFAULT_FEATURE,
|
113
112
|
ptxServiceCtaScreens: DEFAULT_FEATURE,
|
114
113
|
ptxSwapReceiveTRC20WithoutTrx: DEFAULT_FEATURE,
|
@@ -625,6 +624,8 @@ export const DEFAULT_FEATURES: Features = {
|
|
625
624
|
enableModularization: false,
|
626
625
|
},
|
627
626
|
},
|
627
|
+
lldModularDrawerBackendData: DEFAULT_FEATURE,
|
628
|
+
llmModularDrawerBackendData: DEFAULT_FEATURE,
|
628
629
|
llmModularDrawer: {
|
629
630
|
...DEFAULT_FEATURE,
|
630
631
|
params: {
|
@@ -1,14 +1,23 @@
|
|
1
1
|
import { createApi, fetchBaseQuery, FetchBaseQueryMeta } from "@reduxjs/toolkit/query/react";
|
2
2
|
import { convertApiAssets } from "@ledgerhq/cryptoassets";
|
3
|
-
import { RawApiResponse } from "../entities";
|
3
|
+
import { AssetsData, RawApiResponse } from "../entities";
|
4
4
|
import { getEnv } from "@ledgerhq/live-env";
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
5
|
+
|
6
|
+
export enum AssetsDataTags {
|
7
|
+
Assets = "Assets",
|
8
|
+
}
|
9
|
+
|
10
|
+
export interface GetAssetsDataParams {
|
11
|
+
cursor?: string;
|
12
|
+
search?: string;
|
13
|
+
currencyIds?: string[];
|
14
|
+
}
|
15
|
+
|
16
|
+
export interface AssetsDataWithPagination extends AssetsData {
|
17
|
+
pagination: {
|
18
|
+
nextCursor?: string;
|
19
|
+
};
|
20
|
+
}
|
12
21
|
|
13
22
|
function transformAssetsResponse(
|
14
23
|
response: RawApiResponse,
|
@@ -34,44 +43,20 @@ export const assetsDataApi = createApi({
|
|
34
43
|
}),
|
35
44
|
tagTypes: [AssetsDataTags.Assets],
|
36
45
|
endpoints: build => ({
|
37
|
-
getAssetsData: build.
|
38
|
-
query: ({
|
39
|
-
|
46
|
+
getAssetsData: build.query<AssetsDataWithPagination, GetAssetsDataParams>({
|
47
|
+
query: ({ cursor, search, currencyIds: _currencyIds }) => ({
|
48
|
+
url: "assets",
|
49
|
+
params: {
|
50
|
+
...(cursor && { cursor }),
|
51
|
+
...(search && { search }),
|
52
|
+
// ...(currencyIds && currencyIds.length > 0 && { currencyIds }),
|
40
53
|
pageSize: 100,
|
41
|
-
|
42
|
-
|
43
|
-
...(queryArg?.currencyIds &&
|
44
|
-
queryArg?.currencyIds.length > 0 &&
|
45
|
-
!queryArg?.useCase && { currencyIds: queryArg.currencyIds }),
|
46
|
-
...(queryArg?.search && { search: queryArg.search }),
|
47
|
-
product: queryArg.product,
|
48
|
-
minVersion: queryArg.version,
|
49
|
-
additionalData: [AssetsAdditionalData.Apy, AssetsAdditionalData.MarketTrend],
|
50
|
-
};
|
51
|
-
|
52
|
-
return {
|
53
|
-
url: "assets",
|
54
|
-
params,
|
55
|
-
};
|
56
|
-
},
|
54
|
+
},
|
55
|
+
}),
|
57
56
|
providesTags: [AssetsDataTags.Assets],
|
58
57
|
transformResponse: transformAssetsResponse,
|
59
|
-
infiniteQueryOptions: {
|
60
|
-
initialPageParam: {
|
61
|
-
cursor: "",
|
62
|
-
},
|
63
|
-
getNextPageParam: lastPage => {
|
64
|
-
if (lastPage.pagination.nextCursor) {
|
65
|
-
return {
|
66
|
-
cursor: lastPage.pagination.nextCursor,
|
67
|
-
};
|
68
|
-
} else {
|
69
|
-
return undefined;
|
70
|
-
}
|
71
|
-
},
|
72
|
-
},
|
73
58
|
}),
|
74
59
|
}),
|
75
60
|
});
|
76
61
|
|
77
|
-
export const {
|
62
|
+
export const { useGetAssetsDataQuery } = assetsDataApi;
|