@lifi/widget 3.12.3-beta.1 → 3.12.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 (81) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/dist/esm/components/ActiveTransactions/ActiveTransactions.style.d.ts +2 -2
  3. package/dist/esm/components/AmountInput/AmountInput.js +1 -7
  4. package/dist/esm/components/AmountInput/AmountInput.js.map +1 -1
  5. package/dist/esm/components/AmountInput/AmountInput.style.d.ts +1 -1
  6. package/dist/esm/components/AmountInput/AmountInputAdornment.style.d.ts +1 -1
  7. package/dist/esm/components/AppContainer.d.ts +1 -1
  8. package/dist/esm/components/Avatar/Avatar.style.d.ts +1 -1
  9. package/dist/esm/components/Avatar/SmallAvatar.d.ts +1 -1
  10. package/dist/esm/components/ButtonTertiary.d.ts +1 -1
  11. package/dist/esm/components/Card/CardHeader.d.ts +1 -1
  12. package/dist/esm/components/Card/InputCard.d.ts +1 -1
  13. package/dist/esm/components/ContractComponent/ItemPrice.js +1 -2
  14. package/dist/esm/components/ContractComponent/ItemPrice.js.map +1 -1
  15. package/dist/esm/components/ContractComponent/NFT/NFT.js +1 -2
  16. package/dist/esm/components/ContractComponent/NFT/NFT.js.map +1 -1
  17. package/dist/esm/components/ContractComponent/NFT/NFT.style.d.ts +1 -1
  18. package/dist/esm/components/Header/Header.style.d.ts +2 -2
  19. package/dist/esm/components/Header/SettingsButton.style.d.ts +1 -1
  20. package/dist/esm/components/ListItem/ListItem.d.ts +1 -1
  21. package/dist/esm/components/PageContainer.d.ts +1 -1
  22. package/dist/esm/components/PoweredBy/PoweredBy.js +13 -1
  23. package/dist/esm/components/PoweredBy/PoweredBy.js.map +1 -1
  24. package/dist/esm/components/RouteCard/RouteCard.js +2 -2
  25. package/dist/esm/components/RouteCard/RouteCard.js.map +1 -1
  26. package/dist/esm/components/Routes/Routes.js +2 -7
  27. package/dist/esm/components/Routes/Routes.js.map +1 -1
  28. package/dist/esm/components/Routes/RoutesExpanded.js +4 -7
  29. package/dist/esm/components/Routes/RoutesExpanded.js.map +1 -1
  30. package/dist/esm/components/SelectTokenButton/SelectTokenButton.style.d.ts +1 -1
  31. package/dist/esm/components/SendToWallet/SendToWallet.style.d.ts +1 -1
  32. package/dist/esm/components/SendToWallet/SendToWalletButton.js +2 -5
  33. package/dist/esm/components/SendToWallet/SendToWalletButton.js.map +1 -1
  34. package/dist/esm/components/Skeleton/WidgetSkeleton.style.d.ts +3 -3
  35. package/dist/esm/components/Step/Step.js +2 -2
  36. package/dist/esm/components/Step/Step.js.map +1 -1
  37. package/dist/esm/components/StepActions/StepActions.style.d.ts +1 -1
  38. package/dist/esm/components/StepDivider/StepDivider.style.d.ts +1 -1
  39. package/dist/esm/components/Tabs/Tabs.style.d.ts +1 -1
  40. package/dist/esm/components/TokenList/TokenList.style.d.ts +1 -1
  41. package/dist/esm/config/version.d.ts +1 -1
  42. package/dist/esm/config/version.js +1 -1
  43. package/dist/esm/config/version.js.map +1 -1
  44. package/dist/esm/hooks/useFromTokenSufficiency.js +1 -1
  45. package/dist/esm/hooks/useFromTokenSufficiency.js.map +1 -1
  46. package/dist/esm/hooks/useGasRefuel.js +9 -6
  47. package/dist/esm/hooks/useGasRefuel.js.map +1 -1
  48. package/dist/esm/hooks/useIsContractAddress.js.map +1 -1
  49. package/dist/esm/hooks/useRoutes.js +4 -6
  50. package/dist/esm/hooks/useRoutes.js.map +1 -1
  51. package/dist/esm/i18n/en.json +1 -5
  52. package/dist/esm/index.d.ts +1 -1
  53. package/dist/esm/index.js +1 -1
  54. package/dist/esm/index.js.map +1 -1
  55. package/dist/esm/pages/MainPage/MainPage.js +1 -2
  56. package/dist/esm/pages/MainPage/MainPage.js.map +1 -1
  57. package/dist/esm/pages/MainPage/MainPage.style.d.ts +1 -1
  58. package/dist/esm/pages/SendToWallet/SendToWalletPage.style.d.ts +4 -4
  59. package/dist/esm/pages/SettingsPage/SettingsCard/SettingCard.style.d.ts +1 -1
  60. package/dist/esm/types/widget.d.ts +3 -2
  61. package/package.json +9 -9
  62. package/src/components/AmountInput/AmountInput.tsx +1 -9
  63. package/src/components/ContractComponent/ItemPrice.tsx +3 -8
  64. package/src/components/ContractComponent/NFT/NFT.tsx +3 -8
  65. package/src/components/PoweredBy/PoweredBy.tsx +16 -2
  66. package/src/components/RouteCard/RouteCard.tsx +2 -2
  67. package/src/components/Routes/Routes.tsx +4 -10
  68. package/src/components/Routes/RoutesExpanded.tsx +4 -9
  69. package/src/components/SendToWallet/SendToWalletButton.tsx +4 -14
  70. package/src/components/Step/Step.tsx +2 -2
  71. package/src/config/version.ts +1 -1
  72. package/src/hooks/useFromTokenSufficiency.ts +1 -1
  73. package/src/hooks/useGasRefuel.ts +18 -6
  74. package/src/hooks/useIsContractAddress.ts +0 -1
  75. package/src/hooks/useRoutes.ts +4 -6
  76. package/src/i18n/en.json +1 -5
  77. package/src/i18n/i18next.d.ts +8 -4
  78. package/src/index.ts +1 -1
  79. package/src/pages/MainPage/MainPage.tsx +8 -9
  80. package/src/types/widget.ts +4 -2
  81. package/tsconfig.json +2 -4
