@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.
Files changed (142) hide show
  1. package/package.json +12 -14
  2. package/src/components/CurrencyInputPanel/AmountInputPresets/PresetAmountButton.tsx +1 -1
  3. package/src/components/CurrencyInputPanel/CurrencyInputPanelBalance.tsx +1 -1
  4. package/src/components/CurrencyInputPanel/CurrencyInputPanelHeader.tsx +1 -1
  5. package/src/components/CurrencyInputPanel/hooks/useIndicativeQuoteTextDisplay.ts +1 -1
  6. package/src/components/CurrencyLogo/TokenLogo.test.tsx +1 -1
  7. package/src/components/MultichainTokenDetails/MultichainAddressList.test.tsx +1 -1
  8. package/src/components/TokenSelector/filter.test.ts +1 -1
  9. package/src/components/TokenSelector/hooks/useLuxTokensOptions.ts +1 -1
  10. package/src/components/lists/OnchainItemList/processSectionsToRows.test.tsx +1 -1
  11. package/src/components/modals/WarningModal/types.ts +1 -1
  12. package/src/components/notifications/iconUtils.ts +1 -1
  13. package/src/components/reporting/ReportPoolDataModal.tsx +1 -1
  14. package/src/components/reporting/ReportTokenDataModal.tsx +1 -1
  15. package/src/components/reporting/ReportTokenIssueModal.tsx +1 -1
  16. package/src/constants/routing.ts +1 -1
  17. package/src/dialog-preferences/implementations/createDialogPreferencesService.test.ts +1 -1
  18. package/src/features/activity/extract/extractRestDEXOrderDetails.ts +1 -1
  19. package/src/features/activity/utils/remote.ts +1 -1
  20. package/src/features/chains/evm/info/avalanche.ts +1 -1
  21. package/src/features/chains/evm/info/blast.ts +1 -1
  22. package/src/features/chains/evm/info/bnb.ts +1 -1
  23. package/src/features/chains/evm/info/mainnet.ts +1 -1
  24. package/src/features/chains/evm/info/monad.ts +1 -1
  25. package/src/features/chains/evm/info/worldchain.ts +1 -1
  26. package/src/features/chains/evm/tokens.test.ts +1 -1
  27. package/src/features/chains/evm/tokens.ts +1 -1
  28. package/src/features/chains/utils.ts +1 -1
  29. package/src/features/dataApi/balances/balancesRest.ts +1 -1
  30. package/src/features/dataApi/balances/utils.ts +1 -1
  31. package/src/features/dataApi/types.ts +1 -1
  32. package/src/features/dataApi/utils/buildCurrency.test.ts +1 -1
  33. package/src/features/dataApi/utils/buildCurrency.ts +1 -1
  34. package/src/features/fiatOnRamp/PaymentMethodFilter/PaymentMethodFilter.test.tsx +1 -1
  35. package/src/features/fiatOnRamp/types.ts +1 -1
  36. package/src/features/gas/hooks/useCancellationGasFeeInfo.test.ts +1 -1
  37. package/src/features/gas/hooks/useMaxAmountSpend.ts +1 -1
  38. package/src/features/gas/utils.test.ts +1 -1
  39. package/src/features/language/formatter.ts +1 -1
  40. package/src/features/notifications/slice/types.ts +1 -1
  41. package/src/features/portfolio/portfolioUpdates/fetchOnChainBalances.ts +1 -1
  42. package/src/features/portfolio/portfolioUpdates/rest/fetchOnChainBalancesRest.test.ts +1 -1
  43. package/src/features/portfolio/portfolioUpdates/rest/fetchOnChainBalancesRest.ts +1 -1
  44. package/src/features/portfolio/portfolioUpdates/rest/refetchRestQueriesViaOnchainOverrideVariantSaga.test.ts +1 -1
  45. package/src/features/providers/FlashbotsRpcClient.test.ts +1 -1
  46. package/src/features/reporting/reports.ts +1 -1
  47. package/src/features/search/SearchModal/analytics/analytics.test.ts +1 -1
  48. package/src/features/settings/hooks.test.ts +2 -2
  49. package/src/features/tokens/SolanaToken.ts +1 -1
  50. package/src/features/tokens/getCurrencyAmount.test.ts +1 -1
  51. package/src/features/tokens/getCurrencyAmount.ts +1 -1
  52. package/src/features/tokens/stablecoin.ts +1 -1
  53. package/src/features/tokens/warnings/safetyUtils.test.ts +1 -1
  54. package/src/features/tokens/warnings/safetyUtils.ts +1 -1
  55. package/src/features/tokens/warnings/slice/hooks.ts +1 -1
  56. package/src/features/transactions/TransactionDetails/UserReceiveAmount.tsx +1 -1
  57. package/src/features/transactions/TransactionDetails/types.ts +1 -1
  58. package/src/features/transactions/cancel/cancelMultipleOrders.test.ts +1 -1
  59. package/src/features/transactions/cancel/cancelOrderFactory.test.ts +1 -1
  60. package/src/features/transactions/components/TransactionModal/TransactionModalContext.tsx +1 -1
  61. package/src/features/transactions/hooks/useUSDCPrice.ts +1 -1
  62. package/src/features/transactions/liquidity/steps/generateLPTransactionSteps.ts +1 -1
  63. package/src/features/transactions/steps/approve.ts +1 -1
  64. package/src/features/transactions/steps/permit2Transaction.ts +1 -1
  65. package/src/features/transactions/steps/wrap.ts +1 -1
  66. package/src/features/transactions/swap/components/MaxSlippageRow/SlippageInfo/SlippageInfoCaption.tsx +1 -1
  67. package/src/features/transactions/swap/components/MaxSlippageRow/SlippageInfo/useFormatSlippageAmount.ts +1 -1
  68. package/src/features/transactions/swap/components/PriceImpactRow/usePriceImpact.test.ts +1 -1
  69. package/src/features/transactions/swap/components/PriceImpactRow/usePriceImpact.ts +1 -1
  70. package/src/features/transactions/swap/components/SwapFormButton/hooks/useSwapFormButtonHooks.test.ts +1 -1
  71. package/src/features/transactions/swap/components/SwapFormSettings/settingsConfigurations/slippage/SlippageScreenNative.tsx +1 -1
  72. package/src/features/transactions/swap/components/UnichainInstantBalanceModal/hooks/receiptFetching/utils.ts +1 -1
  73. package/src/features/transactions/swap/form/SwapFormScreen/YouReceiveDetails/SwapDetailsRow.tsx +1 -1
  74. package/src/features/transactions/swap/form/hooks/useOnSelectCurrency.ts +1 -1
  75. package/src/features/transactions/swap/form/stores/swapFormScreenStore/createSwapFormScreenStore.ts +1 -1
  76. package/src/features/transactions/swap/form/stores/swapFormScreenStore/useSwapFormScreenCallbacks.test.ts +3 -3
  77. package/src/features/transactions/swap/hooks/useSwapWarnings/getBalanceWarning.test.ts +2 -2
  78. package/src/features/transactions/swap/hooks/useSwapWarnings/getFormIncompleteWarning.test.ts +1 -1
  79. package/src/features/transactions/swap/hooks/useSwapWarnings/getPriceImpactWarning.test.ts +1 -1
  80. package/src/features/transactions/swap/hooks/useSwapWarnings/getPriceImpactWarning.ts +1 -1
  81. package/src/features/transactions/swap/hooks/useSwapWarnings/getTokenBlockedWarning.test.ts +1 -1
  82. package/src/features/transactions/swap/hooks/useSwapWarnings/useSwapWarnings.test.ts +1 -1
  83. package/src/features/transactions/swap/hooks/useTrade/logging.ts +1 -1
  84. package/src/features/transactions/swap/hooks/useTrade/parseQuoteCurrencies.ts +1 -1
  85. package/src/features/transactions/swap/hooks/useTrade.ts +1 -1
  86. package/src/features/transactions/swap/plan/planSaga.test.ts +1 -1
  87. package/src/features/transactions/swap/review/hooks/useTokenApprovalInfo.test.ts +1 -1
  88. package/src/features/transactions/swap/review/services/swapTxAndGasInfoService/utils.test.ts +3 -3
  89. package/src/features/transactions/swap/services/tradeService/transformations/transformQuoteToTrade.ts +1 -1
  90. package/src/features/transactions/swap/types/derivedSwapInfo.ts +1 -1
  91. package/src/features/transactions/swap/types/getTradingApiSwapFee.test.ts +1 -1
  92. package/src/features/transactions/swap/types/getTradingApiSwapFee.ts +1 -1
  93. package/src/features/transactions/swap/types/solana.test.ts +1 -1
  94. package/src/features/transactions/swap/types/solana.ts +1 -1
  95. package/src/features/transactions/swap/types/trade.test.ts +1 -1
  96. package/src/features/transactions/swap/types/wrapCallback.ts +1 -1
  97. package/src/features/transactions/swap/utils/asset.ts +1 -1
  98. package/src/features/transactions/swap/utils/format.ts +1 -1
  99. package/src/features/transactions/swap/utils/formatPriceImpact.test.ts +1 -1
  100. package/src/features/transactions/swap/utils/formatPriceImpact.ts +1 -1
  101. package/src/features/transactions/swap/utils/generateSwapTransactionSteps.test.ts +2 -2
  102. package/src/features/transactions/swap/utils/getExactOutputWillFail.test.ts +1 -1
  103. package/src/features/transactions/swap/utils/getExactOutputWillFail.ts +1 -1
  104. package/src/features/transactions/swap/utils/getPriceImpact.ts +1 -1
  105. package/src/features/transactions/swap/utils/getSwapFeeUsd.ts +1 -1
  106. package/src/features/transactions/swap/utils/getTradeAmounts.ts +1 -1
  107. package/src/features/transactions/swap/utils/trade.test.ts +2 -2
  108. package/src/features/transactions/swap/utils/tradingApi.ts +3 -3
  109. package/src/features/transactions/swap/utils/wrap.ts +1 -1
  110. package/src/features/transactions/types/baseDerivedInfo.ts +1 -1
  111. package/src/features/unitags/UnitagInfoModal.tsx +1 -1
  112. package/src/i18n/utils.test.ts +1 -1
  113. package/src/test/fixtures/gql/assets/tokens.ts +1 -1
  114. package/src/test/fixtures/lib/sdk.ts +1 -1
  115. package/src/test/fixtures/transactions/swap.ts +2 -2
  116. package/src/test/fixtures/wallet/currencies.ts +1 -1
  117. package/src/test/fixtures/wallet/transactions/fixtures.ts +1 -1
  118. package/src/test/mocks/locale.ts +1 -1
  119. package/src/utils/approvals.test.ts +1 -1
  120. package/src/utils/currency.ts +1 -1
  121. package/src/utils/isWSOL.test.ts +1 -1
  122. package/src/utils/isWSOL.ts +1 -1
  123. package/src/utils/routingDiagram/routingProviders/jupiterRoutingProvider.test.ts +1 -1
  124. package/src/utils/routingDiagram/routingProviders/jupiterRoutingProvider.ts +1 -1
  125. package/src/utils/routingDiagram/routingProviders/luxRoutingProvider.test.ts +3 -3
  126. package/src/utils/routingDiagram/types.ts +1 -1
  127. package/src/utils/search/doesTokenMatchSearchTerm.test.ts +1 -1
  128. package/src/utils/search/doesTokenMatchSearchTerm.ts +1 -1
  129. package/.depcheckrc +0 -26
  130. package/.eslintignore +0 -4
  131. package/.eslintrc.js +0 -79
  132. package/LLM.md +0 -145
  133. package/babel.config.js +0 -39
  134. package/env.d.ts +0 -15
  135. package/eslint_rules/i18n.js +0 -44
  136. package/eslint_rules/no-redux-modals.js +0 -54
  137. package/jest-package-mocks.js +0 -38
  138. package/openapitools.json +0 -7
  139. package/tsconfig.eslint.json +0 -6
  140. package/vitest-package-mocks.ts +0 -76
  141. package/vitest-setup.ts +0 -246
  142. package/vitest.config.ts +0 -86
