@openocean.finance/widget 1.0.2 → 1.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (92) hide show
  1. package/package.json +4 -5
  2. package/src/components/AmountInput/AmountInput.tsx +2 -10
  3. package/src/components/AmountInput/AmountInputEndAdornment.tsx +82 -46
  4. package/src/components/AmountInput/PriceFormHelperText.tsx +13 -13
  5. package/src/components/Avatar/TokenAvatar.tsx +1 -1
  6. package/src/components/ChainSelect/ChainSelect.tsx +1 -1
  7. package/src/components/ChainSelect/useChainSelect.ts +1 -1
  8. package/src/components/ContractComponent/ItemPrice.tsx +1 -1
  9. package/src/components/ContractComponent/NFT/types.ts +1 -1
  10. package/src/components/Messages/WarningMessages.tsx +5 -5
  11. package/src/components/Messages/useMessageQueue.ts +1 -1
  12. package/src/components/RouteCard/RouteCard.tsx +2 -2
  13. package/src/components/RouteCard/RouteCardEssentials.tsx +1 -1
  14. package/src/components/RouteCard/getMatchingLabels.ts +1 -1
  15. package/src/components/RouteCard/types.ts +1 -1
  16. package/src/components/Routes/RoutesExpanded.tsx +1 -1
  17. package/src/components/Step/CircularProgress.style.tsx +1 -1
  18. package/src/components/Step/CircularProgress.tsx +1 -1
  19. package/src/components/Step/DestinationWalletAddress.tsx +2 -2
  20. package/src/components/Step/Step.tsx +6 -3
  21. package/src/components/Step/StepList.tsx +1 -1
  22. package/src/components/Step/StepProcess.tsx +2 -2
  23. package/src/components/StepActions/StepActions.tsx +5 -5
  24. package/src/components/StepActions/StepFees.tsx +2 -2
  25. package/src/components/StepActions/types.ts +3 -3
  26. package/src/components/Timer/RouteTimer.tsx +1 -1
  27. package/src/components/Timer/StepTimer.tsx +5 -5
  28. package/src/components/Token/Token.tsx +9 -7
  29. package/src/components/TokenList/TokenListItem.tsx +1 -1
  30. package/src/components/TokenList/types.ts +1 -1
  31. package/src/components/TokenRate/TokenRate.tsx +1 -1
  32. package/src/components/TransactionDetails.tsx +1 -1
  33. package/src/config/coinbase.ts +1 -1
  34. package/src/config/metaMask.ts +1 -1
  35. package/src/hooks/useAddressValidation.ts +2 -2
  36. package/src/hooks/useAvailableChains.ts +2 -2
  37. package/src/hooks/useChains.ts +1 -1
  38. package/src/hooks/useExplorer.ts +4 -2
  39. package/src/hooks/useFromTokenSufficiency.ts +1 -1
  40. package/src/hooks/useGasRecommendation.ts +4 -1
  41. package/src/hooks/useGasSufficiency.ts +7 -3
  42. package/src/hooks/useInitializer.ts +1 -1
  43. package/src/hooks/useIsBatchingSupported.ts +2 -2
  44. package/src/hooks/useIsCompatibleDestinationAccount.ts +1 -1
  45. package/src/hooks/useIsContractAddress.ts +1 -1
  46. package/src/hooks/useProcessMessage.ts +23 -23
  47. package/src/hooks/useRouteExecution.ts +5 -2
  48. package/src/hooks/useRoutes.ts +4 -4
  49. package/src/hooks/useToAddressRequirements.ts +1 -1
  50. package/src/hooks/useToAddressReset.ts +1 -1
  51. package/src/hooks/useTokenBalance.ts +5 -1
  52. package/src/hooks/useTokenBalances.ts +1 -1
  53. package/src/hooks/useTokenSearch.ts +5 -2
  54. package/src/hooks/useTokens.ts +6 -5
  55. package/src/hooks/useTools.ts +1 -1
  56. package/src/hooks/useTransactionDetails.ts +2 -2
  57. package/src/hooks/useTransactionHistory.ts +8 -2
  58. package/src/index.ts +2 -2
  59. package/src/pages/MainPage/MainWarningMessages.tsx +1 -1
  60. package/src/pages/RoutesPage/RoutesPage.tsx +1 -1
  61. package/src/pages/SelectChainPage/SelectChainPage.tsx +1 -1
  62. package/src/pages/SelectEnabledToolsPage.tsx +1 -1
  63. package/src/pages/SettingsPage/RoutePrioritySettings.tsx +1 -1
  64. package/src/pages/TransactionDetailsPage/TransactionDetailsPage.tsx +7 -4
  65. package/src/pages/TransactionDetailsPage/TransferIdCard.tsx +3 -2
  66. package/src/pages/TransactionHistoryPage/TransactionHistoryItem.tsx +2 -2
  67. package/src/pages/TransactionHistoryPage/TransactionHistoryPage.tsx +1 -1
  68. package/src/pages/TransactionPage/ExchangeRateBottomSheet.tsx +1 -1
  69. package/src/pages/TransactionPage/TokenValueBottomSheet.tsx +2 -2
  70. package/src/pages/TransactionPage/TransactionPage.tsx +1 -1
  71. package/src/pages/TransactionPage/types.ts +1 -1
  72. package/src/providers/WalletProvider/EVMProvider.tsx +1 -1
  73. package/src/providers/WalletProvider/SDKProviders.tsx +8 -2
  74. package/src/providers/WalletProvider/SVMProvider.tsx +1 -1
  75. package/src/providers/WalletProvider/UTXOProvider.tsx +1 -1
  76. package/src/providers/WalletProvider/useExternalWalletProvider.ts +1 -1
  77. package/src/providers/WidgetProvider/WidgetProvider.tsx +2 -2
  78. package/src/services/DebridgeService.ts +26 -107
  79. package/src/services/ExecuteRoute.ts +55 -26
  80. package/src/stores/form/types.ts +1 -1
  81. package/src/stores/routes/createRouteExecutionStore.ts +1 -1
  82. package/src/stores/routes/types.ts +1 -1
  83. package/src/stores/routes/utils.ts +1 -1
  84. package/src/stores/settings/types.ts +1 -1
  85. package/src/types/events.ts +6 -1
  86. package/src/types/token.ts +1 -1
  87. package/src/types/widget.ts +10 -10
  88. package/src/utils/chainType.ts +1 -1
  89. package/src/utils/converters.ts +2 -2
  90. package/src/utils/fees.ts +6 -1
  91. package/src/utils/getPriceImpact.ts +1 -1
  92. /package/src/icons/{lifi.ts → openocean.ts} +0 -0
