@lifi/widget 1.27.2 → 1.28.1

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 (97) hide show
  1. package/AppRoutes.js +15 -33
  2. package/README.md +1 -1
  3. package/cjs/AppRoutes.js +15 -33
  4. package/cjs/components/ContractComponent/ContractComponent.d.ts +3 -0
  5. package/cjs/components/ContractComponent/ContractComponent.js +14 -0
  6. package/cjs/components/ContractComponent/index.d.ts +1 -0
  7. package/cjs/components/ContractComponent/index.js +17 -0
  8. package/cjs/components/Header/NavigationHeader.js +10 -2
  9. package/cjs/components/Header/WalletHeader.js +1 -1
  10. package/cjs/components/NFT/NFT.d.ts +4 -0
  11. package/cjs/components/NFT/NFT.js +41 -0
  12. package/cjs/components/NFT/NFT.style.d.ts +16 -0
  13. package/cjs/components/NFT/NFT.style.js +11 -0
  14. package/cjs/components/NFT/index.d.ts +2 -0
  15. package/cjs/components/NFT/index.js +18 -0
  16. package/cjs/components/NFT/types.d.ts +15 -0
  17. package/cjs/components/NFT/types.js +2 -0
  18. package/cjs/components/Select.d.ts +1 -1
  19. package/cjs/components/SelectChainAndToken.js +12 -2
  20. package/cjs/components/SelectTokenButton/SelectTokenButton.js +5 -2
  21. package/cjs/components/StepActions/StepActions.d.ts +6 -7
  22. package/cjs/components/StepActions/StepActions.js +41 -12
  23. package/cjs/components/StepActions/types.d.ts +5 -0
  24. package/cjs/components/SwapInput/SwapInput.d.ts +2 -1
  25. package/cjs/components/SwapInput/SwapInput.js +15 -3
  26. package/cjs/components/SwapRouteCard/SwapRouteCard.js +3 -1
  27. package/cjs/components/Token/Token.d.ts +1 -1
  28. package/cjs/components/Token/Token.js +12 -12
  29. package/cjs/components/TokenAvatar/TokenAvatar.d.ts +5 -3
  30. package/cjs/components/TokenAvatar/TokenAvatar.js +10 -9
  31. package/cjs/components/TokenList/TokenList.style.js +6 -0
  32. package/cjs/components/TokenList/VirtualizedTokenList.js +4 -2
  33. package/cjs/config/version.d.ts +1 -1
  34. package/cjs/config/version.js +1 -1
  35. package/cjs/hooks/useSwapRoutes.d.ts +5 -2
  36. package/cjs/hooks/useSwapRoutes.js +64 -14
  37. package/cjs/hooks/useToken.d.ts +1 -1
  38. package/cjs/hooks/useTokenSearch.d.ts +1 -1
  39. package/cjs/i18n/en.json +9 -5
  40. package/cjs/index.d.ts +2 -0
  41. package/cjs/index.js +4 -1
  42. package/cjs/pages/MainPage/MainPage.js +5 -1
  43. package/cjs/providers/SwapFormProvider/types.d.ts +10 -0
  44. package/cjs/providers/SwapFormProvider/types.js +5 -0
  45. package/cjs/stores/chains/useChainOrderStore.d.ts +1 -1
  46. package/cjs/stores/routes/useRouteExecutionStore.d.ts +1 -1
  47. package/cjs/stores/settings/useSettingsStore.d.ts +1 -1
  48. package/cjs/types/widget.d.ts +9 -4
  49. package/cjs/types/widget.js +2 -0
  50. package/components/ContractComponent/ContractComponent.d.ts +3 -0
  51. package/components/ContractComponent/ContractComponent.js +10 -0
  52. package/components/ContractComponent/index.d.ts +1 -0
  53. package/components/ContractComponent/index.js +1 -0
  54. package/components/Header/NavigationHeader.js +12 -4
  55. package/components/Header/WalletHeader.js +1 -1
  56. package/components/NFT/NFT.d.ts +4 -0
  57. package/components/NFT/NFT.js +37 -0
  58. package/components/NFT/NFT.style.d.ts +16 -0
  59. package/components/NFT/NFT.style.js +8 -0
  60. package/components/NFT/index.d.ts +2 -0
  61. package/components/NFT/index.js +2 -0
  62. package/components/NFT/types.d.ts +15 -0
  63. package/components/NFT/types.js +1 -0
  64. package/components/Select.d.ts +1 -1
  65. package/components/SelectChainAndToken.js +12 -2
  66. package/components/SelectTokenButton/SelectTokenButton.js +5 -2
  67. package/components/StepActions/StepActions.d.ts +6 -7
  68. package/components/StepActions/StepActions.js +40 -12
  69. package/components/StepActions/types.d.ts +5 -0
  70. package/components/SwapInput/SwapInput.d.ts +2 -1
  71. package/components/SwapInput/SwapInput.js +15 -3
  72. package/components/SwapRouteCard/SwapRouteCard.js +3 -1
  73. package/components/Token/Token.d.ts +1 -1
  74. package/components/Token/Token.js +13 -13
  75. package/components/TokenAvatar/TokenAvatar.d.ts +5 -3
  76. package/components/TokenAvatar/TokenAvatar.js +10 -9
  77. package/components/TokenList/TokenList.style.js +6 -0
  78. package/components/TokenList/VirtualizedTokenList.js +4 -2
  79. package/config/version.d.ts +1 -1
  80. package/config/version.js +1 -1
  81. package/hooks/useSwapRoutes.d.ts +5 -2
  82. package/hooks/useSwapRoutes.js +64 -14
  83. package/hooks/useToken.d.ts +1 -1
  84. package/hooks/useTokenSearch.d.ts +1 -1
  85. package/i18n/en.json +9 -5
  86. package/index.d.ts +2 -0
  87. package/index.js +2 -0
  88. package/package.json +15 -13
  89. package/pages/MainPage/MainPage.js +5 -1
  90. package/providers/SwapFormProvider/types.d.ts +10 -0
  91. package/providers/SwapFormProvider/types.js +5 -0
  92. package/stores/chains/useChainOrderStore.d.ts +1 -1
  93. package/stores/routes/useRouteExecutionStore.d.ts +1 -1
  94. package/stores/settings/useSettingsStore.d.ts +1 -1
  95. package/tsconfig.cjs.tsbuildinfo +1 -1
  96. package/types/widget.d.ts +9 -4
  97. package/types/widget.js +2 -0
