@luxexchange/lx 1.0.0 → 1.0.2
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/package.json +12 -14
- package/src/components/CurrencyInputPanel/AmountInputPresets/PresetAmountButton.tsx +1 -1
- package/src/components/CurrencyInputPanel/CurrencyInputPanelBalance.tsx +1 -1
- package/src/components/CurrencyInputPanel/CurrencyInputPanelHeader.tsx +1 -1
- package/src/components/CurrencyInputPanel/hooks/useIndicativeQuoteTextDisplay.ts +1 -1
- package/src/components/CurrencyLogo/TokenLogo.test.tsx +1 -1
- package/src/components/MultichainTokenDetails/MultichainAddressList.test.tsx +1 -1
- package/src/components/TokenSelector/filter.test.ts +1 -1
- package/src/components/TokenSelector/hooks/useLuxTokensOptions.ts +1 -1
- package/src/components/lists/OnchainItemList/processSectionsToRows.test.tsx +1 -1
- package/src/components/modals/WarningModal/types.ts +1 -1
- package/src/components/notifications/iconUtils.ts +1 -1
- package/src/components/reporting/ReportPoolDataModal.tsx +1 -1
- package/src/components/reporting/ReportTokenDataModal.tsx +1 -1
- package/src/components/reporting/ReportTokenIssueModal.tsx +1 -1
- package/src/constants/routing.ts +1 -1
- package/src/dialog-preferences/implementations/createDialogPreferencesService.test.ts +1 -1
- package/src/features/activity/extract/extractRestDEXOrderDetails.ts +1 -1
- package/src/features/activity/utils/remote.ts +1 -1
- package/src/features/chains/evm/info/avalanche.ts +1 -1
- package/src/features/chains/evm/info/blast.ts +1 -1
- package/src/features/chains/evm/info/bnb.ts +1 -1
- package/src/features/chains/evm/info/mainnet.ts +1 -1
- package/src/features/chains/evm/info/monad.ts +1 -1
- package/src/features/chains/evm/info/worldchain.ts +1 -1
- package/src/features/chains/evm/tokens.test.ts +1 -1
- package/src/features/chains/evm/tokens.ts +1 -1
- package/src/features/chains/utils.ts +1 -1
- package/src/features/dataApi/balances/balancesRest.ts +1 -1
- package/src/features/dataApi/balances/utils.ts +1 -1
- package/src/features/dataApi/types.ts +1 -1
- package/src/features/dataApi/utils/buildCurrency.test.ts +1 -1
- package/src/features/dataApi/utils/buildCurrency.ts +1 -1
- package/src/features/fiatOnRamp/PaymentMethodFilter/PaymentMethodFilter.test.tsx +1 -1
- package/src/features/fiatOnRamp/types.ts +1 -1
- package/src/features/gas/hooks/useCancellationGasFeeInfo.test.ts +1 -1
- package/src/features/gas/hooks/useMaxAmountSpend.ts +1 -1
- package/src/features/gas/utils.test.ts +1 -1
- package/src/features/language/formatter.ts +1 -1
- package/src/features/notifications/slice/types.ts +1 -1
- package/src/features/portfolio/portfolioUpdates/fetchOnChainBalances.ts +1 -1
- package/src/features/portfolio/portfolioUpdates/rest/fetchOnChainBalancesRest.test.ts +1 -1
- package/src/features/portfolio/portfolioUpdates/rest/fetchOnChainBalancesRest.ts +1 -1
- package/src/features/portfolio/portfolioUpdates/rest/refetchRestQueriesViaOnchainOverrideVariantSaga.test.ts +1 -1
- package/src/features/providers/FlashbotsRpcClient.test.ts +1 -1
- package/src/features/reporting/reports.ts +1 -1
- package/src/features/search/SearchModal/analytics/analytics.test.ts +1 -1
- package/src/features/settings/hooks.test.ts +2 -2
- package/src/features/tokens/SolanaToken.ts +1 -1
- package/src/features/tokens/getCurrencyAmount.test.ts +1 -1
- package/src/features/tokens/getCurrencyAmount.ts +1 -1
- package/src/features/tokens/stablecoin.ts +1 -1
- package/src/features/tokens/warnings/safetyUtils.test.ts +1 -1
- package/src/features/tokens/warnings/safetyUtils.ts +1 -1
- package/src/features/tokens/warnings/slice/hooks.ts +1 -1
- package/src/features/transactions/TransactionDetails/UserReceiveAmount.tsx +1 -1
- package/src/features/transactions/TransactionDetails/types.ts +1 -1
- package/src/features/transactions/cancel/cancelMultipleOrders.test.ts +1 -1
- package/src/features/transactions/cancel/cancelOrderFactory.test.ts +1 -1
- package/src/features/transactions/components/TransactionModal/TransactionModalContext.tsx +1 -1
- package/src/features/transactions/hooks/useUSDCPrice.ts +1 -1
- package/src/features/transactions/liquidity/steps/generateLPTransactionSteps.ts +1 -1
- package/src/features/transactions/steps/approve.ts +1 -1
- package/src/features/transactions/steps/permit2Transaction.ts +1 -1
- package/src/features/transactions/steps/wrap.ts +1 -1
- package/src/features/transactions/swap/components/MaxSlippageRow/SlippageInfo/SlippageInfoCaption.tsx +1 -1
- package/src/features/transactions/swap/components/MaxSlippageRow/SlippageInfo/useFormatSlippageAmount.ts +1 -1
- package/src/features/transactions/swap/components/PriceImpactRow/usePriceImpact.test.ts +1 -1
- package/src/features/transactions/swap/components/PriceImpactRow/usePriceImpact.ts +1 -1
- package/src/features/transactions/swap/components/SwapFormButton/hooks/useSwapFormButtonHooks.test.ts +1 -1
- package/src/features/transactions/swap/components/SwapFormSettings/settingsConfigurations/slippage/SlippageScreenNative.tsx +1 -1
- package/src/features/transactions/swap/components/UnichainInstantBalanceModal/hooks/receiptFetching/utils.ts +1 -1
- package/src/features/transactions/swap/form/SwapFormScreen/YouReceiveDetails/SwapDetailsRow.tsx +1 -1
- package/src/features/transactions/swap/form/hooks/useOnSelectCurrency.ts +1 -1
- package/src/features/transactions/swap/form/stores/swapFormScreenStore/createSwapFormScreenStore.ts +1 -1
- package/src/features/transactions/swap/form/stores/swapFormScreenStore/useSwapFormScreenCallbacks.test.ts +3 -3
- package/src/features/transactions/swap/hooks/useSwapWarnings/getBalanceWarning.test.ts +2 -2
- package/src/features/transactions/swap/hooks/useSwapWarnings/getFormIncompleteWarning.test.ts +1 -1
- package/src/features/transactions/swap/hooks/useSwapWarnings/getPriceImpactWarning.test.ts +1 -1
- package/src/features/transactions/swap/hooks/useSwapWarnings/getPriceImpactWarning.ts +1 -1
- package/src/features/transactions/swap/hooks/useSwapWarnings/getTokenBlockedWarning.test.ts +1 -1
- package/src/features/transactions/swap/hooks/useSwapWarnings/useSwapWarnings.test.ts +1 -1
- package/src/features/transactions/swap/hooks/useTrade/logging.ts +1 -1
- package/src/features/transactions/swap/hooks/useTrade/parseQuoteCurrencies.ts +1 -1
- package/src/features/transactions/swap/hooks/useTrade.ts +1 -1
- package/src/features/transactions/swap/plan/planSaga.test.ts +1 -1
- package/src/features/transactions/swap/review/hooks/useTokenApprovalInfo.test.ts +1 -1
- package/src/features/transactions/swap/review/services/swapTxAndGasInfoService/utils.test.ts +3 -3
- package/src/features/transactions/swap/services/tradeService/transformations/transformQuoteToTrade.ts +1 -1
- package/src/features/transactions/swap/types/derivedSwapInfo.ts +1 -1
- package/src/features/transactions/swap/types/getTradingApiSwapFee.test.ts +1 -1
- package/src/features/transactions/swap/types/getTradingApiSwapFee.ts +1 -1
- package/src/features/transactions/swap/types/solana.test.ts +1 -1
- package/src/features/transactions/swap/types/solana.ts +1 -1
- package/src/features/transactions/swap/types/trade.test.ts +1 -1
- package/src/features/transactions/swap/types/wrapCallback.ts +1 -1
- package/src/features/transactions/swap/utils/asset.ts +1 -1
- package/src/features/transactions/swap/utils/format.ts +1 -1
- package/src/features/transactions/swap/utils/formatPriceImpact.test.ts +1 -1
- package/src/features/transactions/swap/utils/formatPriceImpact.ts +1 -1
- package/src/features/transactions/swap/utils/generateSwapTransactionSteps.test.ts +2 -2
- package/src/features/transactions/swap/utils/getExactOutputWillFail.test.ts +1 -1
- package/src/features/transactions/swap/utils/getExactOutputWillFail.ts +1 -1
- package/src/features/transactions/swap/utils/getPriceImpact.ts +1 -1
- package/src/features/transactions/swap/utils/getSwapFeeUsd.ts +1 -1
- package/src/features/transactions/swap/utils/getTradeAmounts.ts +1 -1
- package/src/features/transactions/swap/utils/trade.test.ts +2 -2
- package/src/features/transactions/swap/utils/tradingApi.ts +3 -3
- package/src/features/transactions/swap/utils/wrap.ts +1 -1
- package/src/features/transactions/types/baseDerivedInfo.ts +1 -1
- package/src/features/unitags/UnitagInfoModal.tsx +1 -1
- package/src/i18n/utils.test.ts +1 -1
- package/src/test/fixtures/gql/assets/tokens.ts +1 -1
- package/src/test/fixtures/lib/sdk.ts +1 -1
- package/src/test/fixtures/transactions/swap.ts +2 -2
- package/src/test/fixtures/wallet/currencies.ts +1 -1
- package/src/test/fixtures/wallet/transactions/fixtures.ts +1 -1
- package/src/test/mocks/locale.ts +1 -1
- package/src/utils/approvals.test.ts +1 -1
- package/src/utils/currency.ts +1 -1
- package/src/utils/isWSOL.test.ts +1 -1
- package/src/utils/isWSOL.ts +1 -1
- package/src/utils/routingDiagram/routingProviders/jupiterRoutingProvider.test.ts +1 -1
- package/src/utils/routingDiagram/routingProviders/jupiterRoutingProvider.ts +1 -1
- package/src/utils/routingDiagram/routingProviders/luxRoutingProvider.test.ts +3 -3
- package/src/utils/routingDiagram/types.ts +1 -1
- package/src/utils/search/doesTokenMatchSearchTerm.test.ts +1 -1
- package/src/utils/search/doesTokenMatchSearchTerm.ts +1 -1
- package/.depcheckrc +0 -26
- package/.eslintignore +0 -4
- package/.eslintrc.js +0 -79
- package/LLM.md +0 -145
- package/babel.config.js +0 -39
- package/env.d.ts +0 -15
- package/eslint_rules/i18n.js +0 -44
- package/eslint_rules/no-redux-modals.js +0 -54
- package/jest-package-mocks.js +0 -38
- package/openapitools.json +0 -7
- package/tsconfig.eslint.json +0 -6
- package/vitest-package-mocks.ts +0 -76
- package/vitest-setup.ts +0 -246
- package/vitest.config.ts +0 -86
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@luxexchange/lx",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"prepare": "nx prepare lx",
|
|
6
6
|
"build": "nx build lux",
|
|
@@ -65,11 +65,11 @@
|
|
|
65
65
|
"@uniswap/v2-sdk": "4.17.0",
|
|
66
66
|
"@uniswap/v3-sdk": "3.27.0",
|
|
67
67
|
"@uniswap/v4-sdk": "1.25.1",
|
|
68
|
-
"@luxexchange/api": "
|
|
69
|
-
"@luxexchange/config": "
|
|
70
|
-
"@luxexchange/gating": "
|
|
71
|
-
"@luxexchange/notifications": "
|
|
72
|
-
"@luxexchange/prices": "
|
|
68
|
+
"@luxexchange/api": "workspace:^",
|
|
69
|
+
"@luxexchange/config": "workspace:^",
|
|
70
|
+
"@luxexchange/gating": "workspace:^",
|
|
71
|
+
"@luxexchange/notifications": "workspace:^",
|
|
72
|
+
"@luxexchange/prices": "workspace:^",
|
|
73
73
|
"apollo-link-rest": "0.9.0",
|
|
74
74
|
"date-fns": "2.30.0",
|
|
75
75
|
"dayjs": "1.11.7",
|
|
@@ -111,11 +111,11 @@
|
|
|
111
111
|
"redux": "4.2.1",
|
|
112
112
|
"redux-persist": "6.0.0",
|
|
113
113
|
"redux-saga": "1.2.2",
|
|
114
|
-
"@hanzo/gui": "2.0.
|
|
114
|
+
"@hanzo/gui": "2.0.3",
|
|
115
115
|
"tiny-invariant": "1.3.1",
|
|
116
116
|
"typed-redux-saga": "1.5.0",
|
|
117
|
-
"@luxfi/ui": "
|
|
118
|
-
"@luxfi/utilities": "
|
|
117
|
+
"@luxfi/ui": "workspace:^",
|
|
118
|
+
"@luxfi/utilities": "workspace:^",
|
|
119
119
|
"uuid": "9.0.0",
|
|
120
120
|
"viem": "2.30.5",
|
|
121
121
|
"wagmi": "2.15.5",
|
|
@@ -141,7 +141,7 @@
|
|
|
141
141
|
"@typescript-eslint/utils": "6.20.0",
|
|
142
142
|
"@typescript/native-preview": "7.0.0-dev.20260108.1",
|
|
143
143
|
"@uniswap/client-notification-service": "0.0.11",
|
|
144
|
-
"@luxfi/eslint-config": "
|
|
144
|
+
"@luxfi/eslint-config": "workspace:^",
|
|
145
145
|
"@vitejs/plugin-react": "4.7.0",
|
|
146
146
|
"@walletconnect/types": "2.23.0",
|
|
147
147
|
"depcheck": "1.4.7",
|
|
@@ -157,14 +157,12 @@
|
|
|
157
157
|
"typechain": "5.2.0",
|
|
158
158
|
"typescript": "5.8.3",
|
|
159
159
|
"vitest": "3.2.1",
|
|
160
|
-
"vitest-presets": "
|
|
160
|
+
"vitest-presets": "workspace:^"
|
|
161
161
|
},
|
|
162
162
|
"optionalDependencies": {
|
|
163
163
|
"@uniswap/client-privy-embedded-wallet": "0.0.2"
|
|
164
164
|
},
|
|
165
165
|
"main": "src/index.ts",
|
|
166
166
|
"private": false,
|
|
167
|
-
"sideEffects": [
|
|
168
|
-
"*.css"
|
|
169
|
-
]
|
|
167
|
+
"sideEffects": ["*.css"]
|
|
170
168
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Currency, CurrencyAmount } from '@
|
|
1
|
+
import type { Currency, CurrencyAmount } from '@luxamm/sdk-core'
|
|
2
2
|
import { Text } from '@luxfi/ui/src'
|
|
3
3
|
import { useConnectionStatus } from '@luxexchange/lx/src/features/accounts/store/hooks'
|
|
4
4
|
import type { CurrencyInfo } from '@luxexchange/lx/src/features/dataApi/types'
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Currency, CurrencyAmount } from '@
|
|
1
|
+
import { Currency, CurrencyAmount } from '@luxamm/sdk-core'
|
|
2
2
|
import { useEffect, useMemo, useRef } from 'react'
|
|
3
3
|
import { CurrencyInputPanelProps } from '@luxexchange/lx/src/components/CurrencyInputPanel/types'
|
|
4
4
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// This test expects the invalid image URLs to fail to load, so
|
|
2
2
|
// we silence the error logs to keep the test output clean.
|
|
3
|
-
import '
|
|
3
|
+
import 'utilities/src/logger/mocks'
|
|
4
4
|
import { TokenLogo } from '@luxexchange/lx/src/components/CurrencyLogo/TokenLogo'
|
|
5
5
|
import { UniverseChainId } from '@luxexchange/lx/src/features/chains/types'
|
|
6
6
|
import { render } from '@luxexchange/lx/src/test/test-utils'
|
|
@@ -8,7 +8,7 @@ import { ON_PRESS_EVENT_PAYLOAD } from '@luxexchange/lx/src/test/fixtures'
|
|
|
8
8
|
import { TestID } from '@luxexchange/lx/src/test/fixtures/testIDs'
|
|
9
9
|
import { act, fireEvent, render } from '@luxexchange/lx/src/test/test-utils'
|
|
10
10
|
|
|
11
|
-
vi.mock('
|
|
11
|
+
vi.mock('utilities/src/addresses', async (importOriginal) => {
|
|
12
12
|
return {
|
|
13
13
|
...(await importOriginal()),
|
|
14
14
|
shortenAddress: vi.fn(({ address }: { address: string }) => `${address.slice(0, 6)}...`),
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Currency } from '@
|
|
1
|
+
import { Currency } from '@luxamm/sdk-core'
|
|
2
2
|
import { OnchainItemListOptionType, TokenOption } from '@luxexchange/lx/src/components/lists/items/types'
|
|
3
3
|
import { filter } from '@luxexchange/lx/src/components/TokenSelector/filter'
|
|
4
4
|
import { DAI, DAI_ARBITRUM_ONE, nativeOnChain } from '@luxexchange/lx/src/constants/tokens'
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ProtocolVersion } from '@uniswap/client-data-api/dist/data/v1/poolTypes_pb'
|
|
2
|
-
import { Currency } from '@
|
|
2
|
+
import { Currency } from '@luxamm/sdk-core'
|
|
3
3
|
import { useMemo } from 'react'
|
|
4
4
|
import { useTranslation } from 'react-i18next'
|
|
5
5
|
import { useDispatch } from 'react-redux'
|
package/src/constants/routing.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Currency, Token, WETH9 } from '@
|
|
1
|
+
import { Currency, Token, WETH9 } from '@luxamm/sdk-core'
|
|
2
2
|
import { GraphQLApi } from '@luxfi/api'
|
|
3
3
|
import type { ImageSourcePropType } from 'react-native'
|
|
4
4
|
import { CELO_LOGO, ETH_LOGO } from '@luxfi/ui/src/assets'
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { SpamCode as RestSpamCode, TokenType } from '@uniswap/client-data-api/dist/data/v1/types_pb'
|
|
2
|
-
import { Token as SdkToken } from '@
|
|
2
|
+
import { Token as SdkToken } from '@luxamm/sdk-core'
|
|
3
3
|
import { GraphQLApi } from '@luxfi/api'
|
|
4
4
|
import { getNativeAddress } from '@luxexchange/lx/src/constants/addresses'
|
|
5
5
|
import { nativeOnChain } from '@luxexchange/lx/src/constants/tokens'
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CurrencyAmount, Token } from '@
|
|
1
|
+
import { CurrencyAmount, Token } from '@luxamm/sdk-core'
|
|
2
2
|
import { GraphQLApi } from '@luxfi/api'
|
|
3
3
|
import { BNB_LOGO } from '@luxfi/ui/src/assets'
|
|
4
4
|
import { DEFAULT_NATIVE_ADDRESS_LEGACY, getQuicknodeEndpointUrl } from '@luxexchange/lx/src/features/chains/evm/rpc'
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Token } from '@
|
|
1
|
+
import { Token } from '@luxamm/sdk-core'
|
|
2
2
|
import { GraphQLApi } from '@luxfi/api'
|
|
3
3
|
import { ETH_LOGO, WORLD_CHAIN_LOGO } from '@luxfi/ui/src/assets'
|
|
4
4
|
import { DEFAULT_NATIVE_ADDRESS_LEGACY, getQuicknodeEndpointUrl } from '@luxexchange/lx/src/features/chains/evm/rpc'
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Token } from '@
|
|
1
|
+
import { Token } from '@luxamm/sdk-core'
|
|
2
2
|
import { buildChainTokens } from '@luxexchange/lx/src/features/chains/evm/tokens'
|
|
3
3
|
import { UniverseChainId } from '@luxexchange/lx/src/features/chains/types'
|
|
4
4
|
import { buildDAI, buildUSDC, buildUSDT } from '@luxexchange/lx/src/features/tokens/stablecoin'
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { BigNumber, BigNumberish } from '@ethersproject/bignumber'
|
|
2
|
-
import { Token } from '@
|
|
2
|
+
import { Token } from '@luxamm/sdk-core'
|
|
3
3
|
import { GraphQLApi } from '@luxfi/api'
|
|
4
4
|
import { PollingInterval } from '@luxexchange/lx/src/constants/misc'
|
|
5
5
|
import { ALL_CHAIN_IDS, getChainInfo, ORDERED_CHAINS } from '@luxexchange/lx/src/features/chains/chainInfo'
|
|
@@ -4,7 +4,7 @@ import { useQueryClient } from '@tanstack/react-query'
|
|
|
4
4
|
import { GetPortfolioResponse } from '@uniswap/client-data-api/dist/data/v1/api_pb.d'
|
|
5
5
|
import { Balance } from '@uniswap/client-data-api/dist/data/v1/types_pb'
|
|
6
6
|
import { PortfolioValueModifier as RestPortfolioValueModifier } from '@uniswap/client-data-api/dist/data/v1/types_pb.d'
|
|
7
|
-
import { Currency } from '@
|
|
7
|
+
import { Currency } from '@luxamm/sdk-core'
|
|
8
8
|
import { useMemo } from 'react'
|
|
9
9
|
import { PollingInterval } from '@luxexchange/lx/src/constants/misc'
|
|
10
10
|
import { normalizeTokenAddressForCache } from '@luxexchange/lx/src/data/cache'
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { NetworkStatus } from '@apollo/client'
|
|
2
2
|
import { Token as RestToken } from '@uniswap/client-data-api/dist/data/v1/types_pb'
|
|
3
|
-
import { Currency } from '@
|
|
3
|
+
import { Currency } from '@luxamm/sdk-core'
|
|
4
4
|
import { PortfolioBalance } from '@luxexchange/lx/src/features/dataApi/types'
|
|
5
5
|
import { isNativeCurrencyAddress } from '@luxexchange/lx/src/utils/currencyId'
|
|
6
6
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type NetworkStatus } from '@apollo/client'
|
|
2
2
|
import { type Contract } from '@uniswap/client-data-api/dist/data/v1/types_pb'
|
|
3
|
-
import { type Currency } from '@
|
|
3
|
+
import { type Currency } from '@luxamm/sdk-core'
|
|
4
4
|
import { type GraphQLApi, type SpamCode } from '@luxfi/api'
|
|
5
5
|
import { type FoTPercent } from '@luxexchange/lx/src/features/tokens/warnings/TokenWarningModal'
|
|
6
6
|
import { type CurrencyId } from '@luxexchange/lx/src/types/currency'
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { NativeCurrency, Token } from '@
|
|
1
|
+
import { NativeCurrency, Token } from '@luxamm/sdk-core'
|
|
2
2
|
import { UniverseChainId } from '@luxexchange/lx/src/features/chains/types'
|
|
3
3
|
import { buildCurrency } from '@luxexchange/lx/src/features/dataApi/utils/buildCurrency'
|
|
4
4
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { BigNumber } from '@ethersproject/bignumber'
|
|
2
|
-
import { NativeCurrency, Token } from '@
|
|
2
|
+
import { NativeCurrency, Token } from '@luxamm/sdk-core'
|
|
3
3
|
import { nativeOnChain, WRAPPED_NATIVE_CURRENCY } from '@luxexchange/lx/src/constants/tokens'
|
|
4
4
|
import { normalizeTokenAddressForCache } from '@luxexchange/lx/src/data/cache'
|
|
5
5
|
import { WRAPPED_SOL_ADDRESS_SOLANA } from '@luxexchange/lx/src/features/chains/svm/defaults'
|
|
@@ -14,7 +14,7 @@ const { mockIsAndroid, mockIsIOS, mockIsWebAndroid, mockIsWebIOS } = vi.hoisted(
|
|
|
14
14
|
mockIsWebIOS: vi.fn().mockReturnValue(false),
|
|
15
15
|
}))
|
|
16
16
|
|
|
17
|
-
vi.mock('
|
|
17
|
+
vi.mock('utilities/src/platform', () => ({
|
|
18
18
|
isAndroid: mockIsAndroid,
|
|
19
19
|
isIOS: mockIsIOS,
|
|
20
20
|
isWebAndroid: mockIsWebAndroid,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Currency, CurrencyAmount } from '@
|
|
1
|
+
import { Currency, CurrencyAmount } from '@luxamm/sdk-core'
|
|
2
2
|
import { DynamicConfigs, SwapConfigKey, useDynamicConfigValue } from '@luxfi/gating'
|
|
3
3
|
import JSBI from 'jsbi'
|
|
4
4
|
import { getChainInfo } from '@luxexchange/lx/src/features/chains/chainInfo'
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CurrencyAmount } from '@
|
|
1
|
+
import { CurrencyAmount } from '@luxamm/sdk-core'
|
|
2
2
|
import { DAI } from '@luxexchange/lx/src/constants/tokens'
|
|
3
3
|
import { applyNativeTokenPercentageBuffer, hasSufficientFundsIncludingGas } from '@luxexchange/lx/src/features/gas/utils'
|
|
4
4
|
import { MAINNET_CURRENCY } from '@luxexchange/lx/src/test/fixtures'
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { TradeType } from '@
|
|
1
|
+
import { TradeType } from '@luxamm/sdk-core'
|
|
2
2
|
import { AssetType } from '@luxexchange/lx/src/entities/assets'
|
|
3
3
|
import { UniverseChainId } from '@luxexchange/lx/src/features/chains/types'
|
|
4
4
|
import { CurrencyInfo } from '@luxexchange/lx/src/features/dataApi/types'
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ApolloCache, NormalizedCacheObject } from '@apollo/client'
|
|
2
|
-
import { CurrencyAmount, NativeCurrency, Token } from '@
|
|
2
|
+
import { CurrencyAmount, NativeCurrency, Token } from '@luxamm/sdk-core'
|
|
3
3
|
import { GraphQLApi, TradingApi } from '@luxfi/api'
|
|
4
4
|
import { getNativeAddress } from '@luxexchange/lx/src/constants/addresses'
|
|
5
5
|
import { fetchTradingApiIndicativeQuoteIgnoring404 } from '@luxexchange/lx/src/data/apiClients/tradingApi/useTradingApiIndicativeQuoteQuery'
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import '
|
|
1
|
+
import 'utilities/src/logger/mocks'
|
|
2
2
|
import { GetPortfolioResponse } from '@uniswap/client-data-api/dist/data/v1/api_pb.d'
|
|
3
3
|
import { type Token as SearchToken } from '@uniswap/client-search/dist/search/v1/api_pb'
|
|
4
4
|
import * as searchTokensAndPools from '@luxexchange/lx/src/data/rest/searchTokensAndPools'
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { PartialMessage } from '@bufbuild/protobuf'
|
|
2
2
|
import { GetPortfolioResponse } from '@uniswap/client-data-api/dist/data/v1/api_pb.d'
|
|
3
3
|
import { Balance } from '@uniswap/client-data-api/dist/data/v1/types_pb'
|
|
4
|
-
import { CurrencyAmount, NativeCurrency, Token } from '@
|
|
4
|
+
import { CurrencyAmount, NativeCurrency, Token } from '@luxamm/sdk-core'
|
|
5
5
|
import { TradingApi } from '@luxfi/api'
|
|
6
6
|
import { getNativeAddress } from '@luxexchange/lx/src/constants/addresses'
|
|
7
7
|
import { fetchTokenByAddress, searchTokenToCurrencyInfo } from '@luxexchange/lx/src/data/rest/searchTokensAndPools'
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import '
|
|
1
|
+
import 'utilities/src/logger/mocks'
|
|
2
2
|
import { PartialMessage } from '@bufbuild/protobuf'
|
|
3
3
|
import { GetPortfolioResponse } from '@uniswap/client-data-api/dist/data/v1/api_pb.d'
|
|
4
4
|
import { Balance } from '@uniswap/client-data-api/dist/data/v1/types_pb'
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ProtocolVersion } from '@uniswap/client-data-api/dist/data/v1/poolTypes_pb'
|
|
2
|
-
import { Currency } from '@
|
|
2
|
+
import { Currency } from '@luxamm/sdk-core'
|
|
3
3
|
import { UniverseChainId } from '@luxexchange/lx/src/features/chains/types'
|
|
4
4
|
import { LuxEventName } from '@luxexchange/lx/src/features/telemetry/constants'
|
|
5
5
|
import { sendAnalyticsEvent } from '@luxexchange/lx/src/features/telemetry/send'
|
|
@@ -18,7 +18,7 @@ import type { Mock } from 'vitest'
|
|
|
18
18
|
const mockPlatformState = vi.hoisted(() => ({ isMobileApp: false }))
|
|
19
19
|
|
|
20
20
|
vi.mock('lx/src/features/telemetry/send')
|
|
21
|
-
vi.mock('
|
|
21
|
+
vi.mock('utilities/src/platform', () => ({
|
|
22
22
|
get isMobileApp(): boolean {
|
|
23
23
|
return mockPlatformState.isMobileApp
|
|
24
24
|
},
|
|
@@ -13,8 +13,8 @@ const { mockIsMobileApp } = vi.hoisted(() => ({
|
|
|
13
13
|
mockIsMobileApp: { value: false },
|
|
14
14
|
}))
|
|
15
15
|
|
|
16
|
-
vi.mock('
|
|
17
|
-
const actual = await importOriginal<typeof import('
|
|
16
|
+
vi.mock('utilities/src/platform', async (importOriginal) => {
|
|
17
|
+
const actual = await importOriginal<typeof import('utilities/src/platform')>()
|
|
18
18
|
return {
|
|
19
19
|
...actual,
|
|
20
20
|
get isMobileApp(): boolean {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Currency, Token } from '@
|
|
1
|
+
import { Currency, Token } from '@luxamm/sdk-core'
|
|
2
2
|
import invariant from 'tiny-invariant'
|
|
3
3
|
import type { UniverseChainId } from '@luxexchange/lx/src/features/chains/types'
|
|
4
4
|
import { isSVMAddress } from '@luxfi/utilities/src/addresses/svm/svm'
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CurrencyAmount } from '@
|
|
1
|
+
import { CurrencyAmount } from '@luxamm/sdk-core'
|
|
2
2
|
import { DAI } from '@luxexchange/lx/src/constants/tokens'
|
|
3
3
|
import { getCurrencyAmount, ValueType } from '@luxexchange/lx/src/features/tokens/getCurrencyAmount'
|
|
4
4
|
import { noOpFunction } from '@luxfi/utilities/src/test/utils'
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { BigNumber } from '@ethersproject/bignumber'
|
|
2
2
|
import { parseUnits } from '@ethersproject/units'
|
|
3
|
-
import { Currency, CurrencyAmount } from '@
|
|
3
|
+
import { Currency, CurrencyAmount } from '@luxamm/sdk-core'
|
|
4
4
|
import { convertScientificNotationToNumber } from '@luxfi/utilities/src/format/convertScientificNotation'
|
|
5
5
|
import { logger } from '@luxfi/utilities/src/logger/logger'
|
|
6
6
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Currency, NativeCurrency, Token } from '@
|
|
1
|
+
import { Currency, NativeCurrency, Token } from '@luxamm/sdk-core'
|
|
2
2
|
import { GraphQLApi } from '@luxfi/api'
|
|
3
3
|
import { WarningSeverity } from '@luxexchange/lx/src/components/modals/WarningModal/types'
|
|
4
4
|
import { AttackType, CurrencyInfo, SafetyInfo, TokenList } from '@luxexchange/lx/src/features/dataApi/types'
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/* eslint-disable consistent-return */
|
|
2
|
-
import { Currency, NativeCurrency } from '@
|
|
2
|
+
import { Currency, NativeCurrency } from '@luxamm/sdk-core'
|
|
3
3
|
import { GraphQLApi } from '@luxfi/api'
|
|
4
4
|
import { useTranslation } from 'react-i18next'
|
|
5
5
|
import { ColorTokens } from '@luxfi/ui/src'
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Currency, CurrencyAmount } from '@
|
|
1
|
+
import { Currency, CurrencyAmount } from '@luxamm/sdk-core'
|
|
2
2
|
import { useTranslation } from 'react-i18next'
|
|
3
3
|
import { Flex, Text } from '@luxfi/ui/src'
|
|
4
4
|
// biome-ignore lint/style/noRestrictedImports: legacy import will be migrated
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Percent } from '@
|
|
1
|
+
import { Percent } from '@luxamm/sdk-core'
|
|
2
2
|
import { WarningSeverity } from '@luxexchange/lx/src/components/modals/WarningModal/types'
|
|
3
3
|
import { CurrencyInfo } from '@luxexchange/lx/src/features/dataApi/types'
|
|
4
4
|
import { TokenProtectionWarning } from '@luxexchange/lx/src/features/tokens/warnings/types'
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import '
|
|
1
|
+
import 'utilities/src/logger/mocks'
|
|
2
2
|
import { TradingApi } from '@luxexchange/api'
|
|
3
3
|
import { ContractTransaction, providers } from 'ethers/lib/ethers'
|
|
4
4
|
import { UniverseChainId } from '@luxexchange/lx/src/features/chains/types'
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Currency } from '@
|
|
1
|
+
import { Currency } from '@luxamm/sdk-core'
|
|
2
2
|
import { createContext, PropsWithChildren, useContext, useMemo } from 'react'
|
|
3
3
|
import type { StyleProp, ViewStyle } from 'react-native'
|
|
4
4
|
import { AuthTrigger } from '@luxexchange/lx/src/features/auth/types'
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Currency, CurrencyAmount, Price, Token, TradeType } from '@
|
|
1
|
+
import { Currency, CurrencyAmount, Price, Token, TradeType } from '@luxamm/sdk-core'
|
|
2
2
|
import JSBI from 'jsbi'
|
|
3
3
|
import { useMemo } from 'react'
|
|
4
4
|
import { PollingInterval } from '@luxexchange/lx/src/constants/misc'
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CurrencyAmount } from '@
|
|
1
|
+
import { CurrencyAmount } from '@luxamm/sdk-core'
|
|
2
2
|
import { createCollectFeesStep } from '@luxexchange/lx/src/features/transactions/liquidity/steps/collectFees'
|
|
3
3
|
import { orderCollectFeesSteps } from '@luxexchange/lx/src/features/transactions/liquidity/steps/collectFeesSteps'
|
|
4
4
|
import { orderDecreaseLiquiditySteps } from '@luxexchange/lx/src/features/transactions/liquidity/steps/decreaseLiquiditySteps'
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Currency } from '@
|
|
1
|
+
import { Currency } from '@luxamm/sdk-core'
|
|
2
2
|
import { RevokeApproveFields, TransactionStepType } from '@luxexchange/lx/src/features/transactions/steps/types'
|
|
3
3
|
import { ValidatedTransactionRequest } from '@luxexchange/lx/src/features/transactions/types/transactionRequests'
|
|
4
4
|
import { parseERC20ApproveCalldata } from '@luxexchange/lx/src/utils/approvals'
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Currency, CurrencyAmount, Token } from '@
|
|
1
|
+
import { Currency, CurrencyAmount, Token } from '@luxamm/sdk-core'
|
|
2
2
|
import { OnChainTransactionFields, TransactionStepType } from '@luxexchange/lx/src/features/transactions/steps/types'
|
|
3
3
|
import { ValidatedTransactionRequest } from '@luxexchange/lx/src/features/transactions/types/transactionRequests'
|
|
4
4
|
import { parseERC20ApproveCalldata } from '@luxexchange/lx/src/utils/approvals'
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Currency, CurrencyAmount } from '@
|
|
1
|
+
import type { Currency, CurrencyAmount } from '@luxamm/sdk-core'
|
|
2
2
|
import { OnChainTransactionFields, TransactionStepType } from '@luxexchange/lx/src/features/transactions/steps/types'
|
|
3
3
|
import type { ValidatedTransactionRequest } from '@luxexchange/lx/src/features/transactions/types/transactionRequests'
|
|
4
4
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { TradeType } from '@
|
|
1
|
+
import { TradeType } from '@luxamm/sdk-core'
|
|
2
2
|
import { useTranslation } from 'react-i18next'
|
|
3
3
|
import { Flex, Text } from '@luxfi/ui/src'
|
|
4
4
|
import { AlertTriangleFilled } from '@luxfi/ui/src/components/icons/AlertTriangleFilled'
|