@lifi/widget 1.4.0 → 1.5.0

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.
@@ -2,7 +2,7 @@
2
2
  export declare const DrawerButton: import("@emotion/styled").StyledComponent<{
3
3
  children?: import("react").ReactNode;
4
4
  classes?: Partial<import("@mui/material").ButtonClasses> | undefined;
5
- color?: "inherit" | "success" | "error" | "primary" | "secondary" | "info" | "warning" | undefined;
5
+ color?: "inherit" | "success" | "error" | "warning" | "info" | "primary" | "secondary" | undefined;
6
6
  disabled?: boolean | undefined;
7
7
  disableElevation?: boolean | undefined;
8
8
  disableFocusRipple?: boolean | undefined;
package/AppProvider.js CHANGED
@@ -5,12 +5,14 @@ import { Fragment } from 'react';
5
5
  import { QueryClientProvider } from 'react-query';
6
6
  import { MemoryRouter, useInRouterContext } from 'react-router-dom';
7
7
  import { queryClient } from './config/queryClient';
8
+ import { useTelemetry } from './hooks';
8
9
  import { SwapFormProvider } from './providers/SwapFormProvider';
9
10
  import { ThemeProvider } from './providers/ThemeProvider';
10
11
  import { WalletProvider } from './providers/WalletProvider';
11
12
  import { WidgetProvider } from './providers/WidgetProvider';
12
13
  const QueryProvider = QueryClientProvider;
13
14
  export const AppProvider = ({ children, config, }) => {
15
+ useTelemetry(config === null || config === void 0 ? void 0 : config.disableTelemetry);
14
16
  const inRouterContext = useInRouterContext();
15
17
  const Router = inRouterContext ? Fragment : MemoryRouter;
16
18
  return (_jsx(WidgetProvider, Object.assign({ config: config }, { children: _jsx(ThemeProvider, { children: _jsx(QueryProvider, Object.assign({ client: queryClient }, { children: _jsx(Router, { children: _jsx(WalletProvider, { children: _jsx(SwapFormProvider, { children: children }) }) }) })) }) })));
@@ -8,7 +8,7 @@ export const HeaderAppBar = styled(AppBar)(({ theme }) => ({
8
8
  position: 'relative',
9
9
  minHeight: 48,
10
10
  padding: theme.spacing(0, 3, 0, 3),
11
- '&:first-of-type': {
11
+ ':first-of-type': {
12
12
  paddingTop: theme.spacing(1.5),
13
13
  },
14
14
  }));
@@ -3,5 +3,5 @@ import { ReactComponent as LiFiFullLogo } from '../icons/LiFiFullLogo.svg';
3
3
  import { ReactComponent as LiFiIconLogo } from '../icons/LiFiLogo.svg';
4
4
  export const LiFiLogo = ({ variant = 'icon', style }) => {
5
5
  const Component = variant === 'icon' ? LiFiIconLogo : LiFiFullLogo;
6
- return _jsx(Component, { style: style, fill: "currentColor" });
6
+ return _jsx(Component, { style: style, fill: "currentColor", color: "currentColor" });
7
7
  };
@@ -0,0 +1,12 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Box, Typography } from '@mui/material';
3
+ import { LiFiLogo } from '../LiFiLogo';
4
+ import { Link } from './PoweredBy.style';
5
+ export const PoweredBy = () => {
6
+ return (_jsx(Box, Object.assign({ px: 3, pt: 2, pb: 2, sx: {
7
+ display: 'flex',
8
+ alignItems: 'flex-end',
9
+ justifyContent: 'flex-end',
10
+ flex: 1,
11
+ } }, { children: _jsxs(Link, Object.assign({ href: "https://li.fi", target: "_blank", underline: "none", color: "text.primary" }, { children: [_jsx(Typography, Object.assign({ color: "text.secondary", fontSize: 12, px: 0.5 }, { children: "Powered by" })), _jsx(LiFiLogo, { variant: "full", style: { height: 16, width: 42 } })] })) })));
12
+ };
@@ -0,0 +1,12 @@
1
+ /// <reference types="react" />
2
+ export declare const Link: import("@emotion/styled").StyledComponent<Omit<import("@mui/material").LinkBaseProps, "classes"> & {
3
+ children?: import("react").ReactNode;
4
+ classes?: Partial<import("@mui/material").LinkClasses> | undefined;
5
+ color?: import("@mui/system/styleFunctionSx").ResponsiveStyleValue<import("csstype").Property.Color | import("csstype").Property.Color[] | undefined> | ((theme: import("@mui/material").Theme) => import("@mui/system/styleFunctionSx").ResponsiveStyleValue<import("csstype").Property.Color | import("csstype").Property.Color[] | undefined>);
6
+ sx?: import("@mui/material").SxProps<import("@mui/material").Theme> | undefined;
7
+ TypographyClasses?: (Partial<import("@mui/material").TypographyClasses> & Partial<import("@mui/material").ClassNameMap<never>>) | undefined;
8
+ underline?: "none" | "always" | "hover" | undefined;
9
+ variant?: "button" | "caption" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "inherit" | "subtitle1" | "subtitle2" | "body1" | "body2" | "overline" | "@supports (font-variation-settings: normal)" | undefined;
10
+ } & import("@mui/material/OverridableComponent").CommonProps & Omit<Pick<import("react").DetailedHTMLProps<import("react").AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>, "key" | keyof import("react").AnchorHTMLAttributes<HTMLAnchorElement>> & {
11
+ ref?: ((instance: HTMLAnchorElement | null) => void) | import("react").RefObject<HTMLAnchorElement> | null | undefined;
12
+ }, keyof import("@mui/material/OverridableComponent").CommonProps | "p" | "slot" | "title" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "placeholder" | "spellCheck" | "tabIndex" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "children" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "sx" | "key" | "download" | "href" | "hrefLang" | "media" | "ping" | "rel" | "target" | "type" | "referrerPolicy" | "border" | "boxShadow" | "fontWeight" | "zIndex" | "alignContent" | "alignItems" | "alignSelf" | "bottom" | "boxSizing" | "columnGap" | "display" | "flexBasis" | "flexDirection" | "flexGrow" | "flexShrink" | "flexWrap" | "fontFamily" | "fontSize" | "fontStyle" | "gridAutoColumns" | "gridAutoFlow" | "gridAutoRows" | "gridTemplateAreas" | "gridTemplateColumns" | "gridTemplateRows" | "height" | "justifyContent" | "justifyItems" | "justifySelf" | "left" | "letterSpacing" | "lineHeight" | "marginBottom" | "marginLeft" | "marginRight" | "marginTop" | "maxHeight" | "maxWidth" | "minHeight" | "minWidth" | "order" | "paddingBottom" | "paddingLeft" | "paddingRight" | "paddingTop" | "position" | "right" | "rowGap" | "textAlign" | "textOverflow" | "textTransform" | "top" | "visibility" | "whiteSpace" | "width" | "borderBottom" | "borderColor" | "borderLeft" | "borderRadius" | "borderRight" | "borderTop" | "flex" | "gap" | "gridArea" | "gridColumn" | "gridRow" | "margin" | "overflow" | "padding" | "bgcolor" | "m" | "mt" | "mr" | "mb" | "ml" | "mx" | "marginX" | "my" | "marginY" | "pt" | "pr" | "pb" | "pl" | "px" | "paddingX" | "py" | "paddingY" | "typography" | "displayPrint" | "variant" | "align" | "gutterBottom" | "noWrap" | "paragraph" | "variantMapping" | "underline" | "TypographyClasses"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
@@ -0,0 +1,9 @@
1
+ import { Link as MuiLink } from '@mui/material';
2
+ import { styled } from '@mui/material/styles';
3
+ export const Link = styled(MuiLink)(({ theme }) => ({
4
+ display: 'flex',
5
+ alignItems: 'center',
6
+ ':hover': {
7
+ color: theme.palette.primary.main,
8
+ },
9
+ }));
@@ -0,0 +1 @@
1
+ export { PoweredBy } from './PoweredBy';
@@ -0,0 +1 @@
1
+ export { PoweredBy } from './PoweredBy';
@@ -2,7 +2,7 @@
2
2
  export declare const IconButton: import("@emotion/styled").StyledComponent<{
3
3
  children?: import("react").ReactNode;
4
4
  classes?: Partial<import("@mui/material").IconButtonClasses> | undefined;
5
- color?: "inherit" | "default" | "success" | "error" | "primary" | "secondary" | "info" | "warning" | undefined;
5
+ color?: "inherit" | "default" | "success" | "error" | "warning" | "info" | "primary" | "secondary" | undefined;
6
6
  disabled?: boolean | undefined;
7
7
  disableFocusRipple?: boolean | undefined;
8
8
  edge?: false | "end" | "start" | undefined;
@@ -17,7 +17,7 @@ export declare const Button: import("@emotion/styled").StyledComponent<{
17
17
  } & Omit<{
18
18
  children?: import("react").ReactNode;
19
19
  classes?: Partial<import("@mui/material/Button").ButtonClasses> | undefined;
20
- color?: "inherit" | "success" | "error" | "primary" | "secondary" | "info" | "warning" | undefined;
20
+ color?: "inherit" | "success" | "error" | "warning" | "info" | "primary" | "secondary" | undefined;
21
21
  disabled?: boolean | undefined;
22
22
  disableElevation?: boolean | undefined;
23
23
  disableFocusRipple?: boolean | undefined;
@@ -4,7 +4,7 @@ export declare const minInputFontSize = 14;
4
4
  export declare const FormControl: import("@emotion/styled").StyledComponent<{
5
5
  children?: import("react").ReactNode;
6
6
  classes?: Partial<import("@mui/material").FormControlClasses> | undefined;
7
- color?: "success" | "error" | "primary" | "secondary" | "info" | "warning" | undefined;
7
+ color?: "success" | "error" | "warning" | "info" | "primary" | "secondary" | undefined;
8
8
  disabled?: boolean | undefined;
9
9
  error?: boolean | undefined;
10
10
  fullWidth?: boolean | undefined;
@@ -2,7 +2,7 @@
2
2
  export declare const Button: import("@emotion/styled").StyledComponent<{
3
3
  children?: import("react").ReactNode;
4
4
  classes?: Partial<import("@mui/material").ButtonClasses> | undefined;
5
- color?: "inherit" | "success" | "error" | "primary" | "secondary" | "info" | "warning" | undefined;
5
+ color?: "inherit" | "success" | "error" | "warning" | "info" | "primary" | "secondary" | undefined;
6
6
  disabled?: boolean | undefined;
7
7
  disableElevation?: boolean | undefined;
8
8
  disableFocusRipple?: boolean | undefined;
@@ -47,10 +47,13 @@ export const TokenList = ({ formType, height, onClick, }) => {
47
47
  setValue(SwapFormKeyHelper.getTokenKey(formType), tokenAddress);
48
48
  setValue(SwapFormKeyHelper.getAmountKey(formType), '');
49
49
  const oppositeFormType = formType === 'from' ? 'to' : 'from';
50
- const [selectedOppositeToken] = getValues([
50
+ const [selectedOppositeToken, selectedOppositeChain, selectedChain] = getValues([
51
51
  SwapFormKeyHelper.getTokenKey(oppositeFormType),
52
+ SwapFormKeyHelper.getChainKey(oppositeFormType),
53
+ SwapFormKeyHelper.getChainKey(formType),
52
54
  ]);
53
- if (selectedOppositeToken === tokenAddress) {
55
+ if (selectedOppositeToken === tokenAddress &&
56
+ selectedOppositeChain === selectedChain) {
54
57
  setValue(SwapFormKeyHelper.getTokenKey(oppositeFormType), '');
55
58
  }
56
59
  onClick === null || onClick === void 0 ? void 0 : onClick();
@@ -0,0 +1 @@
1
+ export declare const initSentry: (enabled?: boolean) => void;
@@ -0,0 +1,20 @@
1
+ import { CaptureConsole } from '@sentry/integrations';
2
+ import * as Sentry from '@sentry/react';
3
+ import { BrowserTracing } from '@sentry/tracing';
4
+ import { version } from './version';
5
+ export const initSentry = (enabled) => {
6
+ Sentry.init({
7
+ dsn: 'https://bc1312161bf948db9b9c82618035ec22@o1302189.ingest.sentry.io/6539228',
8
+ integrations: [
9
+ new BrowserTracing(),
10
+ new CaptureConsole({
11
+ levels: ['error'],
12
+ }),
13
+ ],
14
+ sampleRate: 1,
15
+ tracesSampleRate: 0.2,
16
+ enabled,
17
+ environment: process.env.NODE_ENV,
18
+ release: version,
19
+ });
20
+ };
@@ -0,0 +1,2 @@
1
+ export declare const name = "@lifi/widget";
2
+ export declare const version = "1.5.0";
@@ -0,0 +1,2 @@
1
+ export const name = '@lifi/widget';
2
+ export const version = '1.5.0';
package/hooks/index.d.ts CHANGED
@@ -6,6 +6,7 @@ export * from './useHasSufficientBalance';
6
6
  export * from './useRouteExecution';
7
7
  export * from './useScrollableContainer';
8
8
  export * from './useSwapRoutes';
9
+ export * from './useTelemetry';
9
10
  export * from './useToken';
10
11
  export * from './useTokenBalance';
11
12
  export * from './useTokenBalances';
package/hooks/index.js CHANGED
@@ -6,6 +6,7 @@ export * from './useHasSufficientBalance';
6
6
  export * from './useRouteExecution';
7
7
  export * from './useScrollableContainer';
8
8
  export * from './useSwapRoutes';
9
+ export * from './useTelemetry';
9
10
  export * from './useToken';
10
11
  export * from './useTokenBalance';
11
12
  export * from './useTokenBalances';
@@ -0,0 +1 @@
1
+ export declare const useTelemetry: (disabled?: boolean) => void;
@@ -0,0 +1,10 @@
1
+ import { useEffect } from 'react';
2
+ import { initSentry } from '../config/sentry';
3
+ export const useTelemetry = (disabled) => {
4
+ useEffect(() => {
5
+ if (disabled) {
6
+ console.warn('Enable crash reports and diagnostic data to be collected. This helps us to better understand how the widget is performing and where improvements need to be made.');
7
+ initSentry(false);
8
+ }
9
+ }, [disabled]);
10
+ };
package/index.js CHANGED
@@ -1,8 +1,10 @@
1
1
  import { App } from './App';
2
2
  import { AppDrawer } from './AppDrawer';
3
+ import { initSentry } from './config/sentry';
3
4
  import './fonts/inter.css';
4
5
  import { configureReactI18next } from './i18n';
5
6
  export * from './types';
7
+ initSentry(true);
6
8
  configureReactI18next();
7
9
  // ClassNameGenerator.configure((componentName) => componentName.replace('Mui', ''));
8
10
  export const LiFiWidget = App;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lifi/widget",
3
- "version": "1.4.0",
3
+ "version": "1.5.0",
4
4
  "description": "LI.FI Widget for cross-chain bridging and swapping. It will drive your multi-chain strategy and attract new users from everywhere.",
5
5
  "sideEffects": false,
6
6
  "main": "./index.js",
@@ -42,17 +42,20 @@
42
42
  "@ethersproject/experimental": "^5.6.3",
43
43
  "@ethersproject/providers": "^5.6.8",
44
44
  "@lifi/wallet-management": "^1.0.4",
45
- "@lifinance/sdk": "^1.0.0-beta.11",
45
+ "@lifinance/sdk": "^1.0.0-beta.12",
46
46
  "@mui/icons-material": "^5.8.4",
47
- "@mui/lab": "^5.0.0-alpha.87",
48
- "@mui/material": "^5.8.5",
47
+ "@mui/lab": "^5.0.0-alpha.88",
48
+ "@mui/material": "^5.8.6",
49
+ "@sentry/integrations": "^7.4.0",
50
+ "@sentry/react": "^7.4.0",
51
+ "@sentry/tracing": "^7.4.0",
49
52
  "big.js": "^6.2.0",
50
53
  "i18next": "^21.8.11",
51
54
  "immer": "^9.0.15",
52
55
  "react": "^18.2.0",
53
56
  "react-dom": "^18.2.0",
54
- "react-hook-form": "^7.33.0",
55
- "react-i18next": "^11.17.3",
57
+ "react-hook-form": "^7.33.1",
58
+ "react-i18next": "^11.17.4",
56
59
  "react-query": "^4.0.0-beta.23",
57
60
  "react-resize-detector": "^7.1.2",
58
61
  "react-router-dom": "^6.3.0",
@@ -2,7 +2,7 @@
2
2
  export declare const ToggleButton: import("@emotion/styled").StyledComponent<{
3
3
  children?: import("react").ReactNode;
4
4
  classes?: Partial<import("@mui/material").ToggleButtonClasses> | undefined;
5
- color?: "success" | "error" | "primary" | "secondary" | "info" | "warning" | "standard" | undefined;
5
+ color?: "success" | "error" | "warning" | "info" | "primary" | "secondary" | "standard" | undefined;
6
6
  disabled?: boolean | undefined;
7
7
  disableFocusRipple?: boolean | undefined;
8
8
  fullWidth?: boolean | undefined;
@@ -2,7 +2,7 @@
2
2
  export declare const LinkButton: import("@emotion/styled").StyledComponent<{
3
3
  children?: import("react").ReactNode;
4
4
  classes?: Partial<import("@mui/material").IconButtonClasses> | undefined;
5
- color?: "inherit" | "default" | "success" | "error" | "primary" | "secondary" | "info" | "warning" | undefined;
5
+ color?: "inherit" | "default" | "success" | "error" | "warning" | "info" | "primary" | "secondary" | undefined;
6
6
  disabled?: boolean | undefined;
7
7
  disableFocusRipple?: boolean | undefined;
8
8
  edge?: false | "end" | "start" | undefined;
@@ -12,7 +12,7 @@ export declare const Container: import("@emotion/styled").StyledComponent<{
12
12
  export declare const Button: import("@emotion/styled").StyledComponent<{
13
13
  children?: import("react").ReactNode;
14
14
  classes?: Partial<import("@mui/material").ButtonClasses> | undefined;
15
- color?: "inherit" | "success" | "error" | "primary" | "secondary" | "info" | "warning" | undefined;
15
+ color?: "inherit" | "success" | "error" | "warning" | "info" | "primary" | "secondary" | undefined;
16
16
  disabled?: boolean | undefined;
17
17
  disableElevation?: boolean | undefined;
18
18
  disableFocusRipple?: boolean | undefined;
@@ -19,6 +19,9 @@ export const SwapRoutesPage = () => {
19
19
  setExecutableRoute(route);
20
20
  navigate(routes.swap, { state: { routeId: route.id }, replace: true });
21
21
  };
22
+ // A route for this transaction does not exist yet possibly due to liquidity issues or because the amount of tokens you are sending is below the bridge minimum amount.
23
+ // Please try again later or change the tokens you intend to swap.
24
+ // If the problem persists, come to our Discord and leave a message in the support channel.
22
25
  return (_jsx(Stack, Object.assign({ direction: "column", spacing: 2 }, { children: isLoading || isFetching
23
26
  ? Array.from({ length: 3 }).map((_, index) => (_jsx(Skeleton, { variant: "rectangular", width: "100%", height: 196, sx: { borderRadius: 1 } }, index)))
24
27
  : swapRoutes === null || swapRoutes === void 0 ? void 0 : swapRoutes.map((route, index) => (_jsx(SwapRouteCard, { route: route, active: (currentRoute === null || currentRoute === void 0 ? void 0 : currentRoute.id) === route.id, onClick: () => handleRouteClick(route) }, route.id))) })));
@@ -26,21 +26,9 @@ const initialContext = {
26
26
  const WalletContext = createContext(initialContext);
27
27
  export const useWallet = () => useContext(WalletContext);
28
28
  export const WalletProvider = ({ children }) => {
29
- var _a;
30
29
  const config = useWidgetConfig();
31
30
  const { connect: walletManagementConnect, disconnect: walletManagementDisconnect, signer, } = useLifiWalletManagement();
32
31
  const [account, setAccount] = useState({});
33
- useEffect(() => {
34
- var _a;
35
- console.log('WalletProvider: signer changed.', (_a = config.walletManagement) === null || _a === void 0 ? void 0 : _a.signer);
36
- const updateSigner = () => __awaiter(void 0, void 0, void 0, function* () {
37
- var _b;
38
- const account = yield extractAccountFromSigner((_b = config.walletManagement) === null || _b === void 0 ? void 0 : _b.signer);
39
- setAccount(account);
40
- console.log('WalletProvider: signer changed account.', account);
41
- });
42
- updateSigner();
43
- }, [(_a = config.walletManagement) === null || _a === void 0 ? void 0 : _a.signer]);
44
32
  const connect = useCallback((wallet) => __awaiter(void 0, void 0, void 0, function* () {
45
33
  if (config.walletManagement) {
46
34
  const signer = yield config.walletManagement.connect();
@@ -94,7 +82,11 @@ export const WalletProvider = ({ children }) => {
94
82
  // keep account information up to date
95
83
  useEffect(() => {
96
84
  const updateAccount = () => __awaiter(void 0, void 0, void 0, function* () {
97
- if (!config.walletManagement) {
85
+ if (config.walletManagement) {
86
+ const account = yield extractAccountFromSigner(config.walletManagement.signer);
87
+ setAccount(account);
88
+ }
89
+ else {
98
90
  const account = yield extractAccountFromSigner(signer);
99
91
  setAccount(account);
100
92
  }
package/types/widget.d.ts CHANGED
@@ -25,6 +25,7 @@ interface WidgetConfigBase {
25
25
  theme?: ThemeConfig;
26
26
  appearance?: Appearance;
27
27
  disableAppearance?: boolean;
28
+ disableTelemetry?: boolean;
28
29
  walletManagement?: WidgetWalletManagement;
29
30
  }
30
31
  declare type WidgetFromTokenConfig = {
@@ -1,14 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { Box, Link, Typography } from '@mui/material';
3
- import { LiFiLogo } from './LiFiLogo';
4
- export const PoweredBy = () => {
5
- return (_jsx(Box, Object.assign({ px: 3, pt: 2, pb: 2, sx: {
6
- display: 'flex',
7
- alignItems: 'flex-end',
8
- justifyContent: 'flex-end',
9
- flex: 1,
10
- } }, { children: _jsxs(Link, Object.assign({ sx: {
11
- display: 'flex',
12
- alignItems: 'center',
13
- }, href: "https://li.fi", target: "_blank", underline: "none", color: "text.primary" }, { children: [_jsx(Typography, Object.assign({ color: "text.secondary", fontSize: 12, px: 0.5 }, { children: "Powered by" })), _jsx(LiFiLogo, { variant: "full", style: { height: 16, width: 42 } })] })) })));
14
- };