@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
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { TradeType } from '@
|
|
1
|
+
import { TradeType } from '@luxamm/sdk-core'
|
|
2
2
|
import { useMemo } from 'react'
|
|
3
3
|
import { useLocalizationContext } from '@luxexchange/lx/src/features/language/LocalizationContext'
|
|
4
4
|
import { TradeWithSlippage } from '@luxexchange/lx/src/features/transactions/swap/types/trade'
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CurrencyAmount, Percent } from '@
|
|
1
|
+
import { CurrencyAmount, Percent } from '@luxamm/sdk-core'
|
|
2
2
|
import { TradingApi } from '@luxfi/api'
|
|
3
3
|
import { DAI, USDC } from '@luxexchange/lx/src/constants/tokens'
|
|
4
4
|
import { usePriceImpact } from '@luxexchange/lx/src/features/transactions/swap/components/PriceImpactRow/usePriceImpact'
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Percent } from '@
|
|
1
|
+
import { Percent } from '@luxamm/sdk-core'
|
|
2
2
|
import { useMemo } from 'react'
|
|
3
3
|
import { useLocalizationContext } from '@luxexchange/lx/src/features/language/LocalizationContext'
|
|
4
4
|
import { DerivedSwapInfo } from '@luxexchange/lx/src/features/transactions/swap/types/derivedSwapInfo'
|
|
@@ -109,7 +109,7 @@ vi.mock('lx/src/features/transactions/swap/services/hooks/useWarningService', ()
|
|
|
109
109
|
useWarningService: vi.fn(),
|
|
110
110
|
}))
|
|
111
111
|
|
|
112
|
-
vi.mock('
|
|
112
|
+
vi.mock('utilities/src/react/hooks', () => ({
|
|
113
113
|
useEvent: <T extends (...args: never[]) => unknown>(handler: T): T => handler,
|
|
114
114
|
}))
|
|
115
115
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { BigNumber } from '@ethersproject/bignumber'
|
|
2
|
-
import { TradeType } from '@
|
|
2
|
+
import { TradeType } from '@luxamm/sdk-core'
|
|
3
3
|
import { SwapEventName } from '@luxexchange/lx/src/features/telemetry/constants'
|
|
4
4
|
import { sendAnalyticsEvent } from '@luxexchange/lx/src/features/telemetry/send'
|
|
5
5
|
import { TransactionScreen } from '@luxexchange/lx/src/features/transactions/components/TransactionModal/TransactionModalContext'
|
package/src/features/transactions/swap/form/SwapFormScreen/YouReceiveDetails/SwapDetailsRow.tsx
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Currency, CurrencyAmount } from '@
|
|
1
|
+
import { Currency, CurrencyAmount } from '@luxamm/sdk-core'
|
|
2
2
|
import { ReactNode, useEffect, useMemo, useRef } from 'react'
|
|
3
3
|
import { Flex, Text, TextProps } from '@luxfi/ui/src'
|
|
4
4
|
import { AlertTriangleFilled } from '@luxfi/ui/src/components/icons/AlertTriangleFilled'
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { QueryClient } from '@tanstack/react-query'
|
|
2
2
|
import { useQueryClient } from '@tanstack/react-query'
|
|
3
|
-
import type { Currency } from '@
|
|
3
|
+
import type { Currency } from '@luxamm/sdk-core'
|
|
4
4
|
import { TradingApi } from '@luxfi/api'
|
|
5
5
|
import { useMemo } from 'react'
|
|
6
6
|
import { getSwappableTokensQueryData } from '@luxexchange/lx/src/data/apiClients/tradingApi/useTradingApiSwappableTokensQuery'
|
package/src/features/transactions/swap/form/stores/swapFormScreenStore/createSwapFormScreenStore.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Currency, CurrencyAmount } from '@
|
|
1
|
+
import type { Currency, CurrencyAmount } from '@luxamm/sdk-core'
|
|
2
2
|
import type { MutableRefObject } from 'react'
|
|
3
3
|
import type { PresetPercentage } from '@luxexchange/lx/src/components/CurrencyInputPanel/AmountInputPresets/types'
|
|
4
4
|
import type { CurrencyInputPanelRef } from '@luxexchange/lx/src/components/CurrencyInputPanel/types'
|
|
@@ -8,16 +8,16 @@ import { CurrencyField } from '@luxexchange/lx/src/types/currency'
|
|
|
8
8
|
import type { Mock } from 'vitest'
|
|
9
9
|
|
|
10
10
|
// Mock all dependencies
|
|
11
|
-
vi.mock('
|
|
11
|
+
vi.mock('utilities/src/platform', () => ({
|
|
12
12
|
isWebPlatform: true,
|
|
13
13
|
isMobileApp: false,
|
|
14
14
|
}))
|
|
15
15
|
|
|
16
|
-
vi.mock('
|
|
16
|
+
vi.mock('utilities/src/telemetry/trace/TraceContext', () => ({
|
|
17
17
|
useTrace: vi.fn(() => ({})),
|
|
18
18
|
}))
|
|
19
19
|
|
|
20
|
-
vi.mock('
|
|
20
|
+
vi.mock('utilities/src/react/hooks', () => ({
|
|
21
21
|
useEvent: vi.fn((fn) => fn),
|
|
22
22
|
}))
|
|
23
23
|
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { CurrencyAmount, Token } from '@
|
|
1
|
+
import { CurrencyAmount, Token } from '@luxamm/sdk-core'
|
|
2
2
|
import i18next from 'i18next'
|
|
3
3
|
import { WarningAction, WarningLabel, WarningSeverity } from '@luxexchange/lx/src/components/modals/WarningModal/types'
|
|
4
4
|
import { getBalanceWarning } from '@luxexchange/lx/src/features/transactions/swap/hooks/useSwapWarnings/getBalanceWarning'
|
|
5
5
|
import { DerivedSwapInfo } from '@luxexchange/lx/src/features/transactions/swap/types/derivedSwapInfo'
|
|
6
6
|
import { CurrencyField } from '@luxexchange/lx/src/types/currency'
|
|
7
7
|
|
|
8
|
-
vi.mock('
|
|
8
|
+
vi.mock('utilities/src/platform', () => ({
|
|
9
9
|
isAndroid: false,
|
|
10
10
|
isIOS: false,
|
|
11
11
|
isWebPlatform: true,
|
package/src/features/transactions/swap/hooks/useSwapWarnings/getFormIncompleteWarning.test.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Currency, CurrencyAmount } from '@
|
|
1
|
+
import { Currency, CurrencyAmount } from '@luxamm/sdk-core'
|
|
2
2
|
import { WarningAction, WarningLabel, WarningSeverity } from '@luxexchange/lx/src/components/modals/WarningModal/types'
|
|
3
3
|
import { nativeOnChain, USDC } from '@luxexchange/lx/src/constants/tokens'
|
|
4
4
|
import { UniverseChainId } from '@luxexchange/lx/src/features/chains/types'
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Percent } from '@
|
|
1
|
+
import { Percent } from '@luxamm/sdk-core'
|
|
2
2
|
import i18next from 'i18next'
|
|
3
3
|
import { WarningAction, WarningLabel, WarningSeverity } from '@luxexchange/lx/src/components/modals/WarningModal/types'
|
|
4
4
|
import { CurrencyInfo } from '@luxexchange/lx/src/features/dataApi/types'
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Percent } from '@
|
|
1
|
+
import { Percent } from '@luxamm/sdk-core'
|
|
2
2
|
import { TFunction } from 'i18next'
|
|
3
3
|
import { Warning, WarningAction, WarningLabel, WarningSeverity } from '@luxexchange/lx/src/components/modals/WarningModal/types'
|
|
4
4
|
import { luxUrls } from '@luxexchange/lx/src/constants/urls'
|
|
@@ -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 i18next from 'i18next'
|
|
4
4
|
import { WarningAction, WarningLabel, WarningSeverity } from '@luxexchange/lx/src/components/modals/WarningModal/types'
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CurrencyAmount } from '@
|
|
1
|
+
import { CurrencyAmount } from '@luxamm/sdk-core'
|
|
2
2
|
import { GraphQLApi } from '@luxfi/api'
|
|
3
3
|
import { WarningLabel } from '@luxexchange/lx/src/components/modals/WarningModal/types'
|
|
4
4
|
import { DAI, nativeOnChain, USDC } from '@luxexchange/lx/src/constants/tokens'
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { TradeType } from '@
|
|
1
|
+
import { TradeType } from '@luxamm/sdk-core'
|
|
2
2
|
import { FetchError } from '@luxfi/api'
|
|
3
3
|
import { UniverseChainId } from '@luxexchange/lx/src/features/chains/types'
|
|
4
4
|
import { SwapEventName } from '@luxexchange/lx/src/features/telemetry/constants/features'
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Currency, CurrencyAmount, TradeType as SdkTradeType } from '@
|
|
1
|
+
import { Currency, CurrencyAmount, TradeType as SdkTradeType } from '@luxamm/sdk-core'
|
|
2
2
|
import { TradingApi } from '@luxfi/api'
|
|
3
3
|
import { areCurrencyIdsEqual, currencyId } from '@luxexchange/lx/src/utils/currencyId'
|
|
4
4
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Currency } from '@
|
|
1
|
+
import { Currency } from '@luxamm/sdk-core'
|
|
2
2
|
import { useMemo } from 'react'
|
|
3
3
|
import { parseQuoteCurrencies } from '@luxexchange/lx/src/features/transactions/swap/hooks/useTrade/parseQuoteCurrencies'
|
|
4
4
|
import { useIndicativeTradeQuery } from '@luxexchange/lx/src/features/transactions/swap/hooks/useTrade/useIndicativeTradeQuery'
|
|
@@ -70,7 +70,7 @@ vi.mock('lx/src/features/transactions/swap/plan/watchPlanStepSaga', () => ({
|
|
|
70
70
|
}),
|
|
71
71
|
}))
|
|
72
72
|
|
|
73
|
-
vi.mock('
|
|
73
|
+
vi.mock('utilities/src/async/retryWithBackoff', () => ({
|
|
74
74
|
retryWithBackoff: vi.fn().mockResolvedValue(undefined),
|
|
75
75
|
BackoffStrategy: { None: 'none' },
|
|
76
76
|
}))
|
|
@@ -21,7 +21,7 @@ const { mockLogger } = vi.hoisted(() => ({
|
|
|
21
21
|
},
|
|
22
22
|
}))
|
|
23
23
|
|
|
24
|
-
vi.mock('
|
|
24
|
+
vi.mock('utilities/src/logger/logger', () => ({
|
|
25
25
|
logger: mockLogger,
|
|
26
26
|
}))
|
|
27
27
|
vi.mock('lx/src/data/apiClients/tradingApi/useCheckApprovalQuery')
|
package/src/features/transactions/swap/review/services/swapTxAndGasInfoService/utils.test.ts
CHANGED
|
@@ -65,8 +65,8 @@ describe('processWrapResponse (smart contract unwrap fallback)', () => {
|
|
|
65
65
|
vi.resetModules()
|
|
66
66
|
|
|
67
67
|
// Mock the platform module before importing
|
|
68
|
-
vi.doMock('
|
|
69
|
-
const actual = await vi.importActual<typeof import('
|
|
68
|
+
vi.doMock('utilities/src/platform', async () => {
|
|
69
|
+
const actual = await vi.importActual<typeof import('utilities/src/platform')>('utilities/src/platform')
|
|
70
70
|
return {
|
|
71
71
|
...actual,
|
|
72
72
|
isWebApp: true,
|
|
@@ -109,7 +109,7 @@ describe('processWrapResponse (smart contract unwrap fallback)', () => {
|
|
|
109
109
|
|
|
110
110
|
// Clean up by resetting mocks
|
|
111
111
|
vi.resetModules()
|
|
112
|
-
vi.doUnmock('
|
|
112
|
+
vi.doUnmock('utilities/src/platform')
|
|
113
113
|
})
|
|
114
114
|
})
|
|
115
115
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type Currency, type CurrencyAmount, TradeType as SdkTradeType } from '@
|
|
1
|
+
import { type Currency, type CurrencyAmount, TradeType as SdkTradeType } from '@luxamm/sdk-core'
|
|
2
2
|
import { type DiscriminatedQuoteResponse, type GasEstimate, TradingApi } from '@luxfi/api'
|
|
3
3
|
import { type QuoteCurrencyData } from '@luxexchange/lx/src/features/transactions/swap/hooks/useTrade/parseQuoteCurrencies'
|
|
4
4
|
import { getGasEstimate } from '@luxexchange/lx/src/features/transactions/swap/services/tradeService/transformations/estimateGas'
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Currency, CurrencyAmount } from '@
|
|
1
|
+
import { Currency, CurrencyAmount } from '@luxamm/sdk-core'
|
|
2
2
|
import { UniverseChainId } from '@luxexchange/lx/src/features/chains/types'
|
|
3
3
|
import { CurrencyInfo } from '@luxexchange/lx/src/features/dataApi/types'
|
|
4
4
|
import { TradeWithStatus } from '@luxexchange/lx/src/features/transactions/swap/types/trade'
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Percent } from '@
|
|
1
|
+
import { Percent } from '@luxamm/sdk-core'
|
|
2
2
|
import { ClassicQuoteResponse, DiscriminatedQuoteResponse, TradingApi } from '@luxfi/api'
|
|
3
3
|
import { getTradingApiSwapFee } from '@luxexchange/lx/src/features/transactions/swap/types/getTradingApiSwapFee'
|
|
4
4
|
import { CurrencyField } from '@luxexchange/lx/src/types/currency'
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Percent } from '@
|
|
1
|
+
import { Percent } from '@luxamm/sdk-core'
|
|
2
2
|
import { type DiscriminatedQuoteResponse } from '@luxfi/api'
|
|
3
3
|
import { SwapFee } from '@luxexchange/lx/src/features/transactions/swap/types/trade'
|
|
4
4
|
import { isWrap } from '@luxexchange/lx/src/features/transactions/swap/utils/routing'
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Currency } from '@
|
|
1
|
+
import { Currency } from '@luxamm/sdk-core'
|
|
2
2
|
import { JupiterOrderResponse } from '@luxfi/api'
|
|
3
3
|
import { UniverseChainId } from '@luxexchange/lx/src/features/chains/types'
|
|
4
4
|
import { createSolanaTrade } from '@luxexchange/lx/src/features/transactions/swap/types/solana'
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ZERO_PERCENT } from '@uniswap/router-sdk'
|
|
2
|
-
import { Currency, CurrencyAmount, Percent, Price, TradeType } from '@
|
|
2
|
+
import { Currency, CurrencyAmount, Percent, Price, TradeType } from '@luxamm/sdk-core'
|
|
3
3
|
import { JupiterOrderResponse, TradingApi } from '@luxfi/api'
|
|
4
4
|
import { BIPS_BASE } from '@luxexchange/lx/src/constants/misc'
|
|
5
5
|
import { BlockingTradeError } from '@luxexchange/lx/src/features/transactions/swap/types/BlockingTradeError'
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/* eslint-disable no-new */
|
|
2
|
-
import { TradeType } from '@
|
|
2
|
+
import { TradeType } from '@luxamm/sdk-core'
|
|
3
3
|
import { TradingApi } from '@luxfi/api'
|
|
4
4
|
import { UnwrapTrade, WrapTrade } from '@luxexchange/lx/src/features/transactions/swap/types/trade'
|
|
5
5
|
import { ETH, WETH } from '@luxexchange/lx/src/test/fixtures/lib/sdk'
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Currency, CurrencyAmount } from '@
|
|
1
|
+
import { Currency, CurrencyAmount } from '@luxamm/sdk-core'
|
|
2
2
|
import { GasEstimate } from '@luxfi/api'
|
|
3
3
|
import { ValidatedTransactionRequest } from '@luxexchange/lx/src/features/transactions/types/transactionRequests'
|
|
4
4
|
import { WrapType } from '@luxexchange/lx/src/features/transactions/types/wrap'
|
|
@@ -17,8 +17,8 @@ import {
|
|
|
17
17
|
// Use vi.hoisted to create a mutable mock state that can be changed between tests
|
|
18
18
|
const mockPlatformState = vi.hoisted(() => ({ isWebApp: false }))
|
|
19
19
|
|
|
20
|
-
vi.mock('
|
|
21
|
-
const actual = await importOriginal<typeof import('
|
|
20
|
+
vi.mock('utilities/src/platform', async (importOriginal) => {
|
|
21
|
+
const actual = await importOriginal<typeof import('utilities/src/platform')>()
|
|
22
22
|
return {
|
|
23
23
|
...actual,
|
|
24
24
|
get isWebApp(): boolean {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { renderHook } from '@testing-library/react'
|
|
2
|
-
import { Token } from '@
|
|
2
|
+
import { Token } from '@luxamm/sdk-core'
|
|
3
3
|
import { UniverseChainId } from '@luxexchange/lx/src/features/chains/types'
|
|
4
4
|
import { CurrencyInfo } from '@luxexchange/lx/src/features/dataApi/types'
|
|
5
5
|
import { buildCurrency } from '@luxexchange/lx/src/features/dataApi/utils/buildCurrency'
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Token } from '@
|
|
1
|
+
import { Token } from '@luxamm/sdk-core'
|
|
2
2
|
import { toSupportedChainId } from '@luxexchange/lx/src/features/chains/utils'
|
|
3
3
|
import { CurrencyInfo } from '@luxexchange/lx/src/features/dataApi/types'
|
|
4
4
|
import { isSVMChain } from '@luxexchange/lx/src/features/platforms/utils/chains'
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type Currency, CurrencyAmount, Percent } from '@
|
|
1
|
+
import { type Currency, CurrencyAmount, Percent } from '@luxamm/sdk-core'
|
|
2
2
|
import { getCurrencyAmount, ValueType } from '@luxexchange/lx/src/features/tokens/getCurrencyAmount'
|
|
3
3
|
import type { DerivedSwapInfo } from '@luxexchange/lx/src/features/transactions/swap/types/derivedSwapInfo'
|
|
4
4
|
import { getSwapFeeUsdFromDerivedSwapInfo } from '@luxexchange/lx/src/features/transactions/swap/utils/getSwapFeeUsd'
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Currency, CurrencyAmount } from '@
|
|
1
|
+
import { Currency, CurrencyAmount } from '@luxamm/sdk-core'
|
|
2
2
|
import { getCurrencyAmount, ValueType } from '@luxexchange/lx/src/features/tokens/getCurrencyAmount'
|
|
3
3
|
import { DerivedSwapInfo } from '@luxexchange/lx/src/features/transactions/swap/types/derivedSwapInfo'
|
|
4
4
|
import { SwapFee } from '@luxexchange/lx/src/features/transactions/swap/types/trade'
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Currency, CurrencyAmount } from '@
|
|
1
|
+
import { Currency, CurrencyAmount } from '@luxamm/sdk-core'
|
|
2
2
|
import { CurrencyInfo } from '@luxexchange/lx/src/features/dataApi/types'
|
|
3
3
|
import { DerivedSwapInfo } from '@luxexchange/lx/src/features/transactions/swap/types/derivedSwapInfo'
|
|
4
4
|
import { WrapType } from '@luxexchange/lx/src/features/transactions/types/wrap'
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { type Currency, CurrencyAmount, TradeType } from '@
|
|
2
|
-
import { FeeAmount, Pool, Route } from '@
|
|
1
|
+
import { type Currency, CurrencyAmount, TradeType } from '@luxamm/sdk-core'
|
|
2
|
+
import { FeeAmount, Pool, Route } from '@luxamm/v3-sdk'
|
|
3
3
|
import { type ClassicQuoteResponse, TradingApi } from '@luxfi/api'
|
|
4
4
|
import { UNI, WBTC } from '@luxexchange/lx/src/constants/tokens'
|
|
5
5
|
import { UniverseChainId } from '@luxexchange/lx/src/features/chains/types'
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/* eslint-disable max-lines */
|
|
2
2
|
import { BigNumber } from '@ethersproject/bignumber'
|
|
3
3
|
import { MixedRouteSDK } from '@uniswap/router-sdk'
|
|
4
|
-
import type { Currency, TradeType } from '@
|
|
4
|
+
import type { Currency, TradeType } from '@luxamm/sdk-core'
|
|
5
5
|
// IMPORTANT: Must use @lux packages for pool/route types because @uniswap/router-sdk
|
|
6
6
|
// uses instanceof checks against @lux classes. Using @luxamm would fail those checks.
|
|
7
7
|
// CurrencyAmount and Token must also be from @uniswap/sdk-core for pool constructors.
|
|
@@ -65,7 +65,7 @@ export function transformTradingApiResponseToTrade(params: TradingApiResponseToT
|
|
|
65
65
|
|
|
66
66
|
// Type assertions needed because we use @lux/* SDKs for route/pool types
|
|
67
67
|
// to pass instanceof checks in @uniswap/router-sdk, but ClassicTrade types
|
|
68
|
-
// reference @
|
|
68
|
+
// reference @luxamm/* SDKs. The runtime behavior is correct.
|
|
69
69
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
70
70
|
return new ClassicTrade({
|
|
71
71
|
quote: data,
|
|
@@ -208,7 +208,7 @@ function computeRoutes({
|
|
|
208
208
|
routev3: isOnlyV3 ? new V3Route(route.map(parseV3PoolApi), parsedCurrencyIn, parsedCurrencyOut) : null,
|
|
209
209
|
routev2: isOnlyV2 ? new V2Route(route.map(parseV2PairApi), parsedCurrencyIn, parsedCurrencyOut) : null,
|
|
210
210
|
// Type assertion needed because @uniswap/router-sdk uses @lux/* SDKs internally
|
|
211
|
-
// while local code uses @
|
|
211
|
+
// while local code uses @luxamm/* SDKs which have incompatible private property declarations
|
|
212
212
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
213
213
|
mixedRoute:
|
|
214
214
|
!isOnlyV3 && !isOnlyV2 && !isOnlyV4
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Currency } from '@
|
|
1
|
+
import { Currency } from '@luxamm/sdk-core'
|
|
2
2
|
import { UniverseChainId } from '@luxexchange/lx/src/features/chains/types'
|
|
3
3
|
import { WrapType } from '@luxexchange/lx/src/features/transactions/types/wrap'
|
|
4
4
|
import { areCurrencyIdsEqual, buildWrappedNativeCurrencyId, currencyId } from '@luxexchange/lx/src/utils/currencyId'
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ADDRESS_ZERO } from '@
|
|
1
|
+
import { ADDRESS_ZERO } from '@luxamm/v3-sdk'
|
|
2
2
|
import { useTranslation } from 'react-i18next'
|
|
3
3
|
import { Flex, Text, useSporeColors } from '@luxfi/ui/src'
|
|
4
4
|
import { LinkHorizontalAlt } from '@luxfi/ui/src/components/icons/LinkHorizontalAlt'
|
package/src/i18n/utils.test.ts
CHANGED
|
@@ -5,7 +5,7 @@ import { mockLogger } from '@luxfi/utilities/src/logger/mocks'
|
|
|
5
5
|
import type { Mock } from 'vitest'
|
|
6
6
|
|
|
7
7
|
// Mock modules
|
|
8
|
-
vi.mock('
|
|
8
|
+
vi.mock('utilities/src/device/locales', () => ({
|
|
9
9
|
getDeviceLocales: vi.fn(),
|
|
10
10
|
}))
|
|
11
11
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Token } from '@
|
|
1
|
+
import { Token } from '@luxamm/sdk-core'
|
|
2
2
|
import { getWrappedNativeAddress } from '@luxexchange/lx/src/constants/addresses'
|
|
3
3
|
import { DEFAULT_NATIVE_ADDRESS_LEGACY } from '@luxexchange/lx/src/features/chains/evm/defaults'
|
|
4
4
|
import { UniverseChainId } from '@luxexchange/lx/src/features/chains/types'
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { type Currency, CurrencyAmount, type Token, TradeType } from '@
|
|
2
|
-
import { FeeAmount, Pool, Route } from '@
|
|
1
|
+
import { type Currency, CurrencyAmount, type Token, TradeType } from '@luxamm/sdk-core'
|
|
2
|
+
import { FeeAmount, Pool, Route } from '@luxamm/v3-sdk'
|
|
3
3
|
import { type ClassicQuoteResponse, TradingApi } from '@luxfi/api'
|
|
4
4
|
import { UniverseChainId } from '@luxexchange/lx/src/features/chains/types'
|
|
5
5
|
import { type DerivedSwapInfo } from '@luxexchange/lx/src/features/transactions/swap/types/derivedSwapInfo'
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Currency } from '@
|
|
1
|
+
import { Currency } from '@luxamm/sdk-core'
|
|
2
2
|
import { GraphQLApi } from '@luxfi/api'
|
|
3
3
|
import { nativeOnChain } from '@luxexchange/lx/src/constants/tokens'
|
|
4
4
|
import { UniverseChainId } from '@luxexchange/lx/src/features/chains/types'
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { TransactionRequest } from '@ethersproject/providers'
|
|
2
|
-
import { TradeType } from '@
|
|
2
|
+
import { TradeType } from '@luxamm/sdk-core'
|
|
3
3
|
import { TradingApi } from '@luxfi/api'
|
|
4
4
|
import { DAI, USDC_MAINNET } from '@luxexchange/lx/src/constants/tokens'
|
|
5
5
|
import { AssetType } from '@luxexchange/lx/src/entities/assets'
|
package/src/test/mocks/locale.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Currency, CurrencyAmount } from '@
|
|
1
|
+
import { Currency, CurrencyAmount } from '@luxamm/sdk-core'
|
|
2
2
|
import { PropsWithChildren, ReactNode } from 'react'
|
|
3
3
|
import { FiatCurrency } from '@luxexchange/lx/src/features/fiatCurrency/constants'
|
|
4
4
|
import { Locale } from '@luxexchange/lx/src/features/language/constants'
|
package/src/utils/currency.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Currency, Token } from '@
|
|
1
|
+
import { Currency, Token } from '@luxamm/sdk-core'
|
|
2
2
|
import { getChainInfo } from '@luxexchange/lx/src/features/chains/chainInfo'
|
|
3
3
|
import { UniverseChainId } from '@luxexchange/lx/src/features/chains/types'
|
|
4
4
|
import { LocalizationContextState } from '@luxexchange/lx/src/features/language/LocalizationContext'
|
package/src/utils/isWSOL.test.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Currency } from '@
|
|
1
|
+
import { Currency } from '@luxamm/sdk-core'
|
|
2
2
|
import { nativeOnChain, WRAPPED_NATIVE_CURRENCY } from '@luxexchange/lx/src/constants/tokens'
|
|
3
3
|
import { UniverseChainId } from '@luxexchange/lx/src/features/chains/types'
|
|
4
4
|
import { SolanaToken } from '@luxexchange/lx/src/features/tokens/SolanaToken'
|
package/src/utils/isWSOL.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Currency } from '@
|
|
1
|
+
import { Currency } from '@luxamm/sdk-core'
|
|
2
2
|
import { WRAPPED_SOL_ADDRESS_SOLANA } from '@luxexchange/lx/src/features/chains/svm/defaults'
|
|
3
3
|
import { UniverseChainId } from '@luxexchange/lx/src/features/chains/types'
|
|
4
4
|
import { areAddressesEqual } from '@luxexchange/lx/src/utils/addresses'
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Percent } from '@
|
|
1
|
+
import { Percent } from '@luxamm/sdk-core'
|
|
2
2
|
import { type JupiterOrderResponse, TradingApi } from '@luxfi/api'
|
|
3
3
|
import { UniverseChainId } from '@luxexchange/lx/src/features/chains/types'
|
|
4
4
|
import { SolanaTrade } from '@luxexchange/lx/src/features/transactions/swap/types/solana'
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Percent } from '@
|
|
1
|
+
import { Percent } from '@luxamm/sdk-core'
|
|
2
2
|
import { JupiterLogoMonotone } from '@luxfi/ui/src/components/logos/JupiterLogoMonotone'
|
|
3
3
|
import { UniverseChainId } from '@luxexchange/lx/src/features/chains/types'
|
|
4
4
|
import { Trade } from '@luxexchange/lx/src/features/transactions/swap/types/trade'
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Protocol } from '@uniswap/router-sdk'
|
|
2
|
-
import { CurrencyAmount, Token, TradeType } from '@
|
|
2
|
+
import { CurrencyAmount, Token, TradeType } from '@luxamm/sdk-core'
|
|
3
3
|
import { Pair } from '@uniswap/v2-sdk'
|
|
4
|
-
import { Pool as V3Pool } from '@
|
|
5
|
-
import { Pool as V4Pool } from '@
|
|
4
|
+
import { Pool as V3Pool } from '@luxamm/v3-sdk'
|
|
5
|
+
import { Pool as V4Pool } from '@luxamm/v4-sdk'
|
|
6
6
|
import { TradingApi } from '@luxfi/api'
|
|
7
7
|
import { DYNAMIC_FEE_AMOUNT, V2_DEFAULT_FEE_TIER } from '@luxexchange/lx/src/constants/pools'
|
|
8
8
|
import { luxRoutingProvider } from '@luxexchange/lx/src/utils/routingDiagram/routingProviders/luxRoutingProvider'
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Currency } from '@
|
|
1
|
+
import { Currency } from '@luxamm/sdk-core'
|
|
2
2
|
import { DAI, nativeOnChain, USDC, WBTC } from '@luxexchange/lx/src/constants/tokens'
|
|
3
3
|
import { UniverseChainId } from '@luxexchange/lx/src/features/chains/types'
|
|
4
4
|
import { doesTokenMatchSearchTerm } from '@luxexchange/lx/src/utils/search/doesTokenMatchSearchTerm'
|
package/.depcheckrc
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
ignores: [
|
|
2
|
-
# Dependencies that depcheck thinks are unused but are actually used
|
|
3
|
-
"ethers",
|
|
4
|
-
"@typechain/ethers-v5",
|
|
5
|
-
"jest-presets",
|
|
6
|
-
"depcheck",
|
|
7
|
-
"typescript",
|
|
8
|
-
"@typescript/native-preview",
|
|
9
|
-
"get-graphql-schema",
|
|
10
|
-
"typechain",
|
|
11
|
-
"tamagui",
|
|
12
|
-
"@shopify/react-native-skia",
|
|
13
|
-
# Dependencies that depcheck thinks are missing but are actually present or never used
|
|
14
|
-
## Internal packages / workspaces
|
|
15
|
-
"uniswap",
|
|
16
|
-
"utilities",
|
|
17
|
-
"src",
|
|
18
|
-
"tsconfig",
|
|
19
|
-
"config",
|
|
20
|
-
## GraphQL
|
|
21
|
-
"@graphql-codegen/*",
|
|
22
|
-
# i18n
|
|
23
|
-
"i18next-resources-for-ts",
|
|
24
|
-
# zustand store dev tooling
|
|
25
|
-
"@redux-devtools/extension",
|
|
26
|
-
]
|
package/.eslintignore
DELETED