@@ -1,4 +1,4 @@
1
- import { TradeType } from '@luxfi/amm-core'
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 '@luxfi/amm-core'
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 '@luxfi/amm-core'
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('@luxfi/utilities/src/react/hooks', () => ({
112
+ vi.mock('utilities/src/react/hooks', () => ({
113
113
  useEvent: <T extends (...args: never[]) => unknown>(handler: T): T => handler,
114
114
  }))
115
115
 
@@ -1,4 +1,4 @@
1
- import { TradeType } from '@luxfi/amm-core'
1
+ import { TradeType } from '@luxamm/sdk-core'
2
2
  import { useMemo } from 'react'
3
3
  import { useTranslation } from 'react-i18next'
4
4
  import type { ColorTokens } from '@luxfi/ui/src'
@@ -1,5 +1,5 @@
1
1
  import { BigNumber } from '@ethersproject/bignumber'
2
- import { TradeType } from '@luxfi/amm-core'
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'
@@ -1,4 +1,4 @@
1
- import { Currency, CurrencyAmount } from '@luxfi/amm-core'
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 '@luxfi/amm-core'
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'
@@ -1,4 +1,4 @@
1
- import type { Currency, CurrencyAmount } from '@luxfi/amm-core'
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('@luxfi/utilities/src/platform', () => ({
11
+ vi.mock('utilities/src/platform', () => ({
12
12
  isWebPlatform: true,
13
13
  isMobileApp: false,
14
14
  }))
15
15
 
16
- vi.mock('@luxfi/utilities/src/telemetry/trace/TraceContext', () => ({
16
+ vi.mock('utilities/src/telemetry/trace/TraceContext', () => ({
17
17
  useTrace: vi.fn(() => ({})),
18
18
  }))
19
19
 
20
- vi.mock('@luxfi/utilities/src/react/hooks', () => ({
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 '@luxfi/amm-core'
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('@luxfi/utilities/src/platform', () => ({
8
+ vi.mock('utilities/src/platform', () => ({
9
9
  isAndroid: false,
10
10
  isIOS: false,
11
11
  isWebPlatform: true,
@@ -1,4 +1,4 @@
1
- import { Currency, CurrencyAmount } from '@luxfi/amm-core'
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 '@luxfi/amm-core'
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 '@luxfi/amm-core'
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 '@luxfi/amm-core'
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 '@luxfi/amm-core'
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 '@luxfi/amm-core'
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 '@luxfi/amm-core'
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 '@luxfi/amm-core'
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('@luxfi/utilities/src/async/retryWithBackoff', () => ({
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('@luxfi/utilities/src/logger/logger', () => ({
24
+ vi.mock('utilities/src/logger/logger', () => ({
25
25
  logger: mockLogger,
26
26
  }))
27
27
  vi.mock('lx/src/data/apiClients/tradingApi/useCheckApprovalQuery')
@@ -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('@luxfi/utilities/src/platform', async () => {
69
- const actual = await vi.importActual<typeof import('@luxfi/utilities/src/platform')>('@luxfi/utilities/src/platform')
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('@luxfi/utilities/src/platform')
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 '@luxfi/amm-core'
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 '@luxfi/amm-core'
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 '@luxfi/amm-core'
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 '@luxfi/amm-core'
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 '@luxfi/amm-core'
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 '@luxfi/amm-core'
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 '@luxfi/amm-core'
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 '@luxfi/amm-core'
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'
@@ -1,4 +1,4 @@
1
- import { Currency } from '@luxfi/amm-core'
1
+ import { Currency } from '@luxamm/sdk-core'
2
2
  import { AssetType, CurrencyAsset } from '@luxexchange/lx/src/entities/assets'
3
3
  import { currencyAddress } from '@luxexchange/lx/src/utils/currencyId'
4
4
 
@@ -1,4 +1,4 @@
1
- import { Percent } from '@luxfi/amm-core'
1
+ import { Percent } from '@luxamm/sdk-core'
2
2
 
3
3
  // rounds to nearest basis point
4
4
  export const slippageToleranceToPercent = (slippage: number): Percent => {
@@ -1,4 +1,4 @@
1
- import { Percent } from '@luxfi/amm-core'
1
+ import { Percent } from '@luxamm/sdk-core'
2
2
  import { formatPriceImpact } from '@luxexchange/lx/src/features/transactions/swap/utils/formatPriceImpact'
3
3
 
4
4
  describe('formatPriceImpact', () => {
@@ -1,4 +1,4 @@
1
- import type { Percent } from '@luxfi/amm-core'
1
+ import type { Percent } from '@luxamm/sdk-core'
2
2
  import type { LocalizationContextState } from '@luxexchange/lx/src/features/language/LocalizationContext'
3
3
 
4
4
  export function formatPriceImpact(
@@ -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('@luxfi/utilities/src/platform', async (importOriginal) => {
21
- const actual = await importOriginal<typeof import('@luxfi/utilities/src/platform')>()
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 '@luxfi/amm-core'
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 '@luxfi/amm-core'
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 '@luxfi/amm-core'
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 '@luxfi/amm-core'
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 '@luxfi/amm-core'
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 '@luxfi/amm-core'
2
- import { FeeAmount, Pool, Route } from '@luxfi/amm-v3'
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 '@luxfi/amm-core'
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 @luxfi/amm-* SDKs. The runtime behavior is correct.
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 @luxfi/amm-* SDKs which have incompatible private property declarations
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 '@luxfi/amm-core'
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 { Currency, CurrencyAmount } from '@luxfi/amm-core'
1
+ import { Currency, CurrencyAmount } from '@luxamm/sdk-core'
2
2
  import { CurrencyInfo } from '@luxexchange/lx/src/features/dataApi/types'
3
3
  import { CurrencyField } from '@luxexchange/lx/src/types/currency'
4
4
 
@@ -1,4 +1,4 @@
1
- import { ADDRESS_ZERO } from '@luxfi/amm-v3'
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'
@@ -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('@luxfi/utilities/src/device/locales', () => ({
8
+ vi.mock('utilities/src/device/locales', () => ({
9
9
  getDeviceLocales: vi.fn(),
10
10
  }))
11
11
 
@@ -1,4 +1,4 @@
1
- import { Token as SDKToken } from '@luxfi/amm-core'
1
+ import { Token as SDKToken } from '@luxamm/sdk-core'
2
2
  import { GraphQLApi } from '@luxfi/api'
3
3
  import {
4
4
  DAI,
@@ -1,4 +1,4 @@
1
- import { Token } from '@luxfi/amm-core'
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 '@luxfi/amm-core'
2
- import { FeeAmount, Pool, Route } from '@luxfi/amm-v3'
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 '@luxfi/amm-core'
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 '@luxfi/amm-core'
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'
@@ -1,4 +1,4 @@
1
- import { Currency, CurrencyAmount } from '@luxfi/amm-core'
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'
@@ -1,4 +1,4 @@
1
- import { MaxUint256 } from '@luxfi/amm-core'
1
+ import { MaxUint256 } from '@luxamm/sdk-core'
2
2
  import { parseERC20ApproveCalldata } from '@luxexchange/lx/src/utils/approvals'
3
3
 
4
4
  describe(parseERC20ApproveCalldata, () => {
@@ -1,4 +1,4 @@
1
- import { Currency, Token } from '@luxfi/amm-core'
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'
@@ -1,4 +1,4 @@
1
- import { Currency } from '@luxfi/amm-core'
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'
@@ -1,4 +1,4 @@
1
- import { Currency } from '@luxfi/amm-core'
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 '@luxfi/amm-core'
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 '@luxfi/amm-core'
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 '@luxfi/amm-core'
2
+ import { CurrencyAmount, Token, TradeType } from '@luxamm/sdk-core'
3
3
  import { Pair } from '@uniswap/v2-sdk'
4
- import { Pool as V3Pool } from '@luxfi/amm-v3'
5
- import { Pool as V4Pool } from '@luxdex/v4-sdk'
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 { Percent } from '@luxfi/amm-core'
1
+ import { Percent } from '@luxamm/sdk-core'
2
2
  import type { GeneratedIcon } from '@luxfi/ui/src'
3
3
  import { Trade } from '@luxexchange/lx/src/features/transactions/swap/types/trade'
4
4
 
@@ -1,4 +1,4 @@
1
- import { Currency } from '@luxfi/amm-core'
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'
@@ -1,4 +1,4 @@
1
- import { Currency, Token } from '@luxfi/amm-core'
1
+ import { Currency, Token } from '@luxamm/sdk-core'
2
2
 
3
3
  /**
4
4
  * Checks if a token matches a search term.
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
@@ -1,4 +0,0 @@
1
- **/__generated__/**
2
-
3
- # Generated contract types
4
- src/abis/types