@@ -0,0 +1,4 @@
1
+ /// <reference types="react" />
2
+ import type { BoxProps } from '@mui/material';
3
+ import type { NFTProps } from './types';
4
+ export declare const NFT: React.FC<BoxProps & NFTProps>;
@@ -0,0 +1,37 @@
1
+ var __rest = (this && this.__rest) || function (s, e) {
2
+ var t = {};
3
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
4
+ t[p] = s[p];
5
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
6
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
7
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
8
+ t[p[i]] = s[p[i]];
9
+ }
10
+ return t;
11
+ };
12
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
13
+ import { Box, Link, Skeleton, Typography } from '@mui/material';
14
+ import { useEffect } from 'react';
15
+ import { useFormContext } from 'react-hook-form';
16
+ import { useTranslation } from 'react-i18next';
17
+ import { SwapFormKey } from '../../providers';
18
+ import { Token } from '../Token';
19
+ import { PreviewAvatar } from './NFT.style';
20
+ export const NFT = (_a) => {
21
+ var { imageUrl, isLoading, collectonName, assetName, owner, token, contract } = _a, props = __rest(_a, ["imageUrl", "isLoading", "collectonName", "assetName", "owner", "token", "contract"]);
22
+ const { t } = useTranslation();
23
+ const { setValue } = useFormContext();
24
+ useEffect(() => {
25
+ if (token) {
26
+ setValue(SwapFormKey.ToChain, token.chainId);
27
+ setValue(SwapFormKey.ToToken, token.address);
28
+ setValue(SwapFormKey.ToAmount, token.amount);
29
+ }
30
+ if (contract) {
31
+ setValue(SwapFormKey.ToContractAddress, contract.address);
32
+ setValue(SwapFormKey.ToContractCallData, contract.callData);
33
+ setValue(SwapFormKey.ToContractGasLimit, contract.gasLimit);
34
+ }
35
+ }, [contract, setValue, token]);
36
+ return (_jsxs(Box, Object.assign({ p: 2 }, { children: [_jsxs(Box, Object.assign({ display: "flex" }, { children: [isLoading ? (_jsx(Skeleton, { width: 96, height: 96, variant: "rectangular", sx: { borderRadius: 1 } })) : (_jsx(PreviewAvatar, { src: imageUrl })), _jsxs(Box, Object.assign({ ml: 2 }, { children: [isLoading ? (_jsx(Skeleton, { width: 144, height: 21, variant: "text" })) : (_jsx(Typography, Object.assign({ fontSize: 14, color: "text.secondary" }, { children: collectonName }))), isLoading ? (_jsx(Skeleton, { width: 112, height: 27, variant: "text" })) : (_jsx(Typography, Object.assign({ fontSize: 18, fontWeight: 600 }, { children: assetName }))), isLoading ? (_jsx(Skeleton, { width: 128, height: 21, variant: "text" })) : owner ? (_jsxs(Typography, Object.assign({ fontSize: 14, color: "text.secondary" }, { children: [t('swap.ownedBy'), ' ', _jsx(Link, Object.assign({ href: owner.url, target: "_blank", underline: "none", color: "primary" }, { children: owner.name }))] }))) : null] }))] })), _jsx(Token, { token: token, isLoading: isLoading, mt: 2 })] })));
37
+ };
@@ -0,0 +1,16 @@
1
+ /// <reference types="react" />
2
+ export declare const PreviewAvatar: import("@emotion/styled").StyledComponent<{
3
+ alt?: string | undefined;
4
+ children?: import("react").ReactNode;
5
+ classes?: Partial<import("@mui/material").AvatarClasses> | undefined;
6
+ imgProps?: (import("react").ImgHTMLAttributes<HTMLImageElement> & {
7
+ sx?: import("@mui/material").SxProps<import("@mui/material").Theme> | undefined;
8
+ }) | undefined;
9
+ sizes?: string | undefined;
10
+ src?: string | undefined;
11
+ srcSet?: string | undefined;
12
+ sx?: import("@mui/material").SxProps<import("@mui/material").Theme> | undefined;
13
+ variant?: "square" | "circular" | "rounded" | undefined;
14
+ } & import("@mui/material/OverridableComponent").CommonProps & Omit<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof import("react").HTMLAttributes<HTMLDivElement>> & {
15
+ ref?: import("react").RefObject<HTMLDivElement> | ((instance: HTMLDivElement | null) => void) | null | undefined;
16
+ }, keyof import("@mui/material/OverridableComponent").CommonProps | "children" | "sx" | "variant" | "alt" | "imgProps" | "sizes" | "src" | "srcSet"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
@@ -0,0 +1,8 @@
1
+ import { Avatar } from '@mui/material';
2
+ import { styled } from '@mui/material/styles';
3
+ export const PreviewAvatar = styled(Avatar)(({ theme }) => ({
4
+ background: theme.palette.background.paper,
5
+ width: 96,
6
+ height: 96,
7
+ borderRadius: theme.shape.borderRadius,
8
+ }));
@@ -0,0 +1,2 @@
1
+ export * from './NFT';
2
+ export * from './types';
@@ -0,0 +1,2 @@
1
+ export * from './NFT';
2
+ export * from './types';
@@ -0,0 +1,15 @@
1
+ import type { TokenAmount } from '@lifi/sdk';
2
+ import type { WidgetContract } from '../../types';
3
+ export interface NFTProps {
4
+ imageUrl?: string;
5
+ collectonName?: string;
6
+ assetName?: string;
7
+ isLoading?: boolean;
8
+ owner?: NFTOwner;
9
+ token?: TokenAmount;
10
+ contract?: WidgetContract;
11
+ }
12
+ export interface NFTOwner {
13
+ name?: string;
14
+ url?: string;
15
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -1,3 +1,3 @@
1
- export declare const Select: import("@emotion/styled").StyledComponent<import("@mui/material").SelectProps<unknown> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme> & {
1
+ export declare const Select: import("@emotion/styled").StyledComponent<(import("@mui/material").SelectProps<unknown> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>) & {
2
2
  dense?: boolean | undefined;
3
3
  }, {}, {}>;
@@ -19,6 +19,16 @@ export const SelectChainAndToken = (props) => {
19
19
  const disabledReverse = variant === 'refuel' ||
20
20
  (disabledUI === null || disabledUI === void 0 ? void 0 : disabledUI.includes(DisabledUI.FromToken)) ||
21
21
  (disabledUI === null || disabledUI === void 0 ? void 0 : disabledUI.includes(DisabledUI.ToToken));
22
- const isCompact = fromChain && toChain && fromToken && toToken && !prefersNarrowView;
23
- return (_jsxs(Box, Object.assign({ sx: { display: 'flex', flexDirection: isCompact ? 'row' : 'column' } }, props, { children: [_jsx(SelectTokenButton, { formType: "from", compact: isCompact }), _jsx(Box, Object.assign({ sx: { display: 'flex', justifyContent: 'center', alignItems: 'center' }, m: !disabledReverse ? -1.125 : 1 }, { children: !disabledReverse ? (_jsx(ReverseTokensButton, { vertical: !isCompact })) : null })), _jsx(SelectTokenButton, { formType: "to", compact: isCompact })] })));
22
+ const nftVariant = variant === 'nft';
23
+ const isCompact = fromChain &&
24
+ toChain &&
25
+ fromToken &&
26
+ toToken &&
27
+ !prefersNarrowView &&
28
+ !nftVariant;
29
+ return (_jsxs(Box, Object.assign({ sx: { display: 'flex', flexDirection: isCompact ? 'row' : 'column' } }, props, { children: [_jsx(SelectTokenButton, { formType: "from", compact: isCompact }), !nftVariant ? (_jsx(Box, Object.assign({ sx: {
30
+ display: 'flex',
31
+ justifyContent: 'center',
32
+ alignItems: 'center',
33
+ }, m: !disabledReverse ? -1.125 : 1 }, { children: !disabledReverse ? (_jsx(ReverseTokensButton, { vertical: !isCompact })) : null }))) : null, !nftVariant ? (_jsx(SelectTokenButton, { formType: "to", compact: isCompact })) : null] })));
24
34
  };
@@ -28,8 +28,11 @@ export const SelectTokenButton = ({ formType, compact }) => {
28
28
  };
29
29
  const isSelected = !!(chain && token);
30
30
  const onClick = !(disabledUI === null || disabledUI === void 0 ? void 0 : disabledUI.includes(tokenKey)) ? handleClick : undefined;
31
- const defaultTitle = formType === 'to' && variant === 'refuel'
31
+ const defaultPlaceholder = formType === 'to' && variant === 'refuel'
32
32
  ? t(`header.selectChain`)
33
33
  : t(`swap.selectChainAndToken`);
34
- return (_jsxs(Card, Object.assign({ flex: 1, onClick: onClick }, { children: [_jsx(CardTitle, { children: t(`swap.${formType}`) }), chainId && tokenAddress && (isChainLoading || isTokenLoading) ? (_jsx(SelectTokenCardHeader, { avatar: _jsx(Skeleton, { variant: "circular", width: 32, height: 32 }), title: _jsx(Skeleton, { variant: "text", width: 64, height: 24 }), subheader: _jsx(Skeleton, { variant: "text", width: 64, height: 16 }), compact: compact })) : (_jsx(SelectTokenCardHeader, { avatar: isSelected ? (_jsx(TokenAvatar, { token: token, chain: chain })) : (_jsx(TokenAvatarDefault, {})), title: isSelected ? token.symbol : defaultTitle, subheader: isSelected ? t(`swap.onChain`, { chainName: chain.name }) : null, selected: isSelected, compact: compact }))] })));
34
+ const cardTitle = formType === 'from' && variant === 'nft'
35
+ ? t(`swap.payWith`)
36
+ : t(`swap.${formType}`);
37
+ return (_jsxs(Card, Object.assign({ flex: 1, onClick: onClick }, { children: [_jsx(CardTitle, { children: cardTitle }), chainId && tokenAddress && (isChainLoading || isTokenLoading) ? (_jsx(SelectTokenCardHeader, { avatar: _jsx(Skeleton, { variant: "circular", width: 32, height: 32 }), title: _jsx(Skeleton, { variant: "text", width: 64, height: 24 }), subheader: _jsx(Skeleton, { variant: "text", width: 64, height: 16 }), compact: compact })) : (_jsx(SelectTokenCardHeader, { avatar: isSelected ? (_jsx(TokenAvatar, { token: token, chain: chain })) : (_jsx(TokenAvatarDefault, {})), title: isSelected ? token.symbol : defaultPlaceholder, subheader: isSelected ? t(`swap.onChain`, { chainName: chain.name }) : null, selected: isSelected, compact: compact }))] })));
35
38
  };
@@ -1,13 +1,12 @@
1
1
  /// <reference types="react" />
2
2
  import type { Step } from '@lifi/sdk';
3
- import type { StepActionsProps } from './types';
3
+ import type { WidgetVariant } from '../../types';
4
+ import type { StepActionsProps, StepDetailsLabelProps } from './types';
4
5
  export declare const StepActions: React.FC<StepActionsProps>;
5
6
  export declare const StepDetailsContent: React.FC<{
6
7
  step: Step;
8
+ variant?: WidgetVariant;
7
9
  }>;
8
- export declare const CrossStepDetailsLabel: React.FC<{
9
- step: Step;
10
- }>;
11
- export declare const SwapStepDetailsLabel: React.FC<{
12
- step: Step;
13
- }>;
10
+ export declare const CustomStepDetailsLabel: React.FC<StepDetailsLabelProps>;
11
+ export declare const CrossStepDetailsLabel: React.FC<Omit<StepDetailsLabelProps, 'variant'>>;
12
+ export declare const SwapStepDetailsLabel: React.FC<Omit<StepDetailsLabelProps, 'variant'>>;
@@ -9,24 +9,42 @@ var __rest = (this && this.__rest) || function (s, e) {
9
9
  }
10
10
  return t;
11
11
  };
