@lifi/widget 2.2.5 → 2.2.7
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/AppDrawer.style.d.ts +12 -2
- package/cjs/AppDrawer.style.d.ts +12 -2
- package/cjs/components/Card/Card.d.ts +1 -3
- package/cjs/components/Card/CardLabel.d.ts +12 -2
- package/cjs/components/Card/CardTitle.d.ts +12 -2
- package/cjs/components/ChainSelect/ChainSelect.style.d.ts +1 -3
- package/cjs/components/Header/Header.style.d.ts +8 -1
- package/cjs/components/Header/NavigationTabs.style.d.ts +1 -3
- package/cjs/components/RouteCard/RouteCard.style.d.ts +12 -2
- package/cjs/components/Step/StepList.js +5 -3
- package/cjs/components/Token/Token.style.d.ts +12 -2
- package/cjs/config/version.d.ts +1 -1
- package/cjs/config/version.js +1 -1
- package/cjs/stores/StoreProvider.js +2 -1
- package/cjs/stores/chains/ChainOrderStore.d.ts +9 -0
- package/cjs/stores/chains/ChainOrderStore.js +31 -0
- package/cjs/stores/chains/createChainOrderStore.d.ts +4 -0
- package/cjs/stores/chains/{useChainOrderStore.js → createChainOrderStore.js} +4 -3
- package/cjs/stores/chains/index.d.ts +2 -1
- package/cjs/stores/chains/index.js +2 -1
- package/cjs/stores/chains/useChainOrder.js +2 -2
- package/components/Card/Card.d.ts +1 -3
- package/components/Card/CardLabel.d.ts +12 -2
- package/components/Card/CardTitle.d.ts +12 -2
- package/components/ChainSelect/ChainSelect.style.d.ts +1 -3
- package/components/Header/Header.style.d.ts +8 -1
- package/components/Header/NavigationTabs.style.d.ts +1 -3
- package/components/RouteCard/RouteCard.style.d.ts +12 -2
- package/components/Step/StepList.js +5 -3
- package/components/Token/Token.style.d.ts +12 -2
- package/config/version.d.ts +1 -1
- package/config/version.js +1 -1
- package/package.json +4 -4
- package/stores/StoreProvider.js +2 -1
- package/stores/chains/ChainOrderStore.d.ts +9 -0
- package/stores/chains/ChainOrderStore.js +25 -0
- package/stores/chains/createChainOrderStore.d.ts +4 -0
- package/stores/chains/{useChainOrderStore.js → createChainOrderStore.js} +2 -2
- package/stores/chains/index.d.ts +2 -1
- package/stores/chains/index.js +2 -1
- package/stores/chains/useChainOrder.js +1 -1
- package/tsconfig.cjs.tsbuildinfo +1 -1
- package/cjs/stores/chains/useChainOrderStore.d.ts +0 -3
- package/stores/chains/useChainOrderStore.d.ts +0 -3
|
@@ -1,4 +1,14 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
export declare const IconTypography: import("@emotion/styled").StyledComponent<import("@mui/
|
|
2
|
+
export declare const IconTypography: import("@emotion/styled").StyledComponent<import("@mui/system").SystemProps<import("@mui/material").Theme> & {
|
|
3
|
+
align?: "center" | "left" | "right" | "inherit" | "justify" | undefined;
|
|
4
|
+
children?: import("react").ReactNode;
|
|
5
|
+
classes?: Partial<import("@mui/material").TypographyClasses> | undefined;
|
|
6
|
+
gutterBottom?: boolean | undefined;
|
|
7
|
+
noWrap?: boolean | undefined;
|
|
8
|
+
paragraph?: boolean | undefined;
|
|
9
|
+
sx?: import("@mui/material").SxProps<import("@mui/material").Theme> | undefined;
|
|
10
|
+
variant?: import("@mui/types").OverridableStringUnion<"inherit" | import("@mui/material").TypographyVariant, import("@mui/material").TypographyPropsVariantOverrides> | undefined;
|
|
11
|
+
variantMapping?: Partial<Record<import("@mui/types").OverridableStringUnion<"inherit" | import("@mui/material").TypographyVariant, import("@mui/material").TypographyPropsVariantOverrides>, string>> | undefined;
|
|
12
|
+
} & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref"> & {
|
|
3
13
|
ref?: ((instance: HTMLSpanElement | null) => void) | import("react").RefObject<HTMLSpanElement> | null | undefined;
|
|
4
|
-
},
|
|
14
|
+
}, keyof import("@mui/material/OverridableComponent").CommonProps | "children" | "sx" | "variant" | ("p" | "color" | "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") | "align" | "gutterBottom" | "noWrap" | "paragraph" | "variantMapping"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
|
|
@@ -10,9 +10,11 @@ export const getStepList = (route, subvariant) => route?.steps.map((step, index,
|
|
|
10
10
|
const toToken = index === lastIndex
|
|
11
11
|
? {
|
|
12
12
|
...(step.execution?.toToken ?? step.action?.toToken),
|
|
13
|
-
amount: step.execution?.toAmount
|
|
14
|
-
?
|
|
15
|
-
:
|
|
13
|
+
amount: step.execution?.toAmount
|
|
14
|
+
? step.execution.toAmount
|
|
15
|
+
: subvariant === 'nft'
|
|
16
|
+
? route.toAmount
|
|
17
|
+
: step.estimate.toAmount,
|
|
16
18
|
}
|
|
17
19
|
: undefined;
|
|
18
20
|
const toAddress = index === lastIndex && route.fromAddress !== route.toAddress
|
|
@@ -9,9 +9,19 @@ export declare const TextSecondaryContainer: import("@emotion/styled").StyledCom
|
|
|
9
9
|
}, "children" | "sx" | "ref" | ("p" | "color" | "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") | "component"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme> & {
|
|
10
10
|
connected?: boolean | undefined;
|
|
11
11
|
}, {}, {}>;
|
|
12
|
-
export declare const TextSecondary: import("@emotion/styled").StyledComponent<import("@mui/
|
|
12
|
+
export declare const TextSecondary: import("@emotion/styled").StyledComponent<import("@mui/system").SystemProps<import("@mui/material").Theme> & {
|
|
13
|
+
align?: "center" | "left" | "right" | "inherit" | "justify" | undefined;
|
|
14
|
+
children?: import("react").ReactNode;
|
|
15
|
+
classes?: Partial<import("@mui/material").TypographyClasses> | undefined;
|
|
16
|
+
gutterBottom?: boolean | undefined;
|
|
17
|
+
noWrap?: boolean | undefined;
|
|
18
|
+
paragraph?: boolean | undefined;
|
|
19
|
+
sx?: import("@mui/material").SxProps<import("@mui/material").Theme> | undefined;
|
|
20
|
+
variant?: import("@mui/types").OverridableStringUnion<"inherit" | import("@mui/material").TypographyVariant, import("@mui/material").TypographyPropsVariantOverrides> | undefined;
|
|
21
|
+
variantMapping?: Partial<Record<import("@mui/types").OverridableStringUnion<"inherit" | import("@mui/material").TypographyVariant, import("@mui/material").TypographyPropsVariantOverrides>, string>> | undefined;
|
|
22
|
+
} & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref"> & {
|
|
13
23
|
ref?: ((instance: HTMLSpanElement | null) => void) | import("react").RefObject<HTMLSpanElement> | null | undefined;
|
|
14
|
-
},
|
|
24
|
+
}, keyof import("@mui/material/OverridableComponent").CommonProps | "children" | "sx" | "variant" | ("p" | "color" | "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") | "align" | "gutterBottom" | "noWrap" | "paragraph" | "variantMapping"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme> & {
|
|
15
25
|
connected?: boolean | undefined;
|
|
16
26
|
dot?: boolean | undefined;
|
|
17
27
|
}, {}, {}>;
|
package/config/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export declare const name = "@lifi/widget";
|
|
2
|
-
export declare const version = "2.2.
|
|
2
|
+
export declare const version = "2.2.7";
|
package/config/version.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export const name = '@lifi/widget';
|
|
2
|
-
export const version = '2.2.
|
|
2
|
+
export const version = '2.2.7';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lifi/widget",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.7",
|
|
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
|
"main": "./cjs/index.js",
|
|
6
6
|
"module": "./index.js",
|
|
@@ -44,14 +44,14 @@
|
|
|
44
44
|
"@ethersproject/experimental": "^5.7.0",
|
|
45
45
|
"@ethersproject/providers": "^5.7.2",
|
|
46
46
|
"@lifi/sdk": "^2.2.1",
|
|
47
|
-
"@lifi/wallet-management": "^2.2.
|
|
47
|
+
"@lifi/wallet-management": "^2.2.4",
|
|
48
48
|
"@mui/icons-material": "^5.14.1",
|
|
49
49
|
"@mui/lab": "^5.0.0-alpha.137",
|
|
50
|
-
"@mui/material": "^5.14.
|
|
50
|
+
"@mui/material": "^5.14.2",
|
|
51
51
|
"@tanstack/react-query": "^4.32.0",
|
|
52
52
|
"@tanstack/react-virtual": "^3.0.0-beta.54",
|
|
53
53
|
"big.js": "^6.2.1",
|
|
54
|
-
"i18next": "^23.
|
|
54
|
+
"i18next": "^23.3.0",
|
|
55
55
|
"i18next-browser-languagedetector": "^7.1.0",
|
|
56
56
|
"microdiff": "^1.3.2",
|
|
57
57
|
"mitt": "^3.0.1",
|
package/stores/StoreProvider.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { ChainOrderStoreProvider } from './chains';
|
|
2
3
|
import { HeaderStoreProvider } from './header';
|
|
3
4
|
import { RouteExecutionStoreProvider } from './routes';
|
|
4
5
|
import { SplitSubvariantStoreProvider } from './settings';
|
|
5
6
|
export const StoreProvider = ({ children, config, }) => {
|
|
6
|
-
return (_jsx(SplitSubvariantStoreProvider, { state: config.subvariant === 'split' ? 'swap' : undefined, children: _jsx(HeaderStoreProvider, { namePrefix: config?.keyPrefix, children: _jsx(RouteExecutionStoreProvider, { namePrefix: config?.keyPrefix, children: children }) }) }));
|
|
7
|
+
return (_jsx(SplitSubvariantStoreProvider, { state: config.subvariant === 'split' ? 'swap' : undefined, children: _jsx(HeaderStoreProvider, { namePrefix: config?.keyPrefix, children: _jsx(ChainOrderStoreProvider, { namePrefix: config?.keyPrefix, children: _jsx(RouteExecutionStoreProvider, { namePrefix: config?.keyPrefix, children: children }) }) }) }));
|
|
7
8
|
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { StoreApi, UseBoundStore } from 'zustand';
|
|
3
|
+
import type { PersistStoreProviderProps } from '../types';
|
|
4
|
+
import type { ChainOrderState } from './types';
|
|
5
|
+
export type ChainOrderStore = UseBoundStore<StoreApi<ChainOrderState>>;
|
|
6
|
+
export declare const ChainOrderStoreContext: import("react").Context<ChainOrderStore | null>;
|
|
7
|
+
export declare function ChainOrderStoreProvider({ children, ...props }: PersistStoreProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export declare function useChainOrderStore<T>(selector: (state: ChainOrderState) => T, equalityFn?: (left: T, right: T) => boolean): T;
|
|
9
|
+
export declare function useChainOrderStoreContext(): ChainOrderStore;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { createContext, useContext, useRef } from 'react';
|
|
3
|
+
import { createChainOrderStore } from './createChainOrderStore';
|
|
4
|
+
export const ChainOrderStoreContext = createContext(null);
|
|
5
|
+
export function ChainOrderStoreProvider({ children, ...props }) {
|
|
6
|
+
const storeRef = useRef();
|
|
7
|
+
if (!storeRef.current) {
|
|
8
|
+
storeRef.current = createChainOrderStore(props);
|
|
9
|
+
}
|
|
10
|
+
return (_jsx(ChainOrderStoreContext.Provider, { value: storeRef.current, children: children }));
|
|
11
|
+
}
|
|
12
|
+
export function useChainOrderStore(selector, equalityFn) {
|
|
13
|
+
const useStore = useContext(ChainOrderStoreContext);
|
|
14
|
+
if (!useStore) {
|
|
15
|
+
throw new Error(`You forgot to wrap your component in <${ChainOrderStoreProvider.name}>.`);
|
|
16
|
+
}
|
|
17
|
+
return useStore(selector, equalityFn);
|
|
18
|
+
}
|
|
19
|
+
export function useChainOrderStoreContext() {
|
|
20
|
+
const useStore = useContext(ChainOrderStoreContext);
|
|
21
|
+
if (!useStore) {
|
|
22
|
+
throw new Error(`You forgot to wrap your component in <${ChainOrderStoreProvider.name}>.`);
|
|
23
|
+
}
|
|
24
|
+
return useStore;
|
|
25
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { PersistStoreProps } from '../types';
|
|
2
|
+
import type { ChainOrderState } from './types';
|
|
3
|
+
export declare const maxChainToOrder = 9;
|
|
4
|
+
export declare const createChainOrderStore: ({ namePrefix }: PersistStoreProps) => import("zustand").UseBoundStore<import("zustand").StoreApi<ChainOrderState>>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { create } from 'zustand';
|
|
2
2
|
import { persist } from 'zustand/middleware';
|
|
3
3
|
export const maxChainToOrder = 9;
|
|
4
|
-
export const
|
|
4
|
+
export const createChainOrderStore = ({ namePrefix }) => create(persist((set, get) => ({
|
|
5
5
|
chainOrder: [],
|
|
6
6
|
availableChains: [],
|
|
7
7
|
initializeChains: (chainIds) => {
|
|
@@ -43,7 +43,7 @@ export const useChainOrderStore = create(persist((set, get) => ({
|
|
|
43
43
|
});
|
|
44
44
|
},
|
|
45
45
|
}), {
|
|
46
|
-
name:
|
|
46
|
+
name: `${namePrefix || 'li.fi'}-widget-chains-order`,
|
|
47
47
|
version: 0,
|
|
48
48
|
partialize: (state) => ({ chainOrder: state.chainOrder }),
|
|
49
49
|
}));
|
package/stores/chains/index.d.ts
CHANGED
package/stores/chains/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { shallow } from 'zustand/shallow';
|
|
2
|
-
import { useChainOrderStore } from '
|
|
2
|
+
import { useChainOrderStore } from './ChainOrderStore';
|
|
3
3
|
export const useChainOrder = () => {
|
|
4
4
|
return useChainOrderStore((state) => [state.chainOrder, state.setChain], shallow);
|
|
5
5
|
};
|