@ledgerhq/live-common 34.51.0-nightly.2 → 34.51.0-nightly.4
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 +2 -32
- package/lib/bridge/crypto-assets/index.js.map +1 -1
- package/lib/bridge/crypto-assets/index.test.js +5 -38
- package/lib/bridge/crypto-assets/index.test.js.map +1 -1
- package/lib/bridge/generic-alpaca/getTransactionStatus.d.ts.map +1 -1
- package/lib/bridge/generic-alpaca/getTransactionStatus.js +2 -1
- package/lib/bridge/generic-alpaca/getTransactionStatus.js.map +1 -1
- package/lib/bridge/generic-alpaca/utils.d.ts.map +1 -1
- package/lib/bridge/generic-alpaca/utils.js +1 -1
- package/lib/bridge/generic-alpaca/utils.js.map +1 -1
- package/lib/currencies/cryptoIcons.test.js +4 -1
- package/lib/currencies/cryptoIcons.test.js.map +1 -1
- package/lib/currencies/index.d.ts +1 -1
- package/lib/currencies/index.d.ts.map +1 -1
- package/lib/currencies/index.js +2 -5
- package/lib/currencies/index.js.map +1 -1
- package/lib/currencies/sortByMarketcap.test.js +1 -3
- package/lib/currencies/sortByMarketcap.test.js.map +1 -1
- package/lib/deposit/deposit.test.js +29 -12
- package/lib/deposit/deposit.test.js.map +1 -1
- package/lib/deposit/helper.d.ts.map +1 -1
- package/lib/deposit/helper.js +5 -1
- package/lib/deposit/helper.js.map +1 -1
- package/lib/e2e/enum/Account.d.ts +4 -0
- package/lib/e2e/enum/Account.d.ts.map +1 -1
- package/lib/e2e/enum/Account.js +4 -0
- package/lib/e2e/enum/Account.js.map +1 -1
- package/lib/e2e/enum/AppInfos.d.ts +1 -0
- package/lib/e2e/enum/AppInfos.d.ts.map +1 -1
- package/lib/e2e/enum/AppInfos.js +1 -0
- package/lib/e2e/enum/AppInfos.js.map +1 -1
- package/lib/e2e/enum/Currency.d.ts +2 -0
- package/lib/e2e/enum/Currency.d.ts.map +1 -1
- package/lib/e2e/enum/Currency.js +2 -0
- package/lib/e2e/enum/Currency.js.map +1 -1
- package/lib/e2e/enum/Network.d.ts +2 -1
- package/lib/e2e/enum/Network.d.ts.map +1 -1
- package/lib/e2e/enum/Network.js +1 -0
- package/lib/e2e/enum/Network.js.map +1 -1
- package/lib/e2e/enum/TokenType.d.ts +2 -1
- package/lib/e2e/enum/TokenType.d.ts.map +1 -1
- package/lib/e2e/enum/TokenType.js +1 -0
- package/lib/e2e/enum/TokenType.js.map +1 -1
- package/lib/e2e/enum/TransactionStatus.d.ts +4 -1
- package/lib/e2e/enum/TransactionStatus.d.ts.map +1 -1
- package/lib/e2e/enum/TransactionStatus.js +3 -0
- package/lib/e2e/enum/TransactionStatus.js.map +1 -1
- package/lib/e2e/families/sui.d.ts +2 -0
- package/lib/e2e/families/sui.d.ts.map +1 -0
- package/lib/e2e/families/sui.js +11 -0
- package/lib/e2e/families/sui.js.map +1 -0
- package/lib/e2e/index.d.ts +3 -0
- package/lib/e2e/index.d.ts.map +1 -1
- package/lib/e2e/speculos.d.ts +1 -0
- package/lib/e2e/speculos.d.ts.map +1 -1
- package/lib/e2e/speculos.js +23 -1
- package/lib/e2e/speculos.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.js +4 -4
- package/lib/exchange/providers/swap.js.map +1 -1
- package/lib/exchange/swap/api/v5/__mocks__/fetchRates.mocks.d.ts.map +1 -1
- package/lib/exchange/swap/api/v5/__mocks__/fetchRates.mocks.js +1 -1
- package/lib/exchange/swap/api/v5/__mocks__/fetchRates.mocks.js.map +1 -1
- package/lib/exchange/swap/hooks/useFromState.test.js +4 -1
- package/lib/exchange/swap/hooks/useFromState.test.js.map +1 -1
- package/lib/exchange/swap/hooks/useReverseAccounts.test.js +4 -1
- package/lib/exchange/swap/hooks/useReverseAccounts.test.js.map +1 -1
- package/lib/exchange/swap/hooks/useToState.test.js +4 -1
- package/lib/exchange/swap/hooks/useToState.test.js.map +1 -1
- package/lib/exchange/swap/hooks/useUpdateMaxAmount.test.js +4 -1
- package/lib/exchange/swap/hooks/useUpdateMaxAmount.test.js.map +1 -1
- package/lib/exchange/swap/mock.js +1 -1
- package/lib/exchange/swap/mock.js.map +1 -1
- package/lib/exchange/swap/utils/index.test.js +4 -1
- package/lib/exchange/swap/utils/index.test.js.map +1 -1
- package/lib/featureFlags/defaultFeatures.d.ts.map +1 -1
- package/lib/featureFlags/defaultFeatures.js +4 -0
- 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/hooks/useManifestWithSessionId.d.ts +12 -0
- package/lib/hooks/useManifestWithSessionId.d.ts.map +1 -0
- package/lib/hooks/useManifestWithSessionId.js +67 -0
- package/lib/hooks/useManifestWithSessionId.js.map +1 -0
- package/lib/hooks/useManifestWithSessionId.test.d.ts +2 -0
- package/lib/hooks/useManifestWithSessionId.test.d.ts.map +1 -0
- package/lib/hooks/useManifestWithSessionId.test.js +71 -0
- package/lib/hooks/useManifestWithSessionId.test.js.map +1 -0
- package/lib/market/utils/index.d.ts +1 -0
- package/lib/market/utils/index.d.ts.map +1 -1
- package/lib/market/utils/index.js +16 -0
- package/lib/market/utils/index.js.map +1 -1
- package/lib/modularDrawer/hooks/__tests__/useDetailedAccountsCore.test.d.ts +2 -0
- package/lib/modularDrawer/hooks/__tests__/useDetailedAccountsCore.test.d.ts.map +1 -0
- package/lib/modularDrawer/hooks/__tests__/useDetailedAccountsCore.test.js +350 -0
- package/lib/modularDrawer/hooks/__tests__/useDetailedAccountsCore.test.js.map +1 -0
- package/lib/modularDrawer/hooks/index.d.ts +2 -0
- package/lib/modularDrawer/hooks/index.d.ts.map +1 -0
- package/lib/modularDrawer/hooks/index.js +6 -0
- package/lib/modularDrawer/hooks/index.js.map +1 -0
- package/lib/modularDrawer/hooks/useDetailedAccountsCore.d.ts +14 -0
- package/lib/modularDrawer/hooks/useDetailedAccountsCore.d.ts.map +1 -0
- package/lib/modularDrawer/hooks/useDetailedAccountsCore.js +119 -0
- package/lib/modularDrawer/hooks/useDetailedAccountsCore.js.map +1 -0
- package/lib/modularDrawer/hooks/useRightBalanceAsset.d.ts.map +1 -1
- package/lib/modularDrawer/hooks/useRightBalanceAsset.js +9 -1
- package/lib/modularDrawer/hooks/useRightBalanceAsset.js.map +1 -1
- package/lib/modularDrawer/hooks/useRightBalanceNetwork.d.ts +6 -1
- package/lib/modularDrawer/hooks/useRightBalanceNetwork.d.ts.map +1 -1
- package/lib/modularDrawer/hooks/useRightBalanceNetwork.js +12 -4
- package/lib/modularDrawer/hooks/useRightBalanceNetwork.js.map +1 -1
- package/lib/modularDrawer/index.d.ts +4 -0
- package/lib/modularDrawer/index.d.ts.map +1 -0
- package/lib/modularDrawer/index.js +20 -0
- package/lib/modularDrawer/index.js.map +1 -0
- package/lib/modularDrawer/types/detailedAccount.d.ts +46 -0
- package/lib/modularDrawer/types/detailedAccount.d.ts.map +1 -0
- package/lib/modularDrawer/types/detailedAccount.js +3 -0
- package/lib/modularDrawer/types/detailedAccount.js.map +1 -0
- package/lib/modularDrawer/types/index.d.ts +2 -0
- package/lib/modularDrawer/types/index.d.ts.map +1 -0
- package/lib/modularDrawer/types/index.js +18 -0
- package/lib/modularDrawer/types/index.js.map +1 -0
- package/lib/modularDrawer/utils/__tests__/sortAccountsByFiatValue.test.d.ts +2 -0
- package/lib/modularDrawer/utils/__tests__/sortAccountsByFiatValue.test.d.ts.map +1 -0
- package/lib/modularDrawer/utils/__tests__/sortAccountsByFiatValue.test.js +106 -0
- package/lib/modularDrawer/utils/__tests__/sortAccountsByFiatValue.test.js.map +1 -0
- package/lib/modularDrawer/utils/getBalanceAndFiatValueByAssets.d.ts +3 -4
- package/lib/modularDrawer/utils/getBalanceAndFiatValueByAssets.d.ts.map +1 -1
- package/lib/modularDrawer/utils/getBalanceAndFiatValueByAssets.js +7 -0
- package/lib/modularDrawer/utils/getBalanceAndFiatValueByAssets.js.map +1 -1
- package/lib/modularDrawer/utils/index.d.ts +1 -0
- package/lib/modularDrawer/utils/index.d.ts.map +1 -1
- package/lib/modularDrawer/utils/index.js +3 -1
- package/lib/modularDrawer/utils/index.js.map +1 -1
- package/lib/modularDrawer/utils/sortAccountsByFiatValue.d.ts +8 -0
- package/lib/modularDrawer/utils/sortAccountsByFiatValue.d.ts.map +1 -0
- package/lib/modularDrawer/utils/sortAccountsByFiatValue.js +17 -0
- package/lib/modularDrawer/utils/sortAccountsByFiatValue.js.map +1 -0
- package/lib/modularDrawer/utils/type.d.ts +2 -2
- package/lib/modularDrawer/utils/type.d.ts.map +1 -1
- package/lib/notifications/ServiceStatusProvider/index.d.ts +1 -1
- package/lib/notifications/ServiceStatusProvider/index.d.ts.map +1 -1
- package/lib/notifications/ServiceStatusProvider/index.js +1 -1
- package/lib/notifications/ServiceStatusProvider/index.js.map +1 -1
- package/lib/platform/providers/RemoteLiveAppProvider/api/mock.json +3 -3
- package/lib/utils/__tests__/getAccountTuplesForCurrency.test.js +4 -1
- package/lib/utils/__tests__/getAccountTuplesForCurrency.test.js.map +1 -1
- package/lib/wallet-api/useDappLogic.js +1 -1
- package/lib/wallet-api/useDappLogic.js.map +1 -1
- package/lib-es/bridge/crypto-assets/index.d.ts.map +1 -1
- package/lib-es/bridge/crypto-assets/index.js +2 -9
- package/lib-es/bridge/crypto-assets/index.js.map +1 -1
- package/lib-es/bridge/crypto-assets/index.test.js +5 -15
- package/lib-es/bridge/crypto-assets/index.test.js.map +1 -1
- package/lib-es/bridge/generic-alpaca/getTransactionStatus.d.ts.map +1 -1
- package/lib-es/bridge/generic-alpaca/getTransactionStatus.js +2 -1
- package/lib-es/bridge/generic-alpaca/getTransactionStatus.js.map +1 -1
- package/lib-es/bridge/generic-alpaca/utils.d.ts.map +1 -1
- package/lib-es/bridge/generic-alpaca/utils.js +1 -1
- package/lib-es/bridge/generic-alpaca/utils.js.map +1 -1
- package/lib-es/currencies/cryptoIcons.test.js +5 -2
- package/lib-es/currencies/cryptoIcons.test.js.map +1 -1
- package/lib-es/currencies/index.d.ts +1 -1
- package/lib-es/currencies/index.d.ts.map +1 -1
- package/lib-es/currencies/index.js +1 -1
- package/lib-es/currencies/index.js.map +1 -1
- package/lib-es/currencies/sortByMarketcap.test.js +1 -3
- package/lib-es/currencies/sortByMarketcap.test.js.map +1 -1
- package/lib-es/deposit/deposit.test.js +30 -13
- package/lib-es/deposit/deposit.test.js.map +1 -1
- package/lib-es/deposit/helper.d.ts.map +1 -1
- package/lib-es/deposit/helper.js +6 -2
- package/lib-es/deposit/helper.js.map +1 -1
- package/lib-es/e2e/enum/Account.d.ts +4 -0
- package/lib-es/e2e/enum/Account.d.ts.map +1 -1
- package/lib-es/e2e/enum/Account.js +4 -0
- package/lib-es/e2e/enum/Account.js.map +1 -1
- package/lib-es/e2e/enum/AppInfos.d.ts +1 -0
- package/lib-es/e2e/enum/AppInfos.d.ts.map +1 -1
- package/lib-es/e2e/enum/AppInfos.js +1 -0
- package/lib-es/e2e/enum/AppInfos.js.map +1 -1
- package/lib-es/e2e/enum/Currency.d.ts +2 -0
- package/lib-es/e2e/enum/Currency.d.ts.map +1 -1
- package/lib-es/e2e/enum/Currency.js +2 -0
- package/lib-es/e2e/enum/Currency.js.map +1 -1
- package/lib-es/e2e/enum/Network.d.ts +2 -1
- package/lib-es/e2e/enum/Network.d.ts.map +1 -1
- package/lib-es/e2e/enum/Network.js +1 -0
- package/lib-es/e2e/enum/Network.js.map +1 -1
- package/lib-es/e2e/enum/TokenType.d.ts +2 -1
- package/lib-es/e2e/enum/TokenType.d.ts.map +1 -1
- package/lib-es/e2e/enum/TokenType.js +1 -0
- package/lib-es/e2e/enum/TokenType.js.map +1 -1
- package/lib-es/e2e/enum/TransactionStatus.d.ts +4 -1
- package/lib-es/e2e/enum/TransactionStatus.d.ts.map +1 -1
- package/lib-es/e2e/enum/TransactionStatus.js +3 -0
- package/lib-es/e2e/enum/TransactionStatus.js.map +1 -1
- package/lib-es/e2e/families/sui.d.ts +2 -0
- package/lib-es/e2e/families/sui.d.ts.map +1 -0
- package/lib-es/e2e/families/sui.js +7 -0
- package/lib-es/e2e/families/sui.js.map +1 -0
- package/lib-es/e2e/index.d.ts +3 -0
- package/lib-es/e2e/index.d.ts.map +1 -1
- package/lib-es/e2e/speculos.d.ts +1 -0
- package/lib-es/e2e/speculos.d.ts.map +1 -1
- package/lib-es/e2e/speculos.js +21 -0
- package/lib-es/e2e/speculos.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.js +4 -4
- package/lib-es/exchange/providers/swap.js.map +1 -1
- package/lib-es/exchange/swap/api/v5/__mocks__/fetchRates.mocks.d.ts.map +1 -1
- package/lib-es/exchange/swap/api/v5/__mocks__/fetchRates.mocks.js +1 -1
- package/lib-es/exchange/swap/api/v5/__mocks__/fetchRates.mocks.js.map +1 -1
- package/lib-es/exchange/swap/hooks/useFromState.test.js +5 -2
- package/lib-es/exchange/swap/hooks/useFromState.test.js.map +1 -1
- package/lib-es/exchange/swap/hooks/useReverseAccounts.test.js +5 -2
- package/lib-es/exchange/swap/hooks/useReverseAccounts.test.js.map +1 -1
- package/lib-es/exchange/swap/hooks/useToState.test.js +5 -2
- package/lib-es/exchange/swap/hooks/useToState.test.js.map +1 -1
- package/lib-es/exchange/swap/hooks/useUpdateMaxAmount.test.js +5 -2
- package/lib-es/exchange/swap/hooks/useUpdateMaxAmount.test.js.map +1 -1
- package/lib-es/exchange/swap/mock.js +1 -1
- package/lib-es/exchange/swap/mock.js.map +1 -1
- package/lib-es/exchange/swap/utils/index.test.js +5 -2
- package/lib-es/exchange/swap/utils/index.test.js.map +1 -1
- package/lib-es/featureFlags/defaultFeatures.d.ts.map +1 -1
- package/lib-es/featureFlags/defaultFeatures.js +4 -0
- 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/hooks/useManifestWithSessionId.d.ts +12 -0
- package/lib-es/hooks/useManifestWithSessionId.d.ts.map +1 -0
- package/lib-es/hooks/useManifestWithSessionId.js +60 -0
- package/lib-es/hooks/useManifestWithSessionId.js.map +1 -0
- package/lib-es/hooks/useManifestWithSessionId.test.d.ts +2 -0
- package/lib-es/hooks/useManifestWithSessionId.test.d.ts.map +1 -0
- package/lib-es/hooks/useManifestWithSessionId.test.js +69 -0
- package/lib-es/hooks/useManifestWithSessionId.test.js.map +1 -0
- package/lib-es/market/utils/index.d.ts +1 -0
- package/lib-es/market/utils/index.d.ts.map +1 -1
- package/lib-es/market/utils/index.js +2 -0
- package/lib-es/market/utils/index.js.map +1 -1
- package/lib-es/modularDrawer/hooks/__tests__/useDetailedAccountsCore.test.d.ts +2 -0
- package/lib-es/modularDrawer/hooks/__tests__/useDetailedAccountsCore.test.d.ts.map +1 -0
- package/lib-es/modularDrawer/hooks/__tests__/useDetailedAccountsCore.test.js +345 -0
- package/lib-es/modularDrawer/hooks/__tests__/useDetailedAccountsCore.test.js.map +1 -0
- package/lib-es/modularDrawer/hooks/index.d.ts +2 -0
- package/lib-es/modularDrawer/hooks/index.d.ts.map +1 -0
- package/lib-es/modularDrawer/hooks/index.js +2 -0
- package/lib-es/modularDrawer/hooks/index.js.map +1 -0
- package/lib-es/modularDrawer/hooks/useDetailedAccountsCore.d.ts +14 -0
- package/lib-es/modularDrawer/hooks/useDetailedAccountsCore.d.ts.map +1 -0
- package/lib-es/modularDrawer/hooks/useDetailedAccountsCore.js +115 -0
- package/lib-es/modularDrawer/hooks/useDetailedAccountsCore.js.map +1 -0
- package/lib-es/modularDrawer/hooks/useRightBalanceAsset.d.ts.map +1 -1
- package/lib-es/modularDrawer/hooks/useRightBalanceAsset.js +6 -1
- package/lib-es/modularDrawer/hooks/useRightBalanceAsset.js.map +1 -1
- package/lib-es/modularDrawer/hooks/useRightBalanceNetwork.d.ts +6 -1
- package/lib-es/modularDrawer/hooks/useRightBalanceNetwork.d.ts.map +1 -1
- package/lib-es/modularDrawer/hooks/useRightBalanceNetwork.js +9 -4
- package/lib-es/modularDrawer/hooks/useRightBalanceNetwork.js.map +1 -1
- package/lib-es/modularDrawer/index.d.ts +4 -0
- package/lib-es/modularDrawer/index.d.ts.map +1 -0
- package/lib-es/modularDrawer/index.js +4 -0
- package/lib-es/modularDrawer/index.js.map +1 -0
- package/lib-es/modularDrawer/types/detailedAccount.d.ts +46 -0
- package/lib-es/modularDrawer/types/detailedAccount.d.ts.map +1 -0
- package/lib-es/modularDrawer/types/detailedAccount.js +2 -0
- package/lib-es/modularDrawer/types/detailedAccount.js.map +1 -0
- package/lib-es/modularDrawer/types/index.d.ts +2 -0
- package/lib-es/modularDrawer/types/index.d.ts.map +1 -0
- package/lib-es/modularDrawer/types/index.js +2 -0
- package/lib-es/modularDrawer/types/index.js.map +1 -0
- package/lib-es/modularDrawer/utils/__tests__/sortAccountsByFiatValue.test.d.ts +2 -0
- package/lib-es/modularDrawer/utils/__tests__/sortAccountsByFiatValue.test.d.ts.map +1 -0
- package/lib-es/modularDrawer/utils/__tests__/sortAccountsByFiatValue.test.js +101 -0
- package/lib-es/modularDrawer/utils/__tests__/sortAccountsByFiatValue.test.js.map +1 -0
- package/lib-es/modularDrawer/utils/getBalanceAndFiatValueByAssets.d.ts +3 -4
- package/lib-es/modularDrawer/utils/getBalanceAndFiatValueByAssets.d.ts.map +1 -1
- package/lib-es/modularDrawer/utils/getBalanceAndFiatValueByAssets.js +4 -0
- package/lib-es/modularDrawer/utils/getBalanceAndFiatValueByAssets.js.map +1 -1
- package/lib-es/modularDrawer/utils/index.d.ts +1 -0
- package/lib-es/modularDrawer/utils/index.d.ts.map +1 -1
- package/lib-es/modularDrawer/utils/index.js +1 -0
- package/lib-es/modularDrawer/utils/index.js.map +1 -1
- package/lib-es/modularDrawer/utils/sortAccountsByFiatValue.d.ts +8 -0
- package/lib-es/modularDrawer/utils/sortAccountsByFiatValue.d.ts.map +1 -0
- package/lib-es/modularDrawer/utils/sortAccountsByFiatValue.js +13 -0
- package/lib-es/modularDrawer/utils/sortAccountsByFiatValue.js.map +1 -0
- package/lib-es/modularDrawer/utils/type.d.ts +2 -2
- package/lib-es/modularDrawer/utils/type.d.ts.map +1 -1
- package/lib-es/notifications/ServiceStatusProvider/index.d.ts +1 -1
- package/lib-es/notifications/ServiceStatusProvider/index.d.ts.map +1 -1
- package/lib-es/notifications/ServiceStatusProvider/index.js +1 -1
- package/lib-es/notifications/ServiceStatusProvider/index.js.map +1 -1
- package/lib-es/platform/providers/RemoteLiveAppProvider/api/mock.json +3 -3
- package/lib-es/utils/__tests__/getAccountTuplesForCurrency.test.js +5 -2
- package/lib-es/utils/__tests__/getAccountTuplesForCurrency.test.js.map +1 -1
- package/lib-es/wallet-api/useDappLogic.js +2 -2
- package/lib-es/wallet-api/useDappLogic.js.map +1 -1
- package/package.json +53 -53
- package/src/bridge/crypto-assets/index.test.ts +9 -15
- package/src/bridge/crypto-assets/index.ts +2 -10
- package/src/bridge/generic-alpaca/getTransactionStatus.ts +6 -4
- package/src/bridge/generic-alpaca/utils.ts +1 -2
- package/src/currencies/cryptoIcons.test.ts +4 -4
- package/src/currencies/index.ts +1 -4
- package/src/currencies/sortByMarketcap.test.ts +1 -3
- package/src/deposit/deposit.test.ts +29 -14
- package/src/deposit/helper.ts +6 -2
- package/src/e2e/enum/Account.ts +31 -0
- package/src/e2e/enum/AppInfos.ts +2 -0
- package/src/e2e/enum/Currency.ts +11 -0
- package/src/e2e/enum/Network.ts +1 -0
- package/src/e2e/enum/TokenType.ts +1 -0
- package/src/e2e/enum/TransactionStatus.ts +3 -0
- package/src/e2e/families/sui.ts +7 -0
- package/src/e2e/speculos.ts +23 -0
- package/src/exchange/providers/swap.ts +4 -4
- package/src/exchange/swap/api/v5/__mocks__/fetchRates.mocks.ts +1 -2
- package/src/exchange/swap/hooks/useFromState.test.ts +4 -2
- package/src/exchange/swap/hooks/useReverseAccounts.test.ts +4 -2
- package/src/exchange/swap/hooks/useToState.test.ts +4 -2
- package/src/exchange/swap/hooks/useUpdateMaxAmount.test.ts +4 -2
- package/src/exchange/swap/mock.ts +1 -1
- package/src/exchange/swap/utils/index.test.ts +4 -2
- package/src/featureFlags/defaultFeatures.ts +5 -0
- package/src/hooks/useManifestWithSessionId.test.ts +105 -0
- package/src/hooks/useManifestWithSessionId.ts +83 -0
- package/src/market/utils/index.ts +3 -0
- package/src/modularDrawer/hooks/__tests__/useDetailedAccountsCore.test.ts +472 -0
- package/src/modularDrawer/hooks/index.ts +1 -0
- package/src/modularDrawer/hooks/useDetailedAccountsCore.ts +146 -0
- package/src/modularDrawer/hooks/useRightBalanceAsset.tsx +5 -1
- package/src/modularDrawer/hooks/useRightBalanceNetwork.tsx +10 -4
- package/src/modularDrawer/index.ts +3 -0
- package/src/modularDrawer/types/detailedAccount.ts +49 -0
- package/src/modularDrawer/types/index.ts +1 -0
- package/src/modularDrawer/utils/__tests__/sortAccountsByFiatValue.test.ts +117 -0
- package/src/modularDrawer/utils/getBalanceAndFiatValueByAssets.ts +6 -3
- package/src/modularDrawer/utils/index.ts +1 -0
- package/src/modularDrawer/utils/sortAccountsByFiatValue.ts +14 -0
- package/src/modularDrawer/utils/type.ts +3 -2
- package/src/notifications/ServiceStatusProvider/index.tsx +1 -1
- package/src/platform/providers/RemoteLiveAppProvider/api/mock.json +3 -3
- package/src/utils/__tests__/getAccountTuplesForCurrency.test.ts +4 -2
- package/src/wallet-api/useDappLogic.ts +3 -3
package/src/e2e/speculos.ts
CHANGED
|
@@ -42,6 +42,7 @@ import { Swap } from "./models/Swap";
|
|
|
42
42
|
import { delegateOsmosis } from "./families/osmosis";
|
|
43
43
|
import { AppInfos } from "./enum/AppInfos";
|
|
44
44
|
import { DEVICE_LABELS_CONFIG } from "./data/deviceLabelsData";
|
|
45
|
+
import { sendSui } from "./families/sui";
|
|
45
46
|
|
|
46
47
|
const isSpeculosRemote = process.env.REMOTE_SPECULOS === "true";
|
|
47
48
|
|
|
@@ -344,6 +345,14 @@ export const specs: Specs = {
|
|
|
344
345
|
},
|
|
345
346
|
dependency: "",
|
|
346
347
|
},
|
|
348
|
+
Sui: {
|
|
349
|
+
currency: getCryptoCurrencyById("sui"),
|
|
350
|
+
appQuery: {
|
|
351
|
+
model: getSpeculosModel(),
|
|
352
|
+
appName: "Sui",
|
|
353
|
+
},
|
|
354
|
+
dependency: "",
|
|
355
|
+
},
|
|
347
356
|
};
|
|
348
357
|
|
|
349
358
|
export async function startSpeculos(
|
|
@@ -632,6 +641,10 @@ export async function goToSettings() {
|
|
|
632
641
|
await pressBoth();
|
|
633
642
|
}
|
|
634
643
|
|
|
644
|
+
export async function providePublicKey() {
|
|
645
|
+
await pressRightButton();
|
|
646
|
+
}
|
|
647
|
+
|
|
635
648
|
type DeviceLabelsReturn = {
|
|
636
649
|
delegateConfirmLabel: string;
|
|
637
650
|
delegateVerifyLabel: string;
|
|
@@ -660,6 +673,10 @@ export function getDeviceLabels(appInfo: AppInfos): DeviceLabelsReturn {
|
|
|
660
673
|
}
|
|
661
674
|
|
|
662
675
|
export async function expectValidAddressDevice(account: Account, addressDisplayed: string) {
|
|
676
|
+
if (account.currency === Currency.SUI_USDC) {
|
|
677
|
+
providePublicKey();
|
|
678
|
+
}
|
|
679
|
+
|
|
663
680
|
const { receiveVerifyLabel, receiveConfirmLabel } = getDeviceLabels(account.currency.speculosApp);
|
|
664
681
|
|
|
665
682
|
await waitFor(receiveVerifyLabel);
|
|
@@ -721,6 +738,12 @@ export async function signSendTransaction(tx: Transaction) {
|
|
|
721
738
|
case Currency.HBAR:
|
|
722
739
|
await sendHedera();
|
|
723
740
|
break;
|
|
741
|
+
case Currency.SUI:
|
|
742
|
+
await sendSui();
|
|
743
|
+
break;
|
|
744
|
+
case Currency.SUI_USDC:
|
|
745
|
+
await sendSui();
|
|
746
|
+
break;
|
|
724
747
|
default:
|
|
725
748
|
throw new Error(`Unsupported currency: ${currencyName.ticker}`);
|
|
726
749
|
}
|
|
@@ -140,9 +140,9 @@ const DEFAULT_SWAP_PROVIDERS: Record<string, ProviderConfig & Partial<Additional
|
|
|
140
140
|
type: "DEX",
|
|
141
141
|
needsKYC: false,
|
|
142
142
|
needsBearerToken: false,
|
|
143
|
-
termsOfUseUrl: "https://1inch.
|
|
144
|
-
supportUrl: "https://help.1inch.
|
|
145
|
-
mainUrl: "https://1inch.
|
|
143
|
+
termsOfUseUrl: "https://1inch.com/assets/Widget_1inch.com_Terms_of_Use.pdf",
|
|
144
|
+
supportUrl: "https://help.1inch.com/en/",
|
|
145
|
+
mainUrl: "https://1inch.com/",
|
|
146
146
|
},
|
|
147
147
|
paraswap: {
|
|
148
148
|
type: "DEX",
|
|
@@ -232,7 +232,7 @@ export const dexProvidersContractAddress: { [key: string]: string } = {
|
|
|
232
232
|
|
|
233
233
|
export const termsOfUse: { [key: string]: string } = {
|
|
234
234
|
paraswap: "https://paraswap.io/tos",
|
|
235
|
-
"1inch": "https://1inch.
|
|
235
|
+
"1inch": "https://1inch.com/assets/Widget_1inch.com_Terms_of_Use.pdf",
|
|
236
236
|
Uniswap: "https://uniswap.org/terms-of-service",
|
|
237
237
|
};
|
|
238
238
|
|
|
@@ -58,8 +58,7 @@ export const fetchRatesMock = (
|
|
|
58
58
|
{
|
|
59
59
|
provider: "oneinch",
|
|
60
60
|
providerType: "DEX",
|
|
61
|
-
providerURL:
|
|
62
|
-
"https://app.1inch.io/#/1/unified/swap/usdt/eth?ledgerLive=true&sourceTokenAmount=100",
|
|
61
|
+
providerURL: "https://1inch.com/swap/#/1/unified/swap/usdt/eth&sourceTokenAmount=100",
|
|
63
62
|
from: "ethereum/erc20/usd_tether__erc20_",
|
|
64
63
|
to: "ethereum",
|
|
65
64
|
amountFrom: "100",
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @jest-environment jsdom
|
|
3
3
|
*/
|
|
4
4
|
import "../../../__tests__/test-helpers/dom-polyfill";
|
|
5
|
-
import { getCryptoCurrencyById,
|
|
5
|
+
import { getCryptoCurrencyById, findTokenById } from "@ledgerhq/cryptoassets";
|
|
6
6
|
import { Account } from "@ledgerhq/types-live";
|
|
7
7
|
import { renderHook, act } from "@testing-library/react";
|
|
8
8
|
import BigNumber from "bignumber.js";
|
|
@@ -14,7 +14,9 @@ import { useFromState } from "./useFromState";
|
|
|
14
14
|
|
|
15
15
|
const BTC = getCryptoCurrencyById("bitcoin");
|
|
16
16
|
const ETH = getCryptoCurrencyById("ethereum");
|
|
17
|
-
const
|
|
17
|
+
const usdtToken = findTokenById("ethereum/erc20/usd_tether__erc20_");
|
|
18
|
+
if (!usdtToken) throw new Error("USDT token not found");
|
|
19
|
+
const USDT = usdtToken;
|
|
18
20
|
|
|
19
21
|
jest.useFakeTimers();
|
|
20
22
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @jest-environment jsdom
|
|
3
3
|
*/
|
|
4
4
|
import "../../../__tests__/test-helpers/dom-polyfill";
|
|
5
|
-
import { getCryptoCurrencyById,
|
|
5
|
+
import { getCryptoCurrencyById, findTokenById } from "@ledgerhq/cryptoassets";
|
|
6
6
|
import type { Account } from "@ledgerhq/types-live";
|
|
7
7
|
import { renderHook, act } from "@testing-library/react";
|
|
8
8
|
import { genTokenAccount } from "@ledgerhq/coin-framework/mocks/account";
|
|
@@ -11,7 +11,9 @@ import { useReverseAccounts } from "./useReverseAccounts";
|
|
|
11
11
|
|
|
12
12
|
const BTC = getCryptoCurrencyById("bitcoin");
|
|
13
13
|
const ETH = getCryptoCurrencyById("ethereum");
|
|
14
|
-
const
|
|
14
|
+
const usdtToken = findTokenById("ethereum/erc20/usd_tether__erc20_");
|
|
15
|
+
if (!usdtToken) throw new Error("USDT token not found");
|
|
16
|
+
const USDT = usdtToken;
|
|
15
17
|
|
|
16
18
|
const fromParentAccount = genAccount("mocked-account-2", {
|
|
17
19
|
currency: ETH,
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import "../../../__tests__/test-helpers/dom-polyfill";
|
|
5
5
|
import { renderHook, act } from "@testing-library/react";
|
|
6
|
-
import { getCryptoCurrencyById,
|
|
6
|
+
import { getCryptoCurrencyById, findTokenById } from "@ledgerhq/cryptoassets";
|
|
7
7
|
import { selectorStateDefaultValues, useToState } from ".";
|
|
8
8
|
import { genTokenAccount } from "@ledgerhq/coin-framework/mocks/account";
|
|
9
9
|
import { genAccount } from "../../../mock/account";
|
|
@@ -12,7 +12,9 @@ import type { Account } from "@ledgerhq/types-live";
|
|
|
12
12
|
|
|
13
13
|
const BTC = getCryptoCurrencyById("bitcoin");
|
|
14
14
|
const ETH = getCryptoCurrencyById("ethereum");
|
|
15
|
-
const
|
|
15
|
+
const usdtToken = findTokenById("ethereum/erc20/usd_tether__erc20_");
|
|
16
|
+
if (!usdtToken) throw new Error("USDT token not found");
|
|
17
|
+
const USDT = usdtToken;
|
|
16
18
|
|
|
17
19
|
const selectedAccount = genAccount("mocked-account-selected", { currency: ETH });
|
|
18
20
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @jest-environment jsdom
|
|
3
3
|
*/
|
|
4
4
|
import "../../../__tests__/test-helpers/dom-polyfill";
|
|
5
|
-
import { getCryptoCurrencyById,
|
|
5
|
+
import { getCryptoCurrencyById, findTokenById } from "@ledgerhq/cryptoassets";
|
|
6
6
|
import { act, renderHook } from "@testing-library/react";
|
|
7
7
|
import BigNumber from "bignumber.js";
|
|
8
8
|
import { checkAccountSupported } from "../../../account/index";
|
|
@@ -19,7 +19,9 @@ jest.mock("../../../families/evm/bridge/mock");
|
|
|
19
19
|
const mockedEstimateMaxSpendable = jest.mocked(ethBridge.accountBridge.estimateMaxSpendable);
|
|
20
20
|
|
|
21
21
|
const ETH = getCryptoCurrencyById("ethereum");
|
|
22
|
-
const
|
|
22
|
+
const usdtToken = findTokenById("ethereum/erc20/usd_tether__erc20_");
|
|
23
|
+
if (!usdtToken) throw new Error("USDT token not found");
|
|
24
|
+
const USDT = usdtToken;
|
|
23
25
|
|
|
24
26
|
const parentAccount = genAccount("parent-account", {
|
|
25
27
|
currency: ETH,
|
|
@@ -103,7 +103,7 @@ export const mockGetExchangeRates = async (
|
|
|
103
103
|
providerType: "DEX",
|
|
104
104
|
expirationDate: new Date(),
|
|
105
105
|
tradeMethod: "float",
|
|
106
|
-
providerURL: `https://
|
|
106
|
+
providerURL: `https://1inch.com/swap/#/1/unified/swap/eth/usdt&sourceTokenAmount=${transaction.amount}`,
|
|
107
107
|
},
|
|
108
108
|
];
|
|
109
109
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { findTokenById } from "@ledgerhq/cryptoassets";
|
|
2
2
|
import type { CryptoCurrency, TokenCurrency } from "@ledgerhq/types-cryptoassets";
|
|
3
3
|
import type { Account, TokenAccount } from "@ledgerhq/types-live";
|
|
4
4
|
import BigNumber from "bignumber.js";
|
|
@@ -87,7 +87,9 @@ describe("swap/utils/getAccountTuplesForCurrency", () => {
|
|
|
87
87
|
});
|
|
88
88
|
|
|
89
89
|
describe("TokenCurrency", () => {
|
|
90
|
-
const
|
|
90
|
+
const token = findTokenById("ethereum/erc20/aave");
|
|
91
|
+
if (!token) throw new Error("AAVE token not found");
|
|
92
|
+
const aaveToken = Object.freeze(token);
|
|
91
93
|
|
|
92
94
|
test("returns correct parent accounts including a new subAccount when a TokenCurrency is provided", () => {
|
|
93
95
|
const ethAccounts = [
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @jest-environment jsdom
|
|
3
|
+
*/
|
|
4
|
+
import { renderHook, waitFor } from "@testing-library/react";
|
|
5
|
+
import { useManifestWithSessionId } from "./useManifestWithSessionId";
|
|
6
|
+
import { LiveAppManifest } from "../platform/types";
|
|
7
|
+
|
|
8
|
+
const mockFetch = jest.fn();
|
|
9
|
+
// eslint-disable-next-line @typescript-eslint/consistent-type-assertions
|
|
10
|
+
global.fetch = mockFetch as any;
|
|
11
|
+
|
|
12
|
+
// eslint-disable-next-line @typescript-eslint/consistent-type-assertions
|
|
13
|
+
const baseManifest = {
|
|
14
|
+
id: "test-app",
|
|
15
|
+
name: "Test App",
|
|
16
|
+
url: "https://example.com",
|
|
17
|
+
} as LiveAppManifest;
|
|
18
|
+
|
|
19
|
+
describe("useManifestWithSessionId", () => {
|
|
20
|
+
beforeEach(() => {
|
|
21
|
+
jest.clearAllMocks();
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
it("returns null manifest during loading", async () => {
|
|
25
|
+
mockFetch.mockResolvedValueOnce({
|
|
26
|
+
ok: true,
|
|
27
|
+
json: async () => ({ providerSessionId: "abc123" }),
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
const { result } = renderHook(() =>
|
|
31
|
+
useManifestWithSessionId({ manifest: baseManifest, shareAnalytics: true }),
|
|
32
|
+
);
|
|
33
|
+
|
|
34
|
+
expect(result.current.loading).toBe(true);
|
|
35
|
+
expect(result.current.manifest).toBeNull();
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
it("returns manifest with externalID after success", async () => {
|
|
39
|
+
mockFetch.mockResolvedValueOnce({
|
|
40
|
+
ok: true,
|
|
41
|
+
json: async () => ({ providerSessionId: "abc123" }),
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
const { result } = renderHook(() =>
|
|
45
|
+
useManifestWithSessionId({ manifest: baseManifest, shareAnalytics: true }),
|
|
46
|
+
);
|
|
47
|
+
|
|
48
|
+
await waitFor(() =>
|
|
49
|
+
expect(result.current.manifest).toEqual({
|
|
50
|
+
...baseManifest,
|
|
51
|
+
url: "https://example.com/?externalID=abc123",
|
|
52
|
+
}),
|
|
53
|
+
);
|
|
54
|
+
|
|
55
|
+
expect(result.current.loading).toBe(false);
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
it("falls back to original manifest if fetch rejects", async () => {
|
|
59
|
+
mockFetch.mockRejectedValueOnce(new Error("network error"));
|
|
60
|
+
|
|
61
|
+
const { result } = renderHook(() =>
|
|
62
|
+
useManifestWithSessionId({ manifest: baseManifest, shareAnalytics: true }),
|
|
63
|
+
);
|
|
64
|
+
|
|
65
|
+
await waitFor(() => {
|
|
66
|
+
expect(result.current.manifest).toEqual(baseManifest);
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
expect(result.current.loading).toBe(false);
|
|
70
|
+
});
|
|
71
|
+
|
|
72
|
+
it("falls back to original manifest if response is not ok", async () => {
|
|
73
|
+
mockFetch.mockResolvedValueOnce({ ok: false });
|
|
74
|
+
|
|
75
|
+
const { result } = renderHook(() =>
|
|
76
|
+
useManifestWithSessionId({ manifest: baseManifest, shareAnalytics: true }),
|
|
77
|
+
);
|
|
78
|
+
|
|
79
|
+
await waitFor(() => {
|
|
80
|
+
expect(result.current.manifest).toEqual(baseManifest);
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
expect(result.current.loading).toBe(false);
|
|
84
|
+
});
|
|
85
|
+
|
|
86
|
+
it("returns null if manifest is not provided", async () => {
|
|
87
|
+
const { result } = renderHook(() =>
|
|
88
|
+
useManifestWithSessionId({ manifest: null, shareAnalytics: true }),
|
|
89
|
+
);
|
|
90
|
+
|
|
91
|
+
expect(mockFetch).not.toHaveBeenCalled();
|
|
92
|
+
expect(result.current.manifest).toBeNull();
|
|
93
|
+
expect(result.current.loading).toBe(false);
|
|
94
|
+
});
|
|
95
|
+
|
|
96
|
+
it("skips fetch if shareAnalytics is false and just returns manifest", () => {
|
|
97
|
+
const { result } = renderHook(() =>
|
|
98
|
+
useManifestWithSessionId({ manifest: baseManifest, shareAnalytics: false }),
|
|
99
|
+
);
|
|
100
|
+
|
|
101
|
+
expect(mockFetch).not.toHaveBeenCalled();
|
|
102
|
+
expect(result.current.manifest).toEqual(baseManifest);
|
|
103
|
+
expect(result.current.loading).toBe(false);
|
|
104
|
+
});
|
|
105
|
+
});
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { appendQueryParamsToManifestURL } from "../wallet-api/utils/appendQueryParamsToManifestURL";
|
|
3
|
+
import { LiveAppManifest } from "../platform/types";
|
|
4
|
+
import { getEnv } from "@ledgerhq/live-env";
|
|
5
|
+
|
|
6
|
+
type Options = {
|
|
7
|
+
manifest: LiveAppManifest | null | undefined;
|
|
8
|
+
shareAnalytics: boolean;
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
type HookResult = {
|
|
12
|
+
manifest?: LiveAppManifest | null;
|
|
13
|
+
loading: boolean;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export function useManifestWithSessionId({ manifest, shareAnalytics }: Options): HookResult {
|
|
17
|
+
const [id, setId] = React.useState<string | null>(null);
|
|
18
|
+
const [loading, setLoading] = React.useState<boolean>(false);
|
|
19
|
+
|
|
20
|
+
React.useEffect(() => {
|
|
21
|
+
let cancelled = false;
|
|
22
|
+
|
|
23
|
+
async function fetchId() {
|
|
24
|
+
if (!shareAnalytics || !manifest) {
|
|
25
|
+
setId(null);
|
|
26
|
+
setLoading(false);
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
setLoading(true);
|
|
31
|
+
|
|
32
|
+
try {
|
|
33
|
+
const response = await fetch(getEnv("PROVIDER_SESSION_ID_ENDPOINT"), {
|
|
34
|
+
method: "GET",
|
|
35
|
+
headers: {
|
|
36
|
+
Accept: "application/json",
|
|
37
|
+
"Content-Type": "application/json",
|
|
38
|
+
},
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
if (!response.ok) throw new Error("Failed to fetch session ID");
|
|
42
|
+
|
|
43
|
+
const { providerSessionId } = await response.json();
|
|
44
|
+
|
|
45
|
+
if (!cancelled) {
|
|
46
|
+
setId(providerSessionId);
|
|
47
|
+
setLoading(false);
|
|
48
|
+
}
|
|
49
|
+
} catch {
|
|
50
|
+
if (!cancelled) {
|
|
51
|
+
setId(null);
|
|
52
|
+
setLoading(false);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
fetchId();
|
|
58
|
+
|
|
59
|
+
return () => {
|
|
60
|
+
cancelled = true; // avoid setting state after unmount
|
|
61
|
+
};
|
|
62
|
+
}, [shareAnalytics]);
|
|
63
|
+
|
|
64
|
+
const customizedManifest = React.useMemo(() => {
|
|
65
|
+
if (!manifest) return null;
|
|
66
|
+
|
|
67
|
+
if (loading) {
|
|
68
|
+
return null;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
if (id) {
|
|
72
|
+
const url = appendQueryParamsToManifestURL(manifest, {
|
|
73
|
+
externalID: id,
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
return url ? { ...manifest, url: url.toString() } : manifest;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
return manifest;
|
|
80
|
+
}, [manifest, id, loading]);
|
|
81
|
+
|
|
82
|
+
return { manifest: customizedManifest, loading };
|
|
83
|
+
}
|