12
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
12
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
13
13
  import { ArrowForward as ArrowForwardIcon } from '@mui/icons-material';
14
14
  import { Box, Step as MuiStep, Stepper, Typography } from '@mui/material';
15
15
  import { useTranslation } from 'react-i18next';
16
16
  import { useChains } from '../../hooks';
17
17
  import { LiFiToolLogo } from '../../icons';
18
+ import { useWidgetConfig } from '../../providers';
18
19
  import { formatTokenAmount } from '../../utils';
19
20
  import { SmallAvatar } from '../SmallAvatar';
20
21
  import { StepAvatar, StepConnector, StepContent, StepLabel, } from './StepActions.style';
21
22
  export const StepActions = (_a) => {
22
- var _b;
23
+ var _b, _c;
23
24
  var { step, dense } = _a, other = __rest(_a, ["step", "dense"]);
24
- const StepDetailsLabel = step.type === 'cross' ||
25
- (step.type === 'lifi' &&
26
- step.includedSteps.some((step) => step.type === 'cross'))
27
- ? CrossStepDetailsLabel
28
- : SwapStepDetailsLabel;
25
+ const { variant, contractTool } = useWidgetConfig();
26
+ const StepDetailsLabel = step.tool === 'custom' && variant === 'nft'
27
+ ? CustomStepDetailsLabel
28
+ : step.type === 'cross' ||
29
+ (step.type === 'lifi' &&
30
+ step.includedSteps.some((step) => step.type === 'cross'))
31
+ ? CrossStepDetailsLabel
32
+ : SwapStepDetailsLabel;
29
33
  const isFullView = !dense && ((_b = step.includedSteps) === null || _b === void 0 ? void 0 : _b.length) > 1;
34
+ const customStep = variant === 'nft'
35
+ ? (_c = step.includedSteps) === null || _c === void 0 ? void 0 : _c.find((step) => step.type === 'custom')
36
+ : undefined;
37
+ if (customStep && contractTool) {
38
+ const toolDetails = {
39
+ key: contractTool.name,
40
+ name: contractTool.name,
41
+ logoURI: contractTool.logoURI,
42
+ };
43
+ customStep.toolDetails = toolDetails;
44
+ if (!isFullView) {
45
+ step.toolDetails = toolDetails;
46
+ }
47
+ }
30
48
  // eslint-disable-next-line react/no-unstable-nested-components
31
49
  const StepIconComponent = ({ icon }) => {
32
50
  var _a;
@@ -37,16 +55,26 @@ export const StepActions = (_a) => {
37
55
  };
38
56
  return (_jsxs(Box, Object.assign({}, other, { children: [_jsxs(Box, Object.assign({ sx: { display: 'flex', alignItems: 'center' }, mb: isFullView ? 1.5 : 0 }, { children: [_jsx(StepAvatar, Object.assign({ variant: "circular", src: step.type !== 'lifi' ? step.toolDetails.logoURI : undefined, alt: step.toolDetails.name }, { children: step.type === 'lifi' ? _jsx(LiFiToolLogo, {}) : step.toolDetails.name[0] })), _jsx(Typography, Object.assign({ ml: 2, fontSize: 18, fontWeight: "500", textTransform: "capitalize" }, { children: step.type === 'lifi'
39
57
  ? 'LI.FI Smart Contract'
40
- : step.toolDetails.name }))] })), isFullView ? (_jsx(Stepper, Object.assign({ orientation: "vertical", connector: _jsx(StepConnector, {}), activeStep: -1 }, { children: step.includedSteps.map((step) => (_jsxs(MuiStep, Object.assign({ expanded: true }, { children: [_jsx(StepLabel, Object.assign({ StepIconComponent: StepIconComponent }, { children: step.type === 'cross' || step.type === 'lifi' ? (_jsx(CrossStepDetailsLabel, { step: step })) : (_jsx(SwapStepDetailsLabel, { step: step })) })), _jsx(StepContent, { children: _jsx(StepDetailsContent, { step: step }) })] }), step.id))) }))) : (_jsxs(Box, Object.assign({ ml: 6 }, { children: [_jsx(StepDetailsLabel, { step: step }), _jsx(StepDetailsContent, { step: step })] })))] })));
58
+ : step.toolDetails.name }))] })), isFullView ? (_jsx(Stepper, Object.assign({ orientation: "vertical", connector: _jsx(StepConnector, {}), activeStep: -1 }, { children: step.includedSteps.map((step, i) => (_jsxs(MuiStep, Object.assign({ expanded: true }, { children: [_jsx(StepLabel, Object.assign({ StepIconComponent: StepIconComponent }, { children: step.type === 'custom' && variant === 'nft' ? (_jsx(CustomStepDetailsLabel, { step: step, variant: variant })) : step.type === 'cross' || step.type === 'lifi' ? (_jsx(CrossStepDetailsLabel, { step: step })) : (_jsx(SwapStepDetailsLabel, { step: step })) })), _jsx(StepContent, { children: _jsx(StepDetailsContent, { step: step, variant: variant }) })] }), step.id))) }))) : (_jsxs(Box, Object.assign({ ml: 6 }, { children: [_jsx(StepDetailsLabel, { step: step, variant: variant === 'nft' ? variant : undefined }), _jsx(StepDetailsContent, { step: step, variant: variant })] })))] })));
41
59
  };
