@openocean.finance/widget 1.0.2 → 1.0.3
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 +4 -5
- package/src/components/AmountInput/AmountInput.tsx +1 -1
- package/src/components/AmountInput/PriceFormHelperText.tsx +13 -13
- package/src/components/Avatar/TokenAvatar.tsx +1 -1
- package/src/components/ChainSelect/ChainSelect.tsx +1 -1
- package/src/components/ChainSelect/useChainSelect.ts +1 -1
- package/src/components/ContractComponent/ItemPrice.tsx +1 -1
- package/src/components/ContractComponent/NFT/types.ts +1 -1
- package/src/components/Messages/WarningMessages.tsx +5 -5
- package/src/components/Messages/useMessageQueue.ts +1 -1
- package/src/components/RouteCard/RouteCard.tsx +2 -2
- package/src/components/RouteCard/RouteCardEssentials.tsx +1 -1
- package/src/components/RouteCard/getMatchingLabels.ts +1 -1
- package/src/components/RouteCard/types.ts +1 -1
- package/src/components/Routes/RoutesExpanded.tsx +1 -1
- package/src/components/Step/CircularProgress.style.tsx +1 -1
- package/src/components/Step/CircularProgress.tsx +1 -1
- package/src/components/Step/DestinationWalletAddress.tsx +2 -2
- package/src/components/Step/Step.tsx +6 -3
- package/src/components/Step/StepList.tsx +1 -1
- package/src/components/Step/StepProcess.tsx +2 -2
- package/src/components/StepActions/StepActions.tsx +5 -5
- package/src/components/StepActions/StepFees.tsx +2 -2
- package/src/components/StepActions/types.ts +3 -3
- package/src/components/Timer/RouteTimer.tsx +1 -1
- package/src/components/Timer/StepTimer.tsx +5 -5
- package/src/components/Token/Token.tsx +9 -7
- package/src/components/TokenList/TokenListItem.tsx +1 -1
- package/src/components/TokenList/types.ts +1 -1
- package/src/components/TokenRate/TokenRate.tsx +1 -1
- package/src/components/TransactionDetails.tsx +1 -1
- package/src/config/coinbase.ts +1 -1
- package/src/config/metaMask.ts +1 -1
- package/src/hooks/useAddressValidation.ts +2 -2
- package/src/hooks/useAvailableChains.ts +2 -2
- package/src/hooks/useChains.ts +1 -1
- package/src/hooks/useExplorer.ts +4 -2
- package/src/hooks/useFromTokenSufficiency.ts +1 -1
- package/src/hooks/useGasRecommendation.ts +4 -1
- package/src/hooks/useGasSufficiency.ts +7 -3
- package/src/hooks/useInitializer.ts +1 -1
- package/src/hooks/useIsBatchingSupported.ts +2 -2
- package/src/hooks/useIsCompatibleDestinationAccount.ts +1 -1
- package/src/hooks/useIsContractAddress.ts +1 -1
- package/src/hooks/useProcessMessage.ts +23 -23
- package/src/hooks/useRouteExecution.ts +5 -2
- package/src/hooks/useRoutes.ts +4 -4
- package/src/hooks/useToAddressRequirements.ts +1 -1
- package/src/hooks/useToAddressReset.ts +1 -1
- package/src/hooks/useTokenBalance.ts +5 -1
- package/src/hooks/useTokenBalances.ts +1 -1
- package/src/hooks/useTokenSearch.ts +5 -2
- package/src/hooks/useTokens.ts +6 -5
- package/src/hooks/useTools.ts +1 -1
- package/src/hooks/useTransactionDetails.ts +2 -2
- package/src/hooks/useTransactionHistory.ts +8 -2
- package/src/index.ts +2 -2
- package/src/pages/MainPage/MainWarningMessages.tsx +1 -1
- package/src/pages/RoutesPage/RoutesPage.tsx +1 -1
- package/src/pages/SelectChainPage/SelectChainPage.tsx +1 -1
- package/src/pages/SelectEnabledToolsPage.tsx +1 -1
- package/src/pages/SettingsPage/RoutePrioritySettings.tsx +1 -1
- package/src/pages/TransactionDetailsPage/TransactionDetailsPage.tsx +7 -4
- package/src/pages/TransactionDetailsPage/TransferIdCard.tsx +1 -1
- package/src/pages/TransactionHistoryPage/TransactionHistoryItem.tsx +2 -2
- package/src/pages/TransactionHistoryPage/TransactionHistoryPage.tsx +1 -1
- package/src/pages/TransactionPage/ExchangeRateBottomSheet.tsx +1 -1
- package/src/pages/TransactionPage/TokenValueBottomSheet.tsx +2 -2
- package/src/pages/TransactionPage/TransactionPage.tsx +1 -1
- package/src/pages/TransactionPage/types.ts +1 -1
- package/src/providers/WalletProvider/EVMProvider.tsx +1 -1
- package/src/providers/WalletProvider/SDKProviders.tsx +8 -2
- package/src/providers/WalletProvider/SVMProvider.tsx +1 -1
- package/src/providers/WalletProvider/UTXOProvider.tsx +1 -1
- package/src/providers/WalletProvider/useExternalWalletProvider.ts +1 -1
- package/src/providers/WidgetProvider/WidgetProvider.tsx +2 -2
- package/src/services/ExecuteRoute.ts +34 -22
- package/src/stores/form/types.ts +1 -1
- package/src/stores/routes/createRouteExecutionStore.ts +1 -1
- package/src/stores/routes/types.ts +1 -1
- package/src/stores/routes/utils.ts +1 -1
- package/src/stores/settings/types.ts +1 -1
- package/src/types/events.ts +6 -1
- package/src/types/token.ts +1 -1
- package/src/types/widget.ts +10 -10
- package/src/utils/chainType.ts +1 -1
- package/src/utils/converters.ts +2 -2
- package/src/utils/fees.ts +6 -1
- package/src/utils/getPriceImpact.ts +1 -1
- /package/src/icons/{lifi.ts → openocean.ts} +0 -0
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import type {
|
|
2
2
|
EVMChain,
|
|
3
|
-
|
|
3
|
+
OpenOceanStep,
|
|
4
4
|
Process,
|
|
5
5
|
ProcessStatus,
|
|
6
6
|
ProcessType,
|
|
7
7
|
StatusMessage,
|
|
8
8
|
Substatus,
|
|
9
|
-
} from '@
|
|
10
|
-
import {
|
|
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?:
|
|
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:
|
|
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:
|
|
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
|
|
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
|
|
162
|
+
case OpenOceanErrorCode.BalanceError:
|
|
163
163
|
title = t('error.title.balanceIsTooLow')
|
|
164
164
|
message = getDefaultErrorMessage()
|
|
165
165
|
break
|
|
166
|
-
case
|
|
166
|
+
case OpenOceanErrorCode.ChainSwitchError:
|
|
167
167
|
title = t('error.title.chainSwitch')
|
|
168
168
|
message = getDefaultErrorMessage()
|
|
169
169
|
break
|
|
170
|
-
case
|
|
170
|
+
case OpenOceanErrorCode.GasLimitError:
|
|
171
171
|
title = t('error.title.gasLimitIsTooLow')
|
|
172
172
|
message = getDefaultErrorMessage()
|
|
173
173
|
break
|
|
174
|
-
case
|
|
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
|
|
180
|
+
case OpenOceanErrorCode.SlippageError:
|
|
181
181
|
title = t('error.title.slippageNotMet')
|
|
182
182
|
message = t('error.message.slippageThreshold')
|
|
183
183
|
break
|
|
184
|
-
case
|
|
184
|
+
case OpenOceanErrorCode.TransactionFailed:
|
|
185
185
|
title = t('error.title.transactionFailed')
|
|
186
186
|
message = t('error.message.transactionFailed')
|
|
187
187
|
break
|
|
188
|
-
case
|
|
188
|
+
case OpenOceanErrorCode.TransactionExpired:
|
|
189
189
|
title = t('error.title.transactionExpired')
|
|
190
190
|
message = t('error.message.transactionExpired')
|
|
191
191
|
break
|
|
192
|
-
case
|
|
192
|
+
case OpenOceanErrorCode.TransactionSimulationFailed:
|
|
193
193
|
title = t('error.title.transactionSimulationFailed')
|
|
194
194
|
message = t('error.message.transactionSimulationFailed')
|
|
195
195
|
break
|
|
196
|
-
case
|
|
196
|
+
case OpenOceanErrorCode.WalletChangedDuringExecution:
|
|
197
197
|
title = t('error.title.walletMismatch')
|
|
198
198
|
message = t('error.message.walletChangedDuringExecution')
|
|
199
199
|
break
|
|
200
|
-
case
|
|
200
|
+
case OpenOceanErrorCode.TransactionUnderpriced:
|
|
201
201
|
title = t('error.title.transactionUnderpriced')
|
|
202
202
|
message = getDefaultErrorMessage()
|
|
203
203
|
break
|
|
204
|
-
case
|
|
204
|
+
case OpenOceanErrorCode.TransactionUnprepared:
|
|
205
205
|
title = t('error.title.transactionUnprepared')
|
|
206
206
|
message = getDefaultErrorMessage()
|
|
207
207
|
break
|
|
208
|
-
case
|
|
208
|
+
case OpenOceanErrorCode.TransactionCanceled:
|
|
209
209
|
title = t('error.title.transactionCanceled')
|
|
210
210
|
message = getDefaultErrorMessage('error.message.transactionCanceled')
|
|
211
211
|
break
|
|
212
|
-
case
|
|
212
|
+
case OpenOceanErrorCode.TransactionRejected:
|
|
213
213
|
title = t('error.title.transactionRejected')
|
|
214
214
|
message = getDefaultErrorMessage('error.message.transactionRejected')
|
|
215
215
|
break
|
|
216
|
-
case
|
|
216
|
+
case OpenOceanErrorCode.TransactionConflict:
|
|
217
217
|
title = t('error.title.transactionConflict')
|
|
218
218
|
message = getDefaultErrorMessage('error.message.transactionConflict')
|
|
219
219
|
break
|
|
220
|
-
case
|
|
220
|
+
case OpenOceanErrorCode.ExchangeRateUpdateCanceled:
|
|
221
221
|
title = t('error.title.exchangeRateUpdateCanceled')
|
|
222
222
|
message = getDefaultErrorMessage()
|
|
223
223
|
break
|
|
224
|
-
case
|
|
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'
|
package/src/hooks/useRoutes.ts
CHANGED
|
@@ -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: '
|
|
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 ===
|
|
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 '@
|
|
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 {
|
|
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
|
|
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(
|
|
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>(
|
package/src/hooks/useTokens.ts
CHANGED
|
@@ -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(
|
|
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,
|
package/src/hooks/useTools.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type ToolsResponse, getTools } from '@
|
|
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 '@
|
|
2
|
-
export { ChainType, ChainId, CoinKey } from '@
|
|
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=
|
|
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=
|
|
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
|
|
123
|
+
<TransferIdCard
|
|
124
|
+
transferId={supportId}
|
|
125
|
+
chain={routeExecution.route.fromChainId}
|
|
126
|
+
/>
|
|
124
127
|
</>
|
|
125
128
|
) : null}
|
|
126
129
|
<Box
|
|
@@ -1,6 +1,6 @@
|
|
|
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'
|
|
@@ -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 '@
|
|
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,7 +1,13 @@
|
|
|
1
1
|
import { getConnectorClient as getBigmiConnectorClient } from '@bigmi/client'
|
|
2
2
|
import { useConfig as useBigmiConfig } from '@bigmi/react'
|
|
3
|
-
import type { SDKProvider } from '@
|
|
4
|
-
import {
|
|
3
|
+
import type { SDKProvider } from '@openocean.finance/widget-sdk'
|
|
4
|
+
import {
|
|
5
|
+
ChainType,
|
|
6
|
+
EVM,
|
|
7
|
+
Solana,
|
|
8
|
+
UTXO,
|
|
9
|
+
config,
|
|
10
|
+
} from '@openocean.finance/widget-sdk'
|
|
5
11
|
import type { SignerWalletAdapter } from '@solana/wallet-adapter-base'
|
|
6
12
|
import { useWallet } from '@solana/wallet-adapter-react'
|
|
7
13
|
import { useEffect } from 'react'
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ChainType } from '@
|
|
1
|
+
import { ChainType } from '@openocean.finance/widget-sdk'
|
|
2
2
|
import { ConnectionContext } from '@solana/wallet-adapter-react'
|
|
3
3
|
import { type FC, type PropsWithChildren, useContext } from 'react'
|
|
4
4
|
import { isItemAllowed } from '../../utils/item.js'
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { BigmiContext } from '@bigmi/react'
|
|
2
|
-
import { ChainType } from '@
|
|
2
|
+
import { ChainType } from '@openocean.finance/widget-sdk'
|
|
3
3
|
import { type FC, type PropsWithChildren, useContext } from 'react'
|
|
4
4
|
import { isItemAllowed } from '../../utils/item.js'
|
|
5
5
|
import { useWidgetConfig } from '../WidgetProvider/WidgetProvider.js'
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ChainType } from '@
|
|
1
|
+
import { ChainType } from '@openocean.finance/widget-sdk'
|
|
2
2
|
import { useContext, useMemo } from 'react'
|
|
3
3
|
import { useWidgetConfig } from '../WidgetProvider/WidgetProvider.js'
|
|
4
4
|
import { EVMExternalContext } from './EVMExternalContext.js'
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { SDKConfig } from '@
|
|
2
|
-
import { config, createConfig } from '@
|
|
1
|
+
import type { SDKConfig } from '@openocean.finance/widget-sdk'
|
|
2
|
+
import { config, createConfig } from '@openocean.finance/widget-sdk'
|
|
3
3
|
import { createContext, useContext, useId, useMemo } from 'react'
|
|
4
4
|
import { version } from '../../config/version.js'
|
|
5
5
|
import { useSettingsActions } from '../../stores/settings/useSettingsActions.js'
|