@@ -70,7 +70,6 @@ export const AmountInputBase: React.FC<
70
70
  ...props
71
71
  }) => {
72
72
  const { t } = useTranslation()
73
- const { subvariant, subvariantOptions } = useWidgetConfig()
74
73
  const ref = useRef<HTMLInputElement>(null)
75
74
  const amountKey = FormKeyHelper.getAmountKey(formType)
76
75
  const { onChange, onBlur, value } = useFieldController({ name: amountKey })
@@ -99,16 +98,9 @@ export const AmountInputBase: React.FC<
99
98
  }
100
99
  }, [value])
101
100
 
102
- const title =
103
- subvariant === 'custom'
104
- ? subvariantOptions?.custom === 'deposit'
105
- ? t('header.amount')
106
- : t('header.youPay')
107
- : t('header.send')
108
-
109
101
  return (
110
102
  <InputCard {...props}>
111
- <CardTitle>{title}</CardTitle>
103
+ <CardTitle>{t('header.send')}</CardTitle>
112
104
  <FormContainer>
113
105
  <AmountInputStartAdornment formType={formType} />
114
106
  <FormControl fullWidth>
@@ -1,6 +1,5 @@
1
1
  import type { ContractCall } from '@lifi/sdk'
2
2
  import { useEffect } from 'react'
3
- import { formatUnits } from 'viem'
4
3
  import { useFieldActions } from '../../stores/form/useFieldActions.js'
5
4
  import type { TokenAmount } from '../../types/token.js'
6
5
  import { Token } from '../Token/Token.js'
@@ -20,13 +19,9 @@ export const ItemPrice: React.FC<ItemPriceProps> = ({
20
19
  if (token) {
21
20
  setFieldValue('toChain', token.chainId, { isTouched: true })
22
21
  setFieldValue('toToken', token.address, { isTouched: true })
23
- setFieldValue(
24
- 'toAmount',
25
- token.amount ? formatUnits(token.amount, token.decimals) : '',
26
- {
27
- isTouched: true,
28
- }
29
- )
22
+ setFieldValue('toAmount', token.amount?.toString(), {
23
+ isTouched: true,
24
+ })
30
25
  }
31
26
  if (contractCalls) {
32
27
  setFieldValue('contractCalls', contractCalls, {
@@ -1,5 +1,4 @@
1
1
  import { useEffect } from 'react'
2
- import { formatUnits } from 'viem'
3
2
  import { useFieldActions } from '../../../stores/form/useFieldActions.js'
4
3
  import { NFTBase } from './NFTBase.js'
5
4
  import type { NFTProps } from './types.js'
@@ -19,13 +18,9 @@ export const NFT: React.FC<NFTProps> = ({
19
18
  if (token) {
20
19
  setFieldValue('toChain', token.chainId, { isTouched: true })
21
20
  setFieldValue('toToken', token.address, { isTouched: true })
22
- setFieldValue(
23
- 'toAmount',
24
- token.amount ? formatUnits(token.amount, token.decimals) : '',
25
- {
26
- isTouched: true,
27
- }
28
- )
21
+ setFieldValue('toAmount', token.amount?.toString(), {
22
+ isTouched: true,
23
+ })
29
24
  }
30
25
  if (contractCall) {
31
26
  setFieldValue('contractCalls', [contractCall], {
@@ -1,8 +1,22 @@
1
1
  import { Box, Tooltip, Typography } from '@mui/material'
2
2
  import { version } from '../../config/version.js'
3
+ import { useWidgetConfig } from '../../providers/WidgetProvider/WidgetProvider.js'
3
4
  import { Link } from './PoweredBy.style.js'
4
5
 
6
+ const poweredByConfig = {
7
+ default: {
8
+ url: 'https://li.fi',
9
+ text: 'LI.FI',
10
+ },
11
+ jumper: {
12
+ url: 'https://jumper.exchange',
13
+ text: 'Jumper',
14
+ },
15
+ }
16
+
5
17
  export const PoweredBy: React.FC = () => {
18
+ const { poweredBy = 'default' } = useWidgetConfig()
19
+
6
20
  return (
7
21
  <Box
8
22
  pt={1}
@@ -16,7 +30,7 @@ export const PoweredBy: React.FC = () => {
16
30
  >
17
31
  <Tooltip title={`v${version}`} enterDelay={1000}>
18
32
  <Link
19
- href="https://li.fi"
33
+ href={poweredByConfig[poweredBy].url}
20
34
  target="_blank"
21
35
  underline="none"
22
36
  color="text.primary"
@@ -30,7 +44,7 @@ export const PoweredBy: React.FC = () => {
30
44
  Powered by
31
45
  </Typography>
32
46
  <Typography color="text.primary" fontSize={12} fontWeight={600}>
33
- LI.FI
47
+ {poweredByConfig[poweredBy].text}
34
48
  </Typography>
35
49
  </Link>
36
50
  </Tooltip>
@@ -26,7 +26,7 @@ export const RouteCard: React.FC<
26
26
  ...other
27
27
  }) => {
28
28
  const { t } = useTranslation()
29
- const { subvariant, subvariantOptions } = useWidgetConfig()
29
+ const { subvariant } = useWidgetConfig()
30
30
  const [cardExpanded, setCardExpanded] = useState(defaulExpanded)
31
31
 
32
32
  const handleExpand: MouseEventHandler<HTMLButtonElement> = (e) => {
@@ -35,7 +35,7 @@ export const RouteCard: React.FC<
35
35
  }
36
36
 
37
37
  const token: TokenAmount =
38
- subvariant === 'custom' && subvariantOptions?.custom !== 'deposit'
38
+ subvariant === 'custom'
39
39
  ? { ...route.fromToken, amount: BigInt(route.fromAmount) }
40
40
  : { ...route.toToken, amount: BigInt(route.toAmount) }
41
41
  const impactToken: TokenAmount | undefined =
@@ -16,8 +16,7 @@ import { RouteNotFoundCard } from '../RouteCard/RouteNotFoundCard.js'
16
16
  export const Routes: React.FC<CardProps> = (props) => {
17
17
  const { t } = useTranslation()
18
18
  const navigate = useNavigate()
19
- const { subvariant, subvariantOptions, useRecommendedRoute } =
20
- useWidgetConfig()
19
+ const { subvariant, useRecommendedRoute } = useWidgetConfig()
21
20
  const {
22
21
  routes,
23
22
  isLoading,
@@ -43,16 +42,11 @@ export const Routes: React.FC<CardProps> = (props) => {
43
42
  const showAll =
44
43
  !onlyRecommendedRoute && !routeNotFound && (routes?.length ?? 0) > 1
45
44
 
46
- const title =
47
- subvariant === 'custom'
48
- ? subvariantOptions?.custom === 'deposit'
49
- ? t('header.receive')
50
- : t('header.youPay')
51
- : t('header.receive')
52
-
53
45
  return (
54
46
  <Card {...props}>
55
- <CardTitle>{title}</CardTitle>
47
+ <CardTitle>
48
+ {subvariant === 'custom' ? t('header.youPay') : t('header.receive')}
49
+ </CardTitle>
56
50
  <ProgressToNextUpdate
57
51
  updatedAt={dataUpdatedAt || new Date().getTime()}
58
52
  timeToUpdate={refetchTime}
@@ -64,7 +64,7 @@ export const RoutesExpanded = () => {
64
64
  export const RoutesExpandedElement = () => {
65
65
  const { t } = useTranslation()
66
66
  const navigate = useNavigate()
67
- const { subvariant, subvariantOptions } = useWidgetConfig()
67
+ const { subvariant } = useWidgetConfig()
68
68
  const routesRef = useRef<Route[]>()
69
69
  const emitter = useWidgetEvents()
70
70
  const routesActiveRef = useRef(false)
@@ -118,13 +118,6 @@ export const RoutesExpandedElement = () => {
118
118
  emitter.emit(WidgetEvent.WidgetExpanded, expanded)
119
119
  }, [emitter, expanded])
120
120
 
121
- const title =
122
- subvariant === 'custom'
123
- ? subvariantOptions?.custom === 'deposit'
124
- ? t('header.deposit')
125
- : t('header.youPay')
126
- : t('header.receive')
127
-
128
121
  return (
129
122
  <RoutesExpandedCollapse
130
123
  timeout={timeout.enter}
@@ -137,7 +130,9 @@ export const RoutesExpandedElement = () => {
137
130
  <ScrollableContainer>
138
131
  <Header>
139
132
  <Typography fontSize={18} fontWeight="700" flex={1} noWrap>
140
- {title}
133
+ {subvariant === 'custom'
134
+ ? t('header.youPay')
135
+ : t('header.receive')}
141
136
  </Typography>
142
137
  <ProgressToNextUpdate
143
138
  updatedAt={dataUpdatedAt || new Date().getTime()}
@@ -28,14 +28,7 @@ import { SendToWalletCardHeader } from './SendToWallet.style.js'
28
28
  export const SendToWalletButton: React.FC<CardProps> = (props) => {
29
29
  const { t } = useTranslation()
30
30
  const navigate = useNavigate()
31
- const {
32
- disabledUI,
33
- hiddenUI,
34
- toAddress,
35
- toAddresses,
36
- subvariant,
37
- subvariantOptions,
38
- } = useWidgetConfig()
31
+ const { disabledUI, hiddenUI, toAddress, toAddresses } = useWidgetConfig()
39
32
  const { showSendToWallet } = useSendToWalletStore()
40
33
  const [toAddressFieldValue, toChainId, toTokenAddress] = useFieldValues(
41
34
  'toAddress',
@@ -121,11 +114,6 @@ export const SendToWalletButton: React.FC<CardProps> = (props) => {
121
114
  const isOpenCollapse =
122
115
  requiredToAddress || (showSendToWallet && !hiddenToAddress)
123
116
 
124
- const title =
125
- subvariant === 'custom' && subvariantOptions?.custom === 'deposit'
126
- ? t('header.depositTo')
127
- : t('header.sendToWallet')
128
-
129
117
  return (
130
118
  <Collapse
131
119
  timeout={collapseTransitionTime.current}
@@ -139,7 +127,9 @@ export const SendToWalletButton: React.FC<CardProps> = (props) => {
139
127
  onClick={disabledForChanges ? undefined : handleOnClick}
140
128
  sx={{ width: '100%', ...props.sx }}
141
129
  >
142
- <CardTitle required={requiredToAddress}>{title}</CardTitle>
130
+ <CardTitle required={requiredToAddress}>
131
+ {t('header.sendToWallet')}
132
+ </CardTitle>
143
133
  <Box display="flex" justifyContent="center" alignItems="center">
144
134
  <SendToWalletCardHeader
145
135
  avatar={
@@ -58,8 +58,8 @@ export const Step: React.FC<{
58
58
  default:
59
59
  return subvariant === 'custom'
60
60
  ? subvariantOptions?.custom === 'deposit'
61
- ? t('main.stepDeposit')
62
- : t('main.stepBuy')
61
+ ? t('main.stepSwapAndDeposit')
62
+ : t('main.stepSwapAndBuy')
63
63
  : t('main.stepSwap')
64
64
  }
65
65
  }
@@ -1,2 +1,2 @@
1
1
  export const name = '@lifi/widget'
2
- export const version = '3.12.3-beta.1'
2
+ export const version = '3.12.4'
@@ -77,7 +77,7 @@ export const useFromTokenSufficiency = (route?: RouteExtended) => {
77
77
  enabled: Boolean(account.address && token && !isTokenAddressBalanceLoading),
78
78
  refetchInterval,
79
79
  staleTime: refetchInterval,
80
- placeholderData: keepPreviousData,
80
+ placeholderData: account.address ? keepPreviousData : undefined,
81
81
  })
82
82
 
83
83
  return {
@@ -19,18 +19,29 @@ export const useGasRefuel = () => {
19
19
  const toChain = getChainById(toChainId)
20
20
  const fromChain = getChainById(fromChainId)
21
21
 
22
- const { account: toAccount } = useAccount({ chainType: toChain?.chainType })
22
+ const { accounts } = useAccount()
23
23
 
24
- const effectiveToAddress = toAddress || toAccount?.address
24
+ const fromAccount = accounts.find(
25
+ (account) => account.chainType === fromChain?.chainType
26
+ )
27
+
28
+ const toAccount = accounts.find(
29
+ (account) => account.chainType === toChain?.chainType
30
+ )
25
31
 
32
+ const isFromContractAddress = useIsContractAddress(
33
+ fromAccount?.address,
34
+ fromChainId,
35
+ fromAccount?.chainType
36
+ )
26
37
  const isToContractAddress = useIsContractAddress(
27
- effectiveToAddress,
38
+ toAddress,
28
39
  toChainId,
29
40
  toChain?.chainType
30
41
  )
31
42
 
32
43
  const { token: destinationNativeToken } = useTokenBalance(
33
- effectiveToAddress,
44
+ toAddress || toAccount?.address,
34
45
  toChainId ? toChain?.nativeToken : undefined
35
46
  )
36
47
 
@@ -44,8 +55,9 @@ export const useGasRefuel = () => {
44
55
  const isChainTypeSatisfied =
45
56
  fromChain?.chainType !== toChain?.chainType ? Boolean(toAddress) : true
46
57
 
47
- // We should not refuel to the contract address
48
- const isToAddressSatisfied = effectiveToAddress && !isToContractAddress
58
+ const isToAddressSatisfied = isFromContractAddress
59
+ ? toAddress && toAddress !== fromAccount?.address && !isToContractAddress
60
+ : true
49
61
 
50
62
  const enabled = useMemo(() => {
51
63
  if (
@@ -16,7 +16,6 @@ export const useIsContractAddress = (
16
16
  enabled: Boolean(chainType === ChainType.EVM && chainId),
17
17
  },
18
18
  })
19
-
20
19
  const isContractAddress = !!contractCode
21
20
  return isContractAddress
22
21
  }
@@ -177,7 +177,6 @@ export const useRoutes = ({ observableRoute }: RoutesProps = {}) => {
177
177
  signal,
178
178
  }) => {
179
179
  const fromAmount = parseUnits(fromTokenAmount, fromToken!.decimals)
180
- const toAmount = parseUnits(toTokenAmount, toToken!.decimals)
181
180
  const formattedSlippage = Number.parseFloat(slippage) / 100
182
181
 
183
182
  const allowBridges = swapOnly
@@ -211,18 +210,17 @@ export const useRoutes = ({ observableRoute }: RoutesProps = {}) => {
211
210
  fromAddress,
212
211
  toAddress,
213
212
  fromAmount,
214
- toAmount,
215
213
  slippage: formattedSlippage,
216
214
  })
217
215
 
218
- if (subvariant === 'custom' && contractCalls && toAmount) {
216
+ if (subvariant === 'custom' && contractCalls && toTokenAmount) {
219
217
  const contractCallQuote = await getContractCallsQuote(
220
218
  {
221
219
  // Contract calls are enabled only when fromAddress is set
222
220
  fromAddress: fromAddress as string,
223
221
  fromChain: fromChainId,
224
222
  fromToken: fromTokenAddress,
225
- toAmount: toAmount.toString(),
223
+ toAmount: toTokenAmount,
226
224
  toChain: toChainId,
227
225
  toToken: toTokenAddress,
228
226
  contractCalls,
@@ -267,8 +265,8 @@ export const useRoutes = ({ observableRoute }: RoutesProps = {}) => {
267
265
  fromAddress: contractCallQuote.action.fromAddress,
268
266
  toChainId: contractCallQuote.action.toChainId,
269
267
  toAmountUSD: contractCallQuote.estimate.toAmountUSD || '',
270
- toAmount: contractCallQuote.estimate.toAmount,
271
- toAmountMin: contractCallQuote.estimate.toAmountMin,
268
+ toAmount: toTokenAmount,
269
+ toAmountMin: toTokenAmount,
272
270
  toToken: toToken!,
273
271
  toAddress:
274
272
  contractCallQuote.action.toAddress ||
package/src/i18n/en.json CHANGED
@@ -52,14 +52,12 @@
52
52
  },
53
53
  "header": {
54
54
  "activeTransactions": "Active transactions",
55
- "amount": "Amount",
56
55
  "bookmarkedWallets": "Bookmarked wallets",
57
56
  "bridge": "Bridge",
58
57
  "checkout": "Checkout",
59
58
  "checkoutDetails": "Checkout details",
60
59
  "deposit": "Deposit",
61
60
  "depositDetails": "Deposit details",
62
- "depositTo": "Deposit to",
63
61
  "exchange": "Exchange",
64
62
  "from": "Exchange from",
65
63
  "gas": "Gas",
@@ -267,15 +265,13 @@
267
265
  "stepBridge": "Bridge",
268
266
  "stepBridgeAndBuy": "Bridge and buy",
269
267
  "stepBridgeAndDeposit": "Bridge and deposit",
270
- "stepBuy": "Buy",
271
- "stepDeposit": "Deposit",
272
268
  "stepDetails": "{{tool}} via LI.FI",
273
269
  "stepSwap": "Swap",
274
270
  "stepSwapAndBridge": "Swap and bridge",
275
271
  "stepSwapAndBuy": "Swap and buy",
276
272
  "stepSwapAndDeposit": "Swap and deposit",
277
- "swapStepDetails": "Swap on {{chain}} via {{tool}}",
278
273
  "transferId": "Transfer ID",
274
+ "swapStepDetails": "Swap on {{chain}} via {{tool}}",
279
275
  "tags": {
280
276
  "cheapest": "Best Return",
281
277
  "fastest": "Fastest"
@@ -2,9 +2,13 @@ import en from './en.json' with { type: 'json' }
2
2
 
3
3
  const defaultResource = { translation: en }
4
4
 
5
- declare module 'i18next' {
6
- interface CustomTypeOptions {
7
- defaultNS: 'translation'
8
- resources: typeof defaultResource
5
+ declare global {
6
+ namespace GeneralTranslation {
7
+ declare module 'i18next' {
8
+ interface CustomTypeOptions {
9
+ defaultNS: 'translation'
10
+ resources: typeof defaultResource
11
+ }
12
+ }
9
13
  }
10
14
  }
package/src/index.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  export type * from '@lifi/sdk'
2
- export { ChainType, ChainId, CoinKey } from '@lifi/sdk'
2
+ export { ChainType, ChainId } from '@lifi/sdk'
3
3
  export { App as LiFiWidget } from './App.js'
4
4
  export type { WidgetDrawer } from './AppDrawer.js'
5
5
  export * from './components/ContractComponent/ItemPrice.js'
@@ -31,23 +31,22 @@ export const MainPage: React.FC = () => {
31
31
  : subvariant === 'refuel'
32
32
  ? t('header.gas')
33
33
  : t('header.exchange')
34
-
35
34
  useHeader(title)
36
35
 
37
- const marginSx = { marginBottom: 2 }
38
-
39
36
  return (
40
37
  <PageContainer>
41
- <ActiveTransactions sx={marginSx} />
38
+ <ActiveTransactions sx={{ marginBottom: 2 }} />
42
39
  {custom ? (
43
- <ContractComponent sx={marginSx}>{contractComponent}</ContractComponent>
40
+ <ContractComponent sx={{ marginBottom: 2 }}>
41
+ {contractComponent}
42
+ </ContractComponent>
44
43
  ) : null}
45
44
  <SelectChainAndToken mb={2} />
46
- {!custom || subvariantOptions?.custom === 'deposit' ? (
47
- <AmountInput formType="from" sx={marginSx} />
45
+ {!custom ? (
46
+ <AmountInput formType="from" sx={{ marginBottom: 2 }} />
48
47
  ) : null}
49
- {!wideVariant ? <Routes sx={marginSx} /> : null}
50
- <SendToWalletButton sx={marginSx} />
48
+ {!wideVariant ? <Routes sx={{ marginBottom: 2 }} /> : null}
49
+ <SendToWalletButton sx={{ marginBottom: 2 }} />
51
50
  <GasRefuelMessage mb={2} />
52
51
  <MainMessages mb={2} />
53
52
  <Box display="flex" mb={showPoweredBy ? 1 : 3} gap={1.5}>
@@ -141,8 +141,7 @@ export interface CalculateFeeParams {
141
141
  toTokenAddress: string
142
142
  fromAddress?: string
143
143
  toAddress?: string
144
- fromAmount?: bigint
145
- toAmount?: bigint
144
+ fromAmount: bigint
146
145
  slippage: number
147
146
  }
148
147
 
@@ -189,6 +188,8 @@ export type WidgetLanguages = {
189
188
  default?: LanguageKey
190
189
  } & AllowDeny<LanguageKey>
191
190
 
191
+ export type PoweredByType = 'default' | 'jumper'
192
+
192
193
  export interface WidgetConfig {
193
194
  fromChain?: number
194
195
  toChain?: number
@@ -240,6 +241,7 @@ export interface WidgetConfig {
240
241
  languageResources?: LanguageResources
241
242
  explorerUrls?: Record<number, string[]> &
242
243
  Partial<Record<'internal', string[]>>
244
+ poweredBy?: PoweredByType
243
245
  }
244
246
 
245
247
  export interface FormFieldOptions {
package/tsconfig.json CHANGED
@@ -7,9 +7,7 @@
7
7
  "outDir": "dist/esm",
8
8
  "rootDir": "./src",
9
9
  "module": "NodeNext",
10
- "moduleResolution": "NodeNext",
11
- "skipLibCheck": true
10
+ "moduleResolution": "NodeNext"
12
11
  },
13
- "include": ["./src/**/*", "./src/**/*.json"],
14
- "references": [{ "path": "../wallet-management" }]
12
+ "include": ["./src/**/*", "./src/**/*.json"]
15
13
  }