42
- export const StepDetailsContent = ({ step }) => {
60
+ export const StepDetailsContent = ({ step, variant }) => {
43
61
  var _a, _b, _c, _d, _e, _f, _g, _h;
44
62
  const { t } = useTranslation();
45
63
  return (_jsxs(Typography, Object.assign({ fontSize: 12, fontWeight: "500", color: "text.secondary", alignItems: "center", display: "flex" }, { children: [t('format.number', {
46
64
  value: formatTokenAmount(step.estimate.fromAmount, step.action.fromToken.decimals),
47
- }), ' ', step.action.fromToken.symbol, _jsx(ArrowForwardIcon, { sx: { fontSize: 18, paddingX: 0.5 } }), t('format.number', {
48
- value: formatTokenAmount((_b = (_a = step.execution) === null || _a === void 0 ? void 0 : _a.toAmount) !== null && _b !== void 0 ? _b : step.estimate.toAmount, (_e = (_d = (_c = step.execution) === null || _c === void 0 ? void 0 : _c.toToken) === null || _d === void 0 ? void 0 : _d.decimals) !== null && _e !== void 0 ? _e : step.action.toToken.decimals),
49
- }), ' ', (_h = (_g = (_f = step.execution) === null || _f === void 0 ? void 0 : _f.toToken) === null || _g === void 0 ? void 0 : _g.symbol) !== null && _h !== void 0 ? _h : step.action.toToken.symbol] })));
65
+ }), ' ', step.action.fromToken.symbol, !((step.type === 'custom' || step.tool === 'custom') &&
66
+ variant === 'nft') ? (_jsxs(_Fragment, { children: [_jsx(ArrowForwardIcon, { sx: { fontSize: 18, paddingX: 0.5 } }), t('format.number', {
67
+ value: formatTokenAmount((_b = (_a = step.execution) === null || _a === void 0 ? void 0 : _a.toAmount) !== null && _b !== void 0 ? _b : step.estimate.toAmount, (_e = (_d = (_c = step.execution) === null || _c === void 0 ? void 0 : _c.toToken) === null || _d === void 0 ? void 0 : _d.decimals) !== null && _e !== void 0 ? _e : step.action.toToken.decimals),
68
+ }), ' ', (_h = (_g = (_f = step.execution) === null || _f === void 0 ? void 0 : _f.toToken) === null || _g === void 0 ? void 0 : _g.symbol) !== null && _h !== void 0 ? _h : step.action.toToken.symbol] })) : null] })));
69
+ };
70
+ export const CustomStepDetailsLabel = ({ step, variant, }) => {
71
+ const { t } = useTranslation();
72
+ if (!variant) {
73
+ return null;
74
+ }
75
+ return (_jsx(Typography, Object.assign({ fontSize: 12, fontWeight: "500", color: "text.secondary" }, { children: t(`swap.${variant}StepDetails`, {
76
+ tool: step.toolDetails.name,
77
+ }) })));
50
78
  };