@@ -1,5 +1,5 @@
1
- import type { RouteExtended } from '@lifi/sdk'
2
1
  import type { TypographyProps } from '@mui/material'
2
+ import type { RouteExtended } from '@openocean.finance/widget-sdk'
3
3
  import type { MouseEventHandler } from 'react'
4
4
  import { useTranslation } from 'react-i18next'
5
5
  import { formatUnits } from 'viem'
@@ -1,8 +1,8 @@
1
- import type { RouteExtended } from '@lifi/sdk'
2
1
  import { LocalGasStationRounded } from '@mui/icons-material'
3
2
  import { HelpOutline } from '@mui/icons-material'
4
3
  import type { CardProps } from '@mui/material'
5
4
  import { Box, Collapse, Tooltip, Typography } from '@mui/material'
5
+ import type { RouteExtended } from '@openocean.finance/widget-sdk'
6
6
  import { useState } from 'react'
7
7
  import { useTranslation } from 'react-i18next'
8
8
  import { useChain } from '../hooks/useChain.js'
@@ -1,5 +1,5 @@
1
1
  import type { CoinbaseWalletParameters } from 'wagmi/connectors'
2
- import { OOToolLogo } from '../icons/lifi.js'
2
+ import { OOToolLogo } from '../icons/openocean.js'
3
3
 