51
79
  export const CrossStepDetailsLabel = ({ step }) => {
52
80
  var _a, _b;
@@ -1,6 +1,11 @@
1
1
  import type { Step } from '@lifi/sdk';
2
2
  import type { BoxProps } from '@mui/material';
3
+ import type { WidgetVariant } from '../../types';
3
4
  export interface StepActionsProps extends BoxProps {
4
5
  step: Step;
5
6
  dense?: boolean;
6
7
  }
8
+ export interface StepDetailsLabelProps {
9
+ step: Step;
10
+ variant?: Extract<WidgetVariant, 'nft'>;
11
+ }
@@ -1,3 +1,4 @@
1
1
  /// <reference types="react" />
2
+ import type { BoxProps } from '@mui/material';
2
3
  import type { SwapFormTypeProps } from '../../providers';
3
- export declare const SwapInput: React.FC<SwapFormTypeProps>;
4
+ export declare const SwapInput: React.FC<SwapFormTypeProps & BoxProps>;
@@ -1,3 +1,14 @@
1
+ var __rest = (this && this.__rest) || function (s, e) {
2
+ var t = {};
3
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
4
+ t[p] = s[p];
5
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
6
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
7
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
8
+ t[p[i]] = s[p[i]];
9
+ }
10
+ return t;
11
+ };
1
12
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
13
  import { useRef } from 'react';
3
14
  import { useController } from 'react-hook-form';
@@ -11,7 +22,8 @@ import { FormPriceHelperText } from './FormPriceHelperText';
11
22
  import { FormControl, Input } from './SwapInput.style';
12
23
  import { SwapInputEndAdornment } from './SwapInputEndAdornment';
13
24
  import { SwapInputStartAdornment } from './SwapInputStartAdornment';
14
- export const SwapInput = ({ formType }) => {
25
+ export const SwapInput = (_a) => {
26
+ var { formType } = _a, props = __rest(_a, ["formType"]);
15
27
  const { t } = useTranslation();
16
28
  const amountKey = SwapFormKeyHelper.getAmountKey(formType);
17
29
  const { field: { onChange, onBlur, value }, } = useController({
@@ -31,7 +43,7 @@ export const SwapInput = ({ formType }) => {
31
43
  onBlur();
32
44
  };
33
45
  const disabled = disabledUI === null || disabledUI === void 0 ? void 0 : disabledUI.includes(DisabledUI.FromAmount);
34
- return (_jsxs(Card, { children: [_jsx(CardTitle, { children: t('swap.fromAmount') }), _jsxs(FormControl, Object.assign({ fullWidth: true }, { children: [_jsx(Input, { inputRef: ref, size: "small", autoComplete: "off", placeholder: "0", startAdornment: _jsx(SwapInputStartAdornment, { formType: formType }), endAdornment: !disabled ? (_jsx(SwapInputEndAdornment, { formType: formType })) : undefined, inputProps: {
46
+ return (_jsxs(Card, Object.assign({}, props, { children: [_jsx(CardTitle, { children: t('swap.fromAmount') }), _jsxs(FormControl, Object.assign({ fullWidth: true }, { children: [_jsx(Input, { inputRef: ref, size: "small", autoComplete: "off", placeholder: "0", startAdornment: _jsx(SwapInputStartAdornment, { formType: formType }), endAdornment: !disabled ? (_jsx(SwapInputEndAdornment, { formType: formType })) : undefined, inputProps: {
35
47
  inputMode: 'decimal',
36
- }, onChange: handleChange, onBlur: handleBlur, value: value, name: amountKey, disabled: disabled, required: true }), _jsx(FormPriceHelperText, { formType: formType })] })), _jsx(FitInputText, { ref: ref, formType: formType })] }));
48
+ }, onChange: handleChange, onBlur: handleBlur, value: value, name: amountKey, disabled: disabled, required: true }), _jsx(FormPriceHelperText, { formType: formType })] })), _jsx(FitInputText, { ref: ref, formType: formType })] })));
37
49
  };
@@ -34,7 +34,9 @@ export const SwapRouteCard = (_a) => {
34
34
  e.stopPropagation();
35
35
  setCardExpanded((expanded) => !expanded);
36
36
  };
37
- const cardContent = (_jsxs(Box, Object.assign({ flex: 1 }, { children: [widgetVariant !== 'refuel' && !useRecommendedRoute ? (_jsxs(Box, Object.assign({ display: "flex", justifyContent: "space-between", alignItems: "center", mb: 2 }, { children: [_jsx(Label, Object.assign({ active: active !== null && active !== void 0 ? active : label !== alternativeTag }, { children: label })), variant === 'stretched' ? (_jsx(SwapRouteCardEssentials, { route: route })) : null] }))) : null, _jsxs(Box, Object.assign({ display: "flex", justifyContent: "space-between", alignItems: "center" }, { children: [_jsx(Token, { token: Object.assign(Object.assign({}, route.toToken), { amount: route.toAmount }), step: variant === 'stretched' ? route.steps[0] : undefined, disableDescription: variant === 'dense' && widgetVariant !== 'refuel' }), variant === 'stretched' && !expanded ? (_jsx(IconButton, Object.assign({ onClick: handleExpand, size: "small" }, { children: cardExpanded ? _jsx(ExpandLessIcon, {}) : _jsx(ExpandMoreIcon, {}) }))) : null] })), _jsx(Collapse, Object.assign({ timeout: 225, in: cardExpanded, mountOnEnter: true, unmountOnExit: true }, { children: route.steps.map((step) => (_jsx(StepActions, { step: step, mt: 2 }, step.id))) })), variant !== 'stretched' ? (_jsx(SwapRouteCardEssentials, { route: route, dense: true })) : null] })));
37
+ const token = widgetVariant === 'nft'
38
+ ? Object.assign(Object.assign({}, route.fromToken), { amount: route.fromAmount }) : Object.assign(Object.assign({}, route.toToken), { amount: route.toAmount });
39
+ const cardContent = (_jsxs(Box, Object.assign({ flex: 1 }, { children: [widgetVariant !== 'refuel' && !useRecommendedRoute ? (_jsxs(Box, Object.assign({ display: "flex", justifyContent: "space-between", alignItems: "center", mb: 2 }, { children: [_jsx(Label, Object.assign({ active: active !== null && active !== void 0 ? active : label !== alternativeTag }, { children: label })), variant === 'stretched' ? (_jsx(SwapRouteCardEssentials, { route: route })) : null] }))) : null, _jsxs(Box, Object.assign({ display: "flex", justifyContent: "space-between", alignItems: "center" }, { children: [_jsx(Token, { token: token, step: variant === 'stretched' ? route.steps[0] : undefined, disableDescription: variant === 'dense' && widgetVariant !== 'refuel' }), variant === 'stretched' && !expanded ? (_jsx(IconButton, Object.assign({ onClick: handleExpand, size: "small" }, { children: cardExpanded ? _jsx(ExpandLessIcon, {}) : _jsx(ExpandMoreIcon, {}) }))) : null] })), _jsx(Collapse, Object.assign({ timeout: 225, in: cardExpanded, mountOnEnter: true, unmountOnExit: true }, { children: route.steps.map((step) => (_jsx(StepActions, { step: step, mt: 2 }, step.id))) })), variant !== 'stretched' ? (_jsx(SwapRouteCardEssentials, { route: route, dense: true })) : null] })));
38
40
  return widgetVariant === 'refuel' ? (cardContent) : (_jsx(Card, Object.assign({ dense: variant === 'dense', variant: active ? 'selected' : 'default', selectionColor: "secondary", indented: true }, other, { children: cardContent })));
39
41
  };
40
42
  export const SwapRouteCardEssentials = ({ route, dense }) => {
@@ -2,7 +2,7 @@
2
2
  import type { Step, TokenAmount } from '@lifi/sdk';
3
3
  import type { BoxProps } from '@mui/material';
4
4
  interface TokenProps {
5
- token: TokenAmount;
5
+ token?: TokenAmount;
6
6
  connected?: boolean;
7
7
  step?: Step;
8
8
  disableDescription?: boolean;
@@ -10,7 +10,7 @@ var __rest = (this && this.__rest) || function (s, e) {
10
10
  return t;
11
11
  };
12
12
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
13
- import { Box } from '@mui/material';
13
+ import { Box, Skeleton } from '@mui/material';
14
14
  import { useTranslation } from 'react-i18next';
15
15
  import { useChain, useToken } from '../../hooks';
16
16
  import { formatTokenAmount, formatTokenPrice } from '../../utils';
@@ -20,32 +20,32 @@ import { TokenAvatar } from '../TokenAvatar';
20
20
  import { TextSecondary, TextSecondaryContainer } from './Token.style';
21
21
  export const Token = (_a) => {
22
22
  var { token } = _a, other = __rest(_a, ["token"]);
23
- if (!token.priceUSD || !token.logoURI) {
23
+ if (!(token === null || token === void 0 ? void 0 : token.priceUSD) || !token.logoURI) {
24
24
  return _jsx(TokenFallback, Object.assign({ token: token }, other));
25
25
  }
26
26
  return _jsx(TokenBase, Object.assign({ token: token }, other));
27
27
  };
28
28
  export const TokenFallback = (_a) => {
29
- var { token, connected, step, disableDescription } = _a, other = __rest(_a, ["token", "connected", "step", "disableDescription"]);
30
- const { token: chainToken, isLoading } = useToken(token.chainId, token.address);
31
- return (_jsx(TokenBase, Object.assign({ token: Object.assign(Object.assign({}, token), chainToken), isLoading: isLoading }, other)));
29
+ var { token, connected, step, disableDescription, isLoading } = _a, other = __rest(_a, ["token", "connected", "step", "disableDescription", "isLoading"]);
30
+ const { token: chainToken, isLoading: isLoadingToken } = useToken(token === null || token === void 0 ? void 0 : token.chainId, token === null || token === void 0 ? void 0 : token.address);
31
+ return (_jsx(TokenBase, Object.assign({ token: Object.assign(Object.assign({}, token), chainToken), isLoading: isLoading || isLoadingToken }, other)));
32
32
  };
33
33
  export const TokenBase = (_a) => {
34
34
  var { token, connected, step, disableDescription, isLoading } = _a, other = __rest(_a, ["token", "connected", "step", "disableDescription", "isLoading"]);
35
35
  const { t } = useTranslation();
36
- const { chain } = useChain(token.chainId);
37
- const formattedTokenAmount = formatTokenAmount(token.amount, token.decimals);
38
- const formattedTokenPrice = formatTokenPrice(formattedTokenAmount, token.priceUSD);
39
- return (_jsxs(Box, Object.assign({ flex: 1 }, other, { children: [_jsxs(Box, Object.assign({ display: "flex", flex: 1, alignItems: "center" }, { children: [_jsx(TokenAvatar, { token: token, chain: chain, sx: { marginRight: 2 } }), _jsx(TextFitter, Object.assign({ height: 30, textStyle: {
36
+ const { chain } = useChain(token === null || token === void 0 ? void 0 : token.chainId);
37
+ const formattedTokenAmount = formatTokenAmount(token === null || token === void 0 ? void 0 : token.amount, token === null || token === void 0 ? void 0 : token.decimals);
38
+ const formattedTokenPrice = formatTokenPrice(formattedTokenAmount, token === null || token === void 0 ? void 0 : token.priceUSD);
39
+ return (_jsxs(Box, Object.assign({ flex: 1 }, other, { children: [_jsxs(Box, Object.assign({ display: "flex", flex: 1, alignItems: "center" }, { children: [_jsx(TokenAvatar, { token: token, chain: chain, isLoading: isLoading, sx: { marginRight: 2 } }), isLoading ? (_jsx(Skeleton, { width: 112, height: 32, variant: "text" })) : (_jsx(TextFitter, Object.assign({ height: 30, textStyle: {
40
40
  fontWeight: 700,
41
41
  } }, { children: t('format.number', {
42
42
  value: formattedTokenAmount,
43
- }) }))] })), _jsxs(TextSecondaryContainer, Object.assign({ connected: connected, component: "span" }, { children: [_jsx(TextSecondary, Object.assign({ connected: connected }, { children: t(`format.currency`, {
43
+ }) })))] })), _jsxs(TextSecondaryContainer, Object.assign({ connected: connected, component: "span" }, { children: [isLoading ? (_jsx(Skeleton, { width: 48, height: 12, variant: "rounded", sx: { marginTop: 0.5 } })) : (_jsx(TextSecondary, Object.assign({ connected: connected }, { children: t(`format.currency`, {
44
44
  value: formattedTokenPrice,
45
- }) })), !disableDescription ? (_jsx(TextSecondary, Object.assign({ connected: connected, px: 0.5, dot: true }, { children: "\u2022" }))) : null, !step && !disableDescription ? (_jsx(TextSecondary, Object.assign({ connected: connected }, { children: t(`swap.tokenOnChain`, {
46
- tokenSymbol: token.symbol,
45
+ }) }))), !disableDescription ? (_jsx(TextSecondary, Object.assign({ connected: connected, px: 0.5, dot: true }, { children: "\u2022" }))) : null, !step && !disableDescription ? (isLoading ? (_jsx(Skeleton, { width: 96, height: 12, variant: "rounded", sx: { marginTop: 0.5 } })) : (_jsx(TextSecondary, Object.assign({ connected: connected }, { children: t(`swap.tokenOnChain`, {
46
+ tokenSymbol: token === null || token === void 0 ? void 0 : token.symbol,
47
47
  chainName: chain === null || chain === void 0 ? void 0 : chain.name,
48
- }) }))) : null, step ? (_jsxs(Box, Object.assign({ display: "flex", alignItems: "flex-end", height: 12, mt: 0.5 }, { children: [_jsx(Box, Object.assign({ pr: 0.75 }, { children: _jsx(SmallAvatar, Object.assign({ src: step.toolDetails.logoURI, alt: step.toolDetails.name, sx: {
48
+ }) })))) : null, step ? (_jsxs(Box, Object.assign({ display: "flex", alignItems: "flex-end", height: 12, mt: 0.5 }, { children: [_jsx(Box, Object.assign({ pr: 0.75 }, { children: _jsx(SmallAvatar, Object.assign({ src: step.toolDetails.logoURI, alt: step.toolDetails.name, sx: {
49
49
  border: 0,
50
50
  marginBottom: -0.25,
51
51
  } }, { children: step.toolDetails.name[0] })) })), _jsx(TextSecondary, Object.assign({ connected: true }, { children: step.toolDetails.name }))] }))) : null] }))] })));
@@ -2,18 +2,20 @@
2
2
  import type { Chain, Token } from '@lifi/sdk';
3
3
  import type { SxProps, Theme } from '@mui/material';
4
4
  export declare const TokenAvatarFallback: React.FC<{
5
- token: Token;
5
+ token?: Token;
6
+ isLoading?: boolean;
6
7
  sx?: SxProps<Theme>;
7
8
  }>;
8
9
  export declare const TokenAvatarBase: React.FC<{
9
- token: Token;
10
+ token?: Token;
10
11
  chain?: Chain;
11
12
  isLoading?: boolean;
12
13
  sx?: SxProps<Theme>;
13
14
  }>;
14
15
  export declare const TokenAvatar: React.FC<{
15
- token: Token;
16
+ token?: Token;
16
17
  chain?: Chain;
18
+ isLoading?: boolean;
17
19
  sx?: SxProps<Theme>;
18
20
  }>;
19
21
  export declare const TokenAvatarDefault: React.FC<{
@@ -3,19 +3,20 @@ import { Avatar, Badge, Skeleton } from '@mui/material';
3
3
  import { useChain, useToken } from '../../hooks';
4
4
  import { SmallAvatar, SmallAvatarSkeleton } from '../SmallAvatar';
5
5
  import { AvatarDefault, AvatarDefaultContainer } from './TokenAvatar.style';
6
- export const TokenAvatarFallback = ({ token, sx }) => {
7
- const { chain } = useChain(token.chainId);
8
- const { token: chainToken, isLoading } = useToken(token.chainId, token.address);
9
- return (_jsx(TokenAvatarBase, { token: chainToken !== null && chainToken !== void 0 ? chainToken : token, isLoading: isLoading, chain: chain, sx: sx }));
6
+ export const TokenAvatarFallback = ({ token, isLoading, sx }) => {
7
+ const { chain } = useChain(token === null || token === void 0 ? void 0 : token.chainId);
8
+ const { token: chainToken, isLoading: isLoadingToken } = useToken(token === null || token === void 0 ? void 0 : token.chainId, token === null || token === void 0 ? void 0 : token.address);
9
+ return (_jsx(TokenAvatarBase, { token: chainToken !== null && chainToken !== void 0 ? chainToken : token, isLoading: isLoading || isLoadingToken, chain: chain, sx: sx }));
10
10
  };
11
11
  export const TokenAvatarBase = ({ token, chain, isLoading, sx }) => {
12
- return (_jsx(Badge, Object.assign({ overlap: "circular", anchorOrigin: { vertical: 'bottom', horizontal: 'right' }, badgeContent: chain ? (_jsx(SmallAvatar, Object.assign({ src: chain.logoURI, alt: chain.name }, { children: chain.name[0] }))) : (_jsx(SmallAvatarSkeleton, {})), sx: sx }, { children: isLoading ? (_jsx(Skeleton, { width: 32, height: 32, variant: "circular" })) : (_jsx(Avatar, Object.assign({ src: token.logoURI, alt: token.symbol }, { children: token.symbol[0] }))) })));
12
+ var _a;
13
+ return (_jsx(Badge, Object.assign({ overlap: "circular", anchorOrigin: { vertical: 'bottom', horizontal: 'right' }, badgeContent: chain && !isLoading ? (_jsx(SmallAvatar, Object.assign({ src: chain.logoURI, alt: chain.name }, { children: chain.name[0] }))) : (_jsx(SmallAvatarSkeleton, {})), sx: sx }, { children: isLoading ? (_jsx(Skeleton, { width: 32, height: 32, variant: "circular" })) : (_jsx(Avatar, Object.assign({ src: token === null || token === void 0 ? void 0 : token.logoURI, alt: token === null || token === void 0 ? void 0 : token.symbol }, { children: (_a = token === null || token === void 0 ? void 0 : token.symbol) === null || _a === void 0 ? void 0 : _a[0] }))) })));
13
14
  };
14
- export const TokenAvatar = ({ token, chain, sx }) => {
15
- if (!chain || !token.logoURI) {
16
- return _jsx(TokenAvatarFallback, { token: token, sx: sx });
15
+ export const TokenAvatar = ({ token, chain, isLoading, sx }) => {
16
+ if (!chain || !(token === null || token === void 0 ? void 0 : token.logoURI)) {
17
+ return _jsx(TokenAvatarFallback, { token: token, isLoading: isLoading, sx: sx });
17
18
  }
18
- return _jsx(TokenAvatarBase, { token: token, chain: chain, sx: sx });
19
+ return (_jsx(TokenAvatarBase, { token: token, chain: chain, isLoading: isLoading, sx: sx }));
19
20
  };
20
21
  export const TokenAvatarDefault = ({ sx }) => {
21
22
  return (_jsx(Badge, Object.assign({ overlap: "circular", anchorOrigin: { vertical: 'bottom', horizontal: 'right' }, badgeContent: _jsx(AvatarDefault, { width: 16, height: 16 }), sx: sx }, { children: _jsx(AvatarDefaultContainer, { children: _jsx(AvatarDefault, { width: 28, height: 28 }) }) })));
@@ -1,5 +1,6 @@
1
1
  import { ListItem as MuiListItem, ListItemButton as MuiListItemButton, } from '@mui/material';
2
2
  import { listItemSecondaryActionClasses } from '@mui/material/ListItemSecondaryAction';
3
+ import { listItemTextClasses } from '@mui/material/ListItemText';
3
4
  import { styled } from '@mui/material/styles';
4
5
  import { getContrastAlphaColor } from '../../utils';
5
6
  export const ListItemButton = styled(MuiListItemButton)(({ theme }) => ({
@@ -23,4 +24,9 @@ export const ListItem = styled(MuiListItem)(({ theme }) => ({
23
24
  [`.${listItemSecondaryActionClasses.root}`]: {
24
25
  right: theme.spacing(3),
25
26
  },
27
+ [`& .${listItemTextClasses.primary}, & .${listItemTextClasses.secondary}`]: {
28
+ textOverflow: 'ellipsis',
29
+ overflow: 'hidden',
30
+ whiteSpace: 'nowrap',
31
+ },
26
32
  }));
@@ -36,8 +36,10 @@ export const VirtualizedTokenList = ({ tokens, featuredTokensLength, scrollEleme
36
36
  getItemKey: (index) => { var _a; return (_a = tokens[index].address) !== null && _a !== void 0 ? _a : index; },
37
37
  });
38
38
  useEffect(() => {
39
- scrollToIndex(0, { align: 'start' });
40
- }, [scrollToIndex, chainId]);
39
+ if (getVirtualItems().length) {
40
+ scrollToIndex(0, { align: 'start' });
41
+ }
42
+ }, [scrollToIndex, chainId, getVirtualItems]);
41
43
  if (isLoading) {
42
44
  return (_jsx(List, Object.assign({ disablePadding: true }, { children: Array.from({ length: 3 }).map((_, index) => (
43
45
  // eslint-disable-next-line react/no-array-index-key
@@ -1,2 +1,2 @@
1
1
  export declare const name = "@lifi/widget";
2
- export declare const version = "1.27.2";
2
+ export declare const version = "1.28.1";
package/config/version.js CHANGED
@@ -1,2 +1,2 @@
1
1
  export const name = '@lifi/widget';
2
- export const version = '1.27.2';
2
+ export const version = '1.28.1';
@@ -1,9 +1,12 @@
1
+ import type { Route } from '@lifi/sdk';
1
2
  export declare const useSwapRoutes: () => {
2
- routes: import("@lifi/sdk").Route[] | undefined;
3
+ routes: Route[] | undefined;
3
4
  isLoading: boolean;
4
5
  isFetching: boolean;
5
6
  isFetched: boolean;
6
7
  dataUpdatedAt: number;
7
8
  refetchTime: number;
8
- refetch: <TPageData>(options?: (import("@tanstack/react-query").RefetchOptions & import("@tanstack/react-query").RefetchQueryFilters<TPageData>) | undefined) => Promise<import("@tanstack/react-query").QueryObserverResult<import("@lifi/sdk").RoutesResponse, any>>;
9
+ refetch: <TPageData>(options?: (import("@tanstack/react-query").RefetchOptions & import("@tanstack/react-query").RefetchQueryFilters<TPageData>) | undefined) => Promise<import("@tanstack/react-query").QueryObserverResult<import("@lifi/sdk").RoutesResponse | {
10
+ routes: Route[];
11
+ }, any>>;
9
12
  };