4
4
  export const defaultCoinbaseConfig: CoinbaseWalletParameters = {
5
5
  appName: 'OpenOcean',
@@ -1,5 +1,5 @@
1
1
  import type { MetaMaskParameters } from 'wagmi/connectors'
2
- import { OOToolLogo } from '../icons/lifi.js'
2
+ import { OOToolLogo } from '../icons/openocean.js'
3
3
 
4
4
  export const defaultMetaMaskConfig: MetaMaskParameters = {
5
5
  dappMetadata: {
@@ -1,5 +1,5 @@
1
- import type { Chain, ChainType } from '@lifi/sdk'
2
- import { getNameServiceAddress } from '@lifi/sdk'
1
+ import type { Chain, ChainType } from '@openocean.finance/widget-sdk'
2
+ import { getNameServiceAddress } from '@openocean.finance/widget-sdk'
3
3
  import { useMutation } from '@tanstack/react-query'
4
4
  import { useTranslation } from 'react-i18next'
5
5
  import { getChainTypeFromAddress } from '../utils/chainType.js'
@@ -1,5 +1,5 @@
1
- import type { ExtendedChain } from '@lifi/sdk'
2
- import { ChainType, config, getChains } from '@lifi/sdk'
1
+ import type { ExtendedChain } from '@openocean.finance/widget-sdk'
2
+ import { ChainType, config, getChains } from '@openocean.finance/widget-sdk'
3
3
  import { useQuery } from '@tanstack/react-query'
4
4
  import { useCallback } from 'react'
5
5
  import { useWidgetConfig } from '../providers/WidgetProvider/WidgetProvider.js'
@@ -1,4 +1,4 @@
1
- import type { ChainType } from '@lifi/sdk'
1
+ import type { ChainType } from '@openocean.finance/widget-sdk'
2
2
  import { useMemo } from 'react'
3
3
  import { useWidgetConfig } from '../providers/WidgetProvider/WidgetProvider.js'
4
4
  import type { FormType } from '../stores/form/types.js'
@@ -1,4 +1,4 @@
1
- import type { Chain } from '@lifi/sdk'
1
+ import type { Chain } from '@openocean.finance/widget-sdk'
2
2
  import { useAvailableChains } from '../hooks/useAvailableChains.js'
3
3
  import { useWidgetConfig } from '../providers/WidgetProvider/WidgetProvider.js'
4
4
 
@@ -39,7 +39,9 @@ export const useExplorer = () => {
39
39
  return txLink
40
40
  }
41
41
  if (!chain) {
42
- throw new Error('Chain parameter is required for getting transaction link')
42
+ throw new Error(
43
+ 'Chain parameter is required for getting transaction link'
44
+ )
43
45
  }
44
46
  const resolvedChain = resolveChain(chain)
45
47
  if (!resolvedChain) {
@@ -1,5 +1,5 @@
1
- import type { RouteExtended } from '@lifi/sdk'
2
1
  import { useAccount } from '@openocean.finance/wallet-management'
2
+ import type { RouteExtended } from '@openocean.finance/widget-sdk'
3
3
  import { keepPreviousData, useQuery } from '@tanstack/react-query'
4
4
  import { parseUnits } from 'viem'
5
5
  import { useFieldValues } from '../stores/form/useFieldValues.js'
@@ -1,4 +1,7 @@
1
- import { type ChainId, getGasRecommendation } from '@lifi/sdk'
1
+ import {
2
+ type ChainId,
3
+ getGasRecommendation,
4
+ } from '@openocean.finance/widget-sdk'
2
5
  import { useQuery } from '@tanstack/react-query'
3
6
  import { useAvailableChains } from './useAvailableChains.js'
4
7
 
@@ -1,6 +1,10 @@
1
- import type { EVMChain, RouteExtended, Token } from '@lifi/sdk'
2
- import { isRelayerStep } from '@lifi/sdk'
3
1
  import { useAccount } from '@openocean.finance/wallet-management'
2
+ import type {
3
+ EVMChain,
4
+ RouteExtended,
5
+ Token,
6
+ } from '@openocean.finance/widget-sdk'
7
+ import { isRelayerStep } from '@openocean.finance/widget-sdk'
4
8
  import { useQuery } from '@tanstack/react-query'
5
9
  import { useAvailableChains } from './useAvailableChains.js'
6
10
  import { useIsContractAddress } from './useIsContractAddress.js'
@@ -120,7 +124,7 @@ export const useGasSufficiency = (route?: RouteExtended) => {
120
124
  t.chainId === gasCosts[chainId].token.chainId &&
121
125
  t.address === gasCosts[chainId].token.address
122
126
  )?.amount ?? 0n
123
-
127
+
124
128
  const insufficient =
125
129
  gasTokenBalance <= 0n ||
126
130
  gasTokenBalance < gasCosts[chainId].gasAmount ||
@@ -1,4 +1,4 @@
1
- import { checkPackageUpdates } from '@lifi/sdk'
1
+ import { checkPackageUpdates } from '@openocean.finance/widget-sdk'
2
2
  import { useEffect } from 'react'
3
3
  import { name, version } from '../config/version.js'
4
4
  import { useTools } from './useTools.js'
@@ -1,5 +1,5 @@
1
- import { ChainType, isBatchingSupported } from '@lifi/sdk'
2
- import type { ExtendedChain } from '@lifi/sdk'
1
+ import { ChainType, isBatchingSupported } from '@openocean.finance/widget-sdk'
2
+ import type { ExtendedChain } from '@openocean.finance/widget-sdk'
3
3
  import { useQuery } from '@tanstack/react-query'
4
4
 
5
5
  export function useIsBatchingSupported(
@@ -1,5 +1,5 @@
1
- import type { RouteExtended } from '@lifi/sdk'
2
1
  import { useAccount } from '@openocean.finance/wallet-management'
2
+ import type { RouteExtended } from '@openocean.finance/widget-sdk'
3
3
  import { useFieldValues } from '../stores/form/useFieldValues.js'
4
4
  import { isDelegationDesignatorCode } from '../utils/eip7702.js'
5
5
  import { useChain } from './useChain.js'
@@ -1,4 +1,4 @@
1
- import { ChainType } from '@lifi/sdk'
1
+ import { ChainType } from '@openocean.finance/widget-sdk'
2
2
  import type { Address } from 'viem'
3
3
  import { useBytecode } from 'wagmi'
4
4
 
@@ -1,13 +1,13 @@
1
1
  import type {
2
2
  EVMChain,
3
- LiFiStep,
3
+ OpenOceanStep,
4
4
  Process,
5
5
  ProcessStatus,
6
6
  ProcessType,
7
7
  StatusMessage,
8
8
  Substatus,
9
- } from '@lifi/sdk'
10
- import { LiFiErrorCode } from '@lifi/sdk'
9
+ } from '@openocean.finance/widget-sdk'
10
+ import { OpenOceanErrorCode } from '@openocean.finance/widget-sdk'
11
11
  import type { TFunction } from 'i18next'
12
12
  import { useTranslation } from 'react-i18next'
13
13
  import { useWidgetConfig } from '../providers/WidgetProvider/WidgetProvider.js'
@@ -15,7 +15,7 @@ import type { SubvariantOptions, WidgetSubvariant } from '../types/widget.js'
15
15
  import { formatTokenAmount } from '../utils/format.js'
16
16
  import { useAvailableChains } from './useAvailableChains.js'
17
17
 
18
- export const useProcessMessage = (step?: LiFiStep, process?: Process) => {
18
+ export const useProcessMessage = (step?: OpenOceanStep, process?: Process) => {
19
19
  const { subvariant, subvariantOptions } = useWidgetConfig()
20
20
  const { t } = useTranslation()
21
21
  const { getChainById } = useAvailableChains()
@@ -39,7 +39,7 @@ const processStatusMessages: Record<
39
39
  ProcessStatus,
40
40
  (
41
41
  t: TFunction,
42
- step: LiFiStep,
42
+ step: OpenOceanStep,
43
43
  subvariant?: WidgetSubvariant,
44
44
  subvariantOptions?: SubvariantOptions
45
45
  ) => string
@@ -129,7 +129,7 @@ const processSubstatusMessages: Record<
129
129
  export function getProcessMessage(
130
130
  t: TFunction,
131
131
  getChainById: (chainId: number) => EVMChain | undefined,
132
- step: LiFiStep,
132
+ step: OpenOceanStep,
133
133
  process: Process,
134
134
  subvariant?: WidgetSubvariant,
135
135
  subvariantOptions?: SubvariantOptions
@@ -153,75 +153,75 @@ export function getProcessMessage(
153
153
  let title = ''
154
154
  let message = ''
155
155
  switch (process.error.code) {
156
- case LiFiErrorCode.AllowanceRequired:
156
+ case OpenOceanErrorCode.AllowanceRequired:
157
157
  title = t('error.title.allowanceRequired')
158
158
  message = t('error.message.allowanceRequired', {
159
159
  tokenSymbol: step.action.fromToken.symbol,
160
160
  })
161
161
  break
162
- case LiFiErrorCode.BalanceError:
162
+ case OpenOceanErrorCode.BalanceError:
163
163
  title = t('error.title.balanceIsTooLow')
164
164
  message = getDefaultErrorMessage()
165
165
  break
166
- case LiFiErrorCode.ChainSwitchError:
166
+ case OpenOceanErrorCode.ChainSwitchError:
167
167
  title = t('error.title.chainSwitch')
168
168
  message = getDefaultErrorMessage()
169
169
  break
170
- case LiFiErrorCode.GasLimitError:
170
+ case OpenOceanErrorCode.GasLimitError:
171
171
  title = t('error.title.gasLimitIsTooLow')
172
172
  message = getDefaultErrorMessage()
173
173
  break
174
- case LiFiErrorCode.InsufficientFunds:
174
+ case OpenOceanErrorCode.InsufficientFunds:
175
175
  title = t('error.title.insufficientFunds')
176
176
  message = `${t(
177
177
  'error.message.insufficientFunds'
178
178
  )} ${getDefaultErrorMessage()}`
179
179
  break
180
- case LiFiErrorCode.SlippageError:
180
+ case OpenOceanErrorCode.SlippageError:
181
181
  title = t('error.title.slippageNotMet')
182
182
  message = t('error.message.slippageThreshold')
183
183
  break
184
- case LiFiErrorCode.TransactionFailed:
184
+ case OpenOceanErrorCode.TransactionFailed:
185
185
  title = t('error.title.transactionFailed')
186
186
  message = t('error.message.transactionFailed')
187
187
  break
188
- case LiFiErrorCode.TransactionExpired:
188
+ case OpenOceanErrorCode.TransactionExpired:
189
189
  title = t('error.title.transactionExpired')
190
190
  message = t('error.message.transactionExpired')
191
191
  break
192
- case LiFiErrorCode.TransactionSimulationFailed:
192
+ case OpenOceanErrorCode.TransactionSimulationFailed:
193
193
  title = t('error.title.transactionSimulationFailed')
194
194
  message = t('error.message.transactionSimulationFailed')
195
195
  break
196
- case LiFiErrorCode.WalletChangedDuringExecution:
196
+ case OpenOceanErrorCode.WalletChangedDuringExecution:
197
197
  title = t('error.title.walletMismatch')
198
198
  message = t('error.message.walletChangedDuringExecution')
199
199
  break
200
- case LiFiErrorCode.TransactionUnderpriced:
200
+ case OpenOceanErrorCode.TransactionUnderpriced:
201
201
  title = t('error.title.transactionUnderpriced')
202
202
  message = getDefaultErrorMessage()
203
203
  break
204
- case LiFiErrorCode.TransactionUnprepared:
204
+ case OpenOceanErrorCode.TransactionUnprepared:
205
205
  title = t('error.title.transactionUnprepared')
206
206
  message = getDefaultErrorMessage()
207
207
  break
208
- case LiFiErrorCode.TransactionCanceled:
208
+ case OpenOceanErrorCode.TransactionCanceled:
209
209
  title = t('error.title.transactionCanceled')
210
210
  message = getDefaultErrorMessage('error.message.transactionCanceled')
211
211
  break
212
- case LiFiErrorCode.TransactionRejected:
212
+ case OpenOceanErrorCode.TransactionRejected:
213
213
  title = t('error.title.transactionRejected')
214
214
  message = getDefaultErrorMessage('error.message.transactionRejected')
215
215
  break
216
- case LiFiErrorCode.TransactionConflict:
216
+ case OpenOceanErrorCode.TransactionConflict:
217
217
  title = t('error.title.transactionConflict')
218
218
  message = getDefaultErrorMessage('error.message.transactionConflict')
219
219
  break
220
- case LiFiErrorCode.ExchangeRateUpdateCanceled:
220
+ case OpenOceanErrorCode.ExchangeRateUpdateCanceled:
221
221
  title = t('error.title.exchangeRateUpdateCanceled')
222
222
  message = getDefaultErrorMessage()
223
223
  break
224
- case LiFiErrorCode.SignatureRejected:
224
+ case OpenOceanErrorCode.SignatureRejected:
225
225
  title = t('error.title.signatureRejected')
226
226
  message = t('error.message.signatureRejected', {
227
227
  amount: formatTokenAmount(
@@ -1,10 +1,13 @@
1
- import type { ExchangeRateUpdateParams, Route } from '@lifi/sdk'
2
- import { updateRouteExecution } from '@lifi/sdk'
3
1
  import {
4
2
  useAccount,
5
3
  useAccountDisconnect,
6
4
  useWalletMenu,
7
5
  } from '@openocean.finance/wallet-management'
6
+ import type {
7
+ ExchangeRateUpdateParams,
8
+ Route,
9
+ } from '@openocean.finance/widget-sdk'
10
+ import { updateRouteExecution } from '@openocean.finance/widget-sdk'
8
11
  import { useMutation, useQueryClient } from '@tanstack/react-query'
9
12
  import { useCallback, useEffect, useRef } from 'react'
10
13
  import { useConfig } from 'wagmi'
@@ -1,6 +1,6 @@
1
- import type { Route } from '@lifi/sdk'
2
- import { LiFiErrorCode } from '@lifi/sdk'
3
1
  import { useAccount } from '@openocean.finance/wallet-management'
2
+ import type { Route } from '@openocean.finance/widget-sdk'
3
+ import { OpenOceanErrorCode } from '@openocean.finance/widget-sdk'
4
4
  import { useQuery, useQueryClient } from '@tanstack/react-query'
5
5
  import { parseUnits } from 'viem'
6
6
  import { useWidgetConfig } from '../providers/WidgetProvider/WidgetProvider.js'
@@ -290,7 +290,7 @@ export const useRoutes = ({ observableRoute }: RoutesProps = {}) => {
290
290
  steps: [
291
291
  {
292
292
  id: '1',
293
- type: 'lifi',
293
+ type: 'openocean',
294
294
  tool: isDebridge ? 'debridge' : 'openocean',
295
295
  transactionRequest: {
296
296
  chainId: data?.chainId || fromChainId,
@@ -377,7 +377,7 @@ export const useRoutes = ({ observableRoute }: RoutesProps = {}) => {
377
377
  if (failureCount >= 3) {
378
378
  return false
379
379
  }
380
- if (error?.code === LiFiErrorCode.NotFound) {
380
+ if (error?.code === OpenOceanErrorCode.NotFound) {
381
381
  return false
382
382
  }
383
383
  return true
@@ -1,5 +1,5 @@
1
- import type { RouteExtended } from '@lifi/sdk'
2
1
  import { useAccount } from '@openocean.finance/wallet-management'
2
+ import type { RouteExtended } from '@openocean.finance/widget-sdk'
3
3
  import { useChain } from '../hooks/useChain.js'
4
4
  import { useWidgetConfig } from '../providers/WidgetProvider/WidgetProvider.js'
5
5
  import { useFieldValues } from '../stores/form/useFieldValues.js'
@@ -1,4 +1,4 @@
1
- import type { ExtendedChain } from '@lifi/sdk'
1
+ import type { ExtendedChain } from '@openocean.finance/widget-sdk'
2
2
  import { useWidgetConfig } from '../providers/WidgetProvider/WidgetProvider.js'
3
3
  import { useBookmarkActions } from '../stores/bookmarks/useBookmarkActions.js'
4
4
  import { useBookmarks } from '../stores/bookmarks/useBookmarks.js'
@@ -1,4 +1,8 @@
1
- import { type Token, type TokenAmount, getTokenBalances } from '@lifi/sdk'
1
+ import {
2
+ type Token,
3
+ type TokenAmount,
4
+ getTokenBalances,
5
+ } from '@openocean.finance/widget-sdk'
2
6
  import { useQuery, useQueryClient } from '@tanstack/react-query'
3
7
  import { useCallback, useMemo } from 'react'
4
8
 
@@ -1,5 +1,5 @@
1
- import { getTokenBalances } from '@lifi/sdk'
2
1
  import { useAccount } from '@openocean.finance/wallet-management'
2
+ import { getTokenBalances } from '@openocean.finance/widget-sdk'
3
3
  import { useQuery } from '@tanstack/react-query'
4
4
  import { formatUnits } from 'viem'
5
5
  import type { TokenAmount } from '../types/token.js'
@@ -1,4 +1,4 @@
1
- import { type ChainId, type TokensResponse } from '@lifi/sdk'
1
+ import type { TokensRee } from '@openocean.finance/widget-sdk'
2
2
  import { useQuery, useQueryClient } from '@tanstack/react-query'
3
3
  import { OpenOceanService } from '../services/OpenOceanService.js'
4
4
  import type { TokenAmount } from '../types/token.js'
@@ -12,7 +12,10 @@ export const useTokenSearch = (
12
12
  const { data, isLoading } = useQuery({
13
13
  queryKey: ['token-search', chainId, tokenQuery],
14
14
  queryFn: async ({ queryKey: [, chainId, tokenQuery], signal }) => {
15
- const token = await OpenOceanService.getTokenInfo(chainId?.toString() || '', tokenQuery as string)
15
+ const token = await OpenOceanService.getTokenInfo(
16
+ chainId?.toString() || '',
17
+ tokenQuery as string
18
+ )
16
19
 
17
20
  if (token) {
18
21
  queryClient.setQueriesData<TokensResponse>(
@@ -1,10 +1,9 @@
1
- import { ChainType } from '@lifi/sdk'
2
1
  import { useQuery } from '@tanstack/react-query'
3
2
  import { useMemo } from 'react'
4
3
  import { useWidgetConfig } from '../providers/WidgetProvider/WidgetProvider.js'
4
+ import { OpenOceanService } from '../services/OpenOceanService.js'
5
5
  import type { TokenAmount } from '../types/token.js'
6
6
  import { useChains } from './useChains.js'
7
- import { OpenOceanService } from '../services/OpenOceanService.js'
8
7
 
9
8
  export const useTokens = (selectedChainId?: number) => {
10
9
  const { tokens: configTokens } = useWidgetConfig()
@@ -14,11 +13,13 @@ export const useTokens = (selectedChainId?: number) => {
14
13
  if (!selectedChainId) {
15
14
  return { tokens: {} as Record<number, TokenAmount[]> }
16
15
  }
17
- const tokens = await OpenOceanService.getTokenList(selectedChainId.toString())
16
+ const tokens = await OpenOceanService.getTokenList(
17
+ selectedChainId.toString()
18
+ )
18
19
  return {
19
20
  tokens: {
20
- [selectedChainId]: tokens
21
- }
21
+ [selectedChainId]: tokens,
22
+ },
22
23
  }
23
24
  },
24
25
  enabled: !!selectedChainId,
@@ -1,4 +1,4 @@
1
- import { type ToolsResponse, getTools } from '@lifi/sdk'
1
+ import { type ToolsResponse, getTools } from '@openocean.finance/widget-sdk'
2
2
  import { useQuery } from '@tanstack/react-query'
3
3
  import { useWidgetConfig } from '../providers/WidgetProvider/WidgetProvider.js'
4
4
  import { useSettingsStore } from '../stores/settings/useSettingsStore.js'
@@ -1,6 +1,6 @@
1
- import type { FullStatusData } from '@lifi/sdk'
2
- import { type StatusResponse, getStatus } from '@lifi/sdk'
3
1
  import { useAccount } from '@openocean.finance/wallet-management'
2
+ import type { FullStatusData } from '@openocean.finance/widget-sdk'
3
+ import { type StatusResponse, getStatus } from '@openocean.finance/widget-sdk'
4
4
  import {
5
5
  keepPreviousData,
6
6
  useQuery,
@@ -1,6 +1,12 @@
1
- import type { FullStatusData, StatusResponse } from '@lifi/sdk'
2
- import { type ExtendedTransactionInfo, getTransactionHistory } from '@lifi/sdk'
3
1
  import { useAccount } from '@openocean.finance/wallet-management'
2
+ import type {
3
+ FullStatusData,
4
+ StatusResponse,
5
+ } from '@openocean.finance/widget-sdk'
6
+ import {
7
+ type ExtendedTransactionInfo,
8
+ getTransactionHistory,
9
+ } from '@openocean.finance/widget-sdk'
4
10
  import type { QueryFunction } from '@tanstack/react-query'
5
11
  import { useQueries } from '@tanstack/react-query'
6
12
 
package/src/index.ts CHANGED
@@ -1,5 +1,5 @@
1
- export type * from '@lifi/sdk'
2
- export { ChainType, ChainId, CoinKey } from '@lifi/sdk'
1
+ export type * from '@openocean.finance/widget-sdk'
2
+ export { ChainType, ChainId, CoinKey } from '@openocean.finance/widget-sdk'
3
3
  export { App as OpenOceanWidget } from './App.js'
4
4
  export type { WidgetDrawer } from './AppDrawer.js'
5
5
  export * from './components/ContractComponent/ItemPrice.js'
@@ -1,5 +1,5 @@
1
- import type { Route } from '@lifi/sdk'
2
1
  import type { BoxProps } from '@mui/material'
2
+ import type { Route } from '@openocean.finance/widget-sdk'
3
3
  import { WarningMessages } from '../../components/Messages/WarningMessages.js'
4
4
  import { useRoutes } from '../../hooks/useRoutes.js'
5
5
 
@@ -1,6 +1,6 @@
1
- import type { Route } from '@lifi/sdk'
2
1
  import type { BoxProps } from '@mui/material'
3
2
  import { useAccount } from '@openocean.finance/wallet-management'
3
+ import type { Route } from '@openocean.finance/widget-sdk'
4
4
  import { useMemo } from 'react'
5
5
  import { useTranslation } from 'react-i18next'
6
6
  import { ProgressToNextUpdate } from '../../components/ProgressToNextUpdate.js'
@@ -1,5 +1,5 @@
1
- import type { ExtendedChain } from '@lifi/sdk'
2
1
  import { Avatar, ListItemAvatar, debounce } from '@mui/material'
2
+ import type { ExtendedChain } from '@openocean.finance/widget-sdk'
3
3
  import { type FormEventHandler, useState } from 'react'
4
4
  import { useTranslation } from 'react-i18next'
5
5
  import { useChainSelect } from '../../components/ChainSelect/useChainSelect.js'
@@ -1,4 +1,3 @@
1
- import type { ToolsResponse } from '@lifi/sdk'
2
1
  import {
3
2
  Check,
4
3
  CheckBoxOutlineBlankOutlined,
@@ -13,6 +12,7 @@ import {
13
12
  debounce,
14
13
  useTheme,
15
14
  } from '@mui/material'
15
+ import type { ToolsResponse } from '@openocean.finance/widget-sdk'
16
16
  import type { MouseEventHandler } from 'react'
17
17
  import { type FormEventHandler, useMemo, useState } from 'react'
18
18
  import { useTranslation } from 'react-i18next'
@@ -1,5 +1,5 @@
1
- import type { Order } from '@lifi/sdk'
2
1
  import { Route } from '@mui/icons-material'
2
+ import type { Order } from '@openocean.finance/widget-sdk'
3
3
  import { useTranslation } from 'react-i18next'
4
4
  import { CardTabs, Tab } from '../../components/Tabs/Tabs.style.js'
5
5
  import { useSettingMonitor } from '../../hooks/useSettingMonitor.js'
@@ -1,5 +1,5 @@
1
- import type { FullStatusData } from '@lifi/sdk'
2
1
  import { Box, Typography } from '@mui/material'
2
+ import type { FullStatusData } from '@openocean.finance/widget-sdk'
3
3
  import { useEffect, useMemo } from 'react'
4
4
  import { useTranslation } from 'react-i18next'
5
5
  import { useLocation } from 'react-router-dom'
@@ -91,7 +91,7 @@ export const TransactionDetailsPage: React.FC = () => {
91
91
  sx={{
92
92
  fontSize: 12,
93
93
  }}
94
- color='text.secondary'
94
+ color="text.secondary"
95
95
  >
96
96
  {startedAt.toLocaleString(i18n.language, {
97
97
  dateStyle: 'long',
@@ -101,7 +101,7 @@ export const TransactionDetailsPage: React.FC = () => {
101
101
  sx={{
102
102
  fontSize: 12,
103
103
  }}
104
- color='text.secondary'
104
+ color="text.secondary"
105
105
  >
106
106
  {startedAt.toLocaleString(i18n.language, {
107
107
  timeStyle: 'short',
@@ -120,7 +120,10 @@ export const TransactionDetailsPage: React.FC = () => {
120
120
  route={routeExecution.route}
121
121
  sx={{ marginTop: 2 }}
122
122
  />
123
- <TransferIdCard transferId={supportId} chain={routeExecution.route.fromChainId} />
123
+ <TransferIdCard
124
+ transferId={supportId}
125
+ chain={routeExecution.route.fromChainId}
126
+ />
124
127
  </>
125
128
  ) : null}
126
129
  <Box
@@ -1,10 +1,11 @@
1
- import type { Chain } from '@lifi/sdk'
2
1
  import { ContentCopyRounded, OpenInNew } from '@mui/icons-material'
3
2
  import { Box, Typography } from '@mui/material'
3
+ import type { Chain } from '@openocean.finance/widget-sdk'
4
4
  import { useTranslation } from 'react-i18next'
5
5
  import { Card } from '../../components/Card/Card.js'
6
6
  import { CardIconButton } from '../../components/Card/CardIconButton.js'
7
7
  import { CardTitle } from '../../components/Card/CardTitle.js'
8
+ import { useExplorer } from '../../hooks/useExplorer.js'
8
9
 
9
10
  interface TransferIdCardProps {
10
11
  transferId: string
@@ -37,7 +38,7 @@ export const TransferIdCard = ({ transferId, chain }: TransferIdCardProps) => {
37
38
  flex: 1,
38
39
  }}
39
40
  >
40
- <CardTitle flex={1}>{t('main.transferId')}</CardTitle>
41
+ <CardTitle flex={1}>{t('translation:main.transferId')}</CardTitle>
41
42
  <Box
42
43
  sx={{
43
44
  gap: 1,
@@ -1,10 +1,10 @@
1
+ import { Box, Typography } from '@mui/material'
1
2
  import type {
2
3
  ExtendedTransactionInfo,
3
4
  FullStatusData,
4
5
  StatusResponse,
5
6
  TokenAmount,
6
- } from '@lifi/sdk'
7
- import { Box, Typography } from '@mui/material'
7
+ } from '@openocean.finance/widget-sdk'
8
8
  import { useTranslation } from 'react-i18next'
9
9
  import { useNavigate } from 'react-router-dom'
10
10
  import { Card } from '../../components/Card/Card.js'
@@ -1,5 +1,5 @@
1
- import type { FullStatusData } from '@lifi/sdk'
2
1
  import { Box, List } from '@mui/material'
2
+ import type { FullStatusData } from '@openocean.finance/widget-sdk'
3
3
  import { useVirtualizer } from '@tanstack/react-virtual'
4
4
  import type React from 'react'
5
5
  import { useRef } from 'react'
@@ -1,6 +1,6 @@
1
- import type { ExchangeRateUpdateParams } from '@lifi/sdk'
2
1
  import { WarningRounded } from '@mui/icons-material'
3
2
  import { Box, Button, Typography } from '@mui/material'
3
+ import type { ExchangeRateUpdateParams } from '@openocean.finance/widget-sdk'
4
4
  import type { MutableRefObject } from 'react'
5
5
  import {
6
6
  forwardRef,
@@ -1,7 +1,7 @@
1
- import type { Route } from '@lifi/sdk'
2
- import { isGaslessStep } from '@lifi/sdk'
3
1
  import { WarningRounded } from '@mui/icons-material'
4
2
  import { Box, Button, Typography } from '@mui/material'
3
+ import type { Route } from '@openocean.finance/widget-sdk'
4
+ import { isGaslessStep } from '@openocean.finance/widget-sdk'
5
5
  import type { MutableRefObject } from 'react'
6
6
  import { forwardRef, useRef } from 'react'
7
7
  import { useTranslation } from 'react-i18next'
@@ -1,6 +1,6 @@
1
- import type { ExchangeRateUpdateParams } from '@lifi/sdk'
2
1
  import { Delete } from '@mui/icons-material'
3
2
  import { Box, Button, Tooltip } from '@mui/material'
3
+ import type { ExchangeRateUpdateParams } from '@openocean.finance/widget-sdk'
4
4
  import { useEffect, useMemo, useRef, useState } from 'react'
5
5
  import { useTranslation } from 'react-i18next'
6
6
  import { useLocation } from 'react-router-dom'
@@ -1,4 +1,4 @@
1
- import type { Route } from '@lifi/sdk'
1
+ import type { Route } from '@openocean.finance/widget-sdk'
2
2
  import type { BaseTransactionButtonProps } from '../../components/BaseTransactionButton/types.js'
3
3
 
4
4
  export interface StartTransactionButtonProps
@@ -1,4 +1,4 @@
1
- import { ChainType } from '@lifi/sdk'
1
+ import { ChainType } from '@openocean.finance/widget-sdk'
2
2
  import { type FC, type PropsWithChildren, useContext } from 'react'
3
3
  import { WagmiContext } from 'wagmi'
4
4
  import { isItemAllowed } from '../../utils/item.js'