@lifi/widget 1.26.3 → 1.26.5
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 +1 -1
- package/cjs/AppDrawer.style.d.ts +1 -1
- package/cjs/components/Card/CardTitle.d.ts +1 -1
- package/cjs/components/ChainSelect/ChainSelect.d.ts +0 -1
- package/cjs/components/ChainSelect/ChainSelect.style.js +1 -1
- package/cjs/components/Step/CircularProgress.d.ts +0 -1
- package/cjs/components/Step/StepList.d.ts +0 -1
- package/cjs/components/SwapInput/SwapInputEndAdornment.d.ts +0 -1
- package/cjs/components/SwapRouteCard/SwapRouteCard.style.d.ts +1 -1
- package/cjs/components/SwapRoutes/SwapRoutesExpanded.d.ts +0 -1
- package/cjs/components/Token/Token.style.d.ts +1 -1
- package/cjs/components/TokenList/VirtualizedTokenList.js +1 -1
- package/cjs/config/version.d.ts +1 -1
- package/cjs/config/version.js +1 -1
- package/cjs/pages/ActiveSwapsPage/ActiveSwapsPage.d.ts +0 -1
- package/cjs/pages/SelectTokenPage/SearchTokenInput.d.ts +0 -1
- package/cjs/pages/SelectWalletPage/SelectWalletPage.d.ts +0 -1
- package/cjs/pages/SettingsPage/AdvancedPreferences.d.ts +0 -1
- package/cjs/pages/SettingsPage/GasPriceSelect.d.ts +0 -1
- package/cjs/pages/SettingsPage/SettingsPage.d.ts +0 -1
- package/cjs/pages/SettingsPage/ShowDestinationWallet.d.ts +0 -1
- package/cjs/pages/SettingsPage/SlippageInput.d.ts +0 -1
- package/cjs/providers/SDKProvider/SDKProvider.js +4 -3
- package/cjs/stores/settings/useSettingsStore.js +2 -2
- package/cjs/types/widget.d.ts +1 -0
- package/components/Card/CardTitle.d.ts +1 -1
- package/components/ChainSelect/ChainSelect.d.ts +0 -1
- package/components/ChainSelect/ChainSelect.style.js +1 -1
- package/components/Step/CircularProgress.d.ts +0 -1
- package/components/Step/StepList.d.ts +0 -1
- package/components/SwapInput/SwapInputEndAdornment.d.ts +0 -1
- package/components/SwapRouteCard/SwapRouteCard.style.d.ts +1 -1
- package/components/SwapRoutes/SwapRoutesExpanded.d.ts +0 -1
- package/components/Token/Token.style.d.ts +1 -1
- package/components/TokenList/VirtualizedTokenList.js +1 -1
- package/config/version.d.ts +1 -1
- package/config/version.js +1 -1
- package/package.json +10 -10
- package/pages/ActiveSwapsPage/ActiveSwapsPage.d.ts +0 -1
- package/pages/SelectTokenPage/SearchTokenInput.d.ts +0 -1
- package/pages/SelectWalletPage/SelectWalletPage.d.ts +0 -1
- package/pages/SettingsPage/AdvancedPreferences.d.ts +0 -1
- package/pages/SettingsPage/GasPriceSelect.d.ts +0 -1
- package/pages/SettingsPage/SettingsPage.d.ts +0 -1
- package/pages/SettingsPage/ShowDestinationWallet.d.ts +0 -1
- package/pages/SettingsPage/SlippageInput.d.ts +0 -1
- package/providers/SDKProvider/SDKProvider.js +4 -3
- package/stores/settings/useSettingsStore.js +2 -2
- package/tsconfig.cjs.tsbuildinfo +1 -1
- package/types/widget.d.ts +1 -0
package/AppDrawer.style.d.ts
CHANGED
|
@@ -39,7 +39,7 @@ export declare const DrawerButton: import("@emotion/styled").StyledComponent<{
|
|
|
39
39
|
} | undefined;
|
|
40
40
|
}, {}, {}>;
|
|
41
41
|
export declare const DrawerButtonTypography: import("@emotion/styled").StyledComponent<import("@mui/system").SystemProps<import("@mui/material").Theme> & {
|
|
42
|
-
align?: "
|
|
42
|
+
align?: "center" | "left" | "right" | "inherit" | "justify" | undefined;
|
|
43
43
|
children?: import("react").ReactNode;
|
|
44
44
|
classes?: Partial<import("@mui/material").TypographyClasses> | undefined;
|
|
45
45
|
gutterBottom?: boolean | undefined;
|
package/cjs/AppDrawer.style.d.ts
CHANGED
|
@@ -39,7 +39,7 @@ export declare const DrawerButton: import("@emotion/styled").StyledComponent<{
|
|
|
39
39
|
} | undefined;
|
|
40
40
|
}, {}, {}>;
|
|
41
41
|
export declare const DrawerButtonTypography: import("@emotion/styled").StyledComponent<import("@mui/system").SystemProps<import("@mui/material").Theme> & {
|
|
42
|
-
align?: "
|
|
42
|
+
align?: "center" | "left" | "right" | "inherit" | "justify" | undefined;
|
|
43
43
|
children?: import("react").ReactNode;
|
|
44
44
|
classes?: Partial<import("@mui/material").TypographyClasses> | undefined;
|
|
45
45
|
gutterBottom?: boolean | undefined;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
export declare const CardTitle: import("@emotion/styled").StyledComponent<import("@mui/system").SystemProps<import("@mui/material").Theme> & {
|
|
3
|
-
align?: "
|
|
3
|
+
align?: "center" | "left" | "right" | "inherit" | "justify" | undefined;
|
|
4
4
|
children?: import("react").ReactNode;
|
|
5
5
|
classes?: Partial<import("@mui/material").TypographyClasses> | undefined;
|
|
6
6
|
gutterBottom?: boolean | undefined;
|
|
@@ -12,7 +12,7 @@ exports.ChainCard = (0, styles_1.styled)(Card_1.Card)({
|
|
|
12
12
|
});
|
|
13
13
|
exports.ChainContainer = (0, styles_1.styled)(material_1.Box)(({ theme }) => ({
|
|
14
14
|
display: 'grid',
|
|
15
|
-
gridTemplateColumns: 'repeat(
|
|
15
|
+
gridTemplateColumns: 'repeat(5, 1fr)',
|
|
16
16
|
gridAutoRows: '56px',
|
|
17
17
|
justifyContent: 'space-between',
|
|
18
18
|
gap: theme.spacing(1.5),
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
export declare const Label: import("@emotion/styled").StyledComponent<import("@mui/system").SystemProps<import("@mui/material").Theme> & {
|
|
3
|
-
align?: "
|
|
3
|
+
align?: "center" | "left" | "right" | "inherit" | "justify" | undefined;
|
|
4
4
|
children?: import("react").ReactNode;
|
|
5
5
|
classes?: Partial<import("@mui/material").TypographyClasses> | undefined;
|
|
6
6
|
gutterBottom?: boolean | undefined;
|
|
@@ -10,7 +10,7 @@ export declare const TextSecondaryContainer: import("@emotion/styled").StyledCom
|
|
|
10
10
|
connected?: boolean | undefined;
|
|
11
11
|
}, {}, {}>;
|
|
12
12
|
export declare const TextSecondary: import("@emotion/styled").StyledComponent<import("@mui/system").SystemProps<import("@mui/material").Theme> & {
|
|
13
|
-
align?: "
|
|
13
|
+
align?: "center" | "left" | "right" | "inherit" | "justify" | undefined;
|
|
14
14
|
children?: import("react").ReactNode;
|
|
15
15
|
classes?: Partial<import("@mui/material").TypographyClasses> | undefined;
|
|
16
16
|
gutterBottom?: boolean | undefined;
|
|
@@ -39,7 +39,7 @@ const VirtualizedTokenList = ({ tokens, featuredTokensLength, scrollElementRef,
|
|
|
39
39
|
getItemKey: (index) => { var _a; return (_a = tokens[index].address) !== null && _a !== void 0 ? _a : index; },
|
|
40
40
|
});
|
|
41
41
|
(0, react_1.useEffect)(() => {
|
|
42
|
-
scrollToIndex(0, { align: 'start'
|
|
42
|
+
scrollToIndex(0, { align: 'start' });
|
|
43
43
|
}, [scrollToIndex, chainId]);
|
|
44
44
|
if (isLoading) {
|
|
45
45
|
return ((0, jsx_runtime_1.jsx)(material_1.List, Object.assign({ disablePadding: true }, { children: Array.from({ length: 3 }).map((_, index) => (
|
package/cjs/config/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export declare const name = "@lifi/widget";
|
|
2
|
-
export declare const version = "1.26.
|
|
2
|
+
export declare const version = "1.26.5";
|
package/cjs/config/version.js
CHANGED
|
@@ -10,16 +10,17 @@ const SDKContext = (0, react_1.createContext)(null);
|
|
|
10
10
|
const useLiFi = () => (0, react_1.useContext)(SDKContext);
|
|
11
11
|
exports.useLiFi = useLiFi;
|
|
12
12
|
const SDKProvider = ({ children, }) => {
|
|
13
|
-
const { sdkConfig, fee, integrator, routePriority, slippage } = (0, WidgetProvider_1.useWidgetConfig)();
|
|
13
|
+
const { sdkConfig, fee, integrator, referrer, routePriority, slippage } = (0, WidgetProvider_1.useWidgetConfig)();
|
|
14
14
|
const value = (0, react_1.useMemo)(() => {
|
|
15
|
-
const config = Object.assign(Object.assign({}, sdkConfig), { defaultRouteOptions: Object.assign({ fee, integrator: integrator !== null && integrator !== void 0 ? integrator : window.location.hostname,
|
|
15
|
+
const config = Object.assign(Object.assign({}, sdkConfig), { defaultRouteOptions: Object.assign({ fee, integrator: integrator !== null && integrator !== void 0 ? integrator : window.location.hostname, referrer,
|
|
16
|
+
routePriority,
|
|
16
17
|
slippage }, sdkConfig === null || sdkConfig === void 0 ? void 0 : sdkConfig.defaultRouteOptions) });
|
|
17
18
|
if (!lifi) {
|
|
18
19
|
lifi = new sdk_1.default(Object.assign({ disableVersionCheck: true }, config));
|
|
19
20
|
}
|
|
20
21
|
lifi.setConfig(config);
|
|
21
22
|
return lifi;
|
|
22
|
-
}, [fee, integrator, routePriority, sdkConfig, slippage]);
|
|
23
|
+
}, [fee, integrator, referrer, routePriority, sdkConfig, slippage]);
|
|
23
24
|
return (0, jsx_runtime_1.jsx)(SDKContext.Provider, Object.assign({ value: value }, { children: children }));
|
|
24
25
|
};
|
|
25
26
|
exports.SDKProvider = SDKProvider;
|
|
@@ -31,7 +31,7 @@ exports.useSettingsStore = (0, zustand_1.default)()((0, middleware_1.persist)((s
|
|
|
31
31
|
})), setValues: (values) => set((state) => {
|
|
32
32
|
const updatedState = Object.assign({}, state);
|
|
33
33
|
for (const key in values) {
|
|
34
|
-
if (Object.
|
|
34
|
+
if (Object.hasOwn(state, key)) {
|
|
35
35
|
updatedState[key] = values[key];
|
|
36
36
|
}
|
|
37
37
|
}
|
|
@@ -45,7 +45,7 @@ exports.useSettingsStore = (0, zustand_1.default)()((0, middleware_1.persist)((s
|
|
|
45
45
|
if (updatedState[`_enabled${toolType}`]) {
|
|
46
46
|
// Add a new tools
|
|
47
47
|
const enabledTools = tools
|
|
48
|
-
.filter((tool) => !Object.
|
|
48
|
+
.filter((tool) => !Object.hasOwn(updatedState[`_enabled${toolType}`], tool))
|
|
49
49
|
.reduce((values, tool) => {
|
|
50
50
|
values[tool] = true;
|
|
51
51
|
return values;
|
package/cjs/types/widget.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
export declare const CardTitle: import("@emotion/styled").StyledComponent<import("@mui/system").SystemProps<import("@mui/material").Theme> & {
|
|
3
|
-
align?: "
|
|
3
|
+
align?: "center" | "left" | "right" | "inherit" | "justify" | undefined;
|
|
4
4
|
children?: import("react").ReactNode;
|
|
5
5
|
classes?: Partial<import("@mui/material").TypographyClasses> | undefined;
|
|
6
6
|
gutterBottom?: boolean | undefined;
|
|
@@ -9,7 +9,7 @@ export const ChainCard = styled(Card)({
|
|
|
9
9
|
});
|
|
10
10
|
export const ChainContainer = styled(Box)(({ theme }) => ({
|
|
11
11
|
display: 'grid',
|
|
12
|
-
gridTemplateColumns: 'repeat(
|
|
12
|
+
gridTemplateColumns: 'repeat(5, 1fr)',
|
|
13
13
|
gridAutoRows: '56px',
|
|
14
14
|
justifyContent: 'space-between',
|
|
15
15
|
gap: theme.spacing(1.5),
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
export declare const Label: import("@emotion/styled").StyledComponent<import("@mui/system").SystemProps<import("@mui/material").Theme> & {
|
|
3
|
-
align?: "
|
|
3
|
+
align?: "center" | "left" | "right" | "inherit" | "justify" | undefined;
|
|
4
4
|
children?: import("react").ReactNode;
|
|
5
5
|
classes?: Partial<import("@mui/material").TypographyClasses> | undefined;
|
|
6
6
|
gutterBottom?: boolean | undefined;
|
|
@@ -10,7 +10,7 @@ export declare const TextSecondaryContainer: import("@emotion/styled").StyledCom
|
|
|
10
10
|
connected?: boolean | undefined;
|
|
11
11
|
}, {}, {}>;
|
|
12
12
|
export declare const TextSecondary: import("@emotion/styled").StyledComponent<import("@mui/system").SystemProps<import("@mui/material").Theme> & {
|
|
13
|
-
align?: "
|
|
13
|
+
align?: "center" | "left" | "right" | "inherit" | "justify" | undefined;
|
|
14
14
|
children?: import("react").ReactNode;
|
|
15
15
|
classes?: Partial<import("@mui/material").TypographyClasses> | undefined;
|
|
16
16
|
gutterBottom?: boolean | undefined;
|
|
@@ -36,7 +36,7 @@ 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'
|
|
39
|
+
scrollToIndex(0, { align: 'start' });
|
|
40
40
|
}, [scrollToIndex, chainId]);
|
|
41
41
|
if (isLoading) {
|
|
42
42
|
return (_jsx(List, Object.assign({ disablePadding: true }, { children: Array.from({ length: 3 }).map((_, index) => (
|
package/config/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export declare const name = "@lifi/widget";
|
|
2
|
-
export declare const version = "1.26.
|
|
2
|
+
export declare const version = "1.26.5";
|
package/config/version.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export const name = '@lifi/widget';
|
|
2
|
-
export const version = '1.26.
|
|
2
|
+
export const version = '1.26.5';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lifi/widget",
|
|
3
|
-
"version": "1.26.
|
|
3
|
+
"version": "1.26.5",
|
|
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",
|
|
@@ -43,15 +43,15 @@
|
|
|
43
43
|
"@ethersproject/experimental": "^5.7.0",
|
|
44
44
|
"@ethersproject/providers": "^5.7.2",
|
|
45
45
|
"@lifi/sdk": "^1.7.0",
|
|
46
|
-
"@lifi/wallet-management": "^1.2.
|
|
46
|
+
"@lifi/wallet-management": "^1.2.2",
|
|
47
47
|
"@mui/icons-material": "^5.10.16",
|
|
48
48
|
"@mui/lab": "^5.0.0-alpha.110",
|
|
49
49
|
"@mui/material": "^5.10.16",
|
|
50
|
-
"@sentry/integrations": "^7.
|
|
51
|
-
"@sentry/react": "^7.
|
|
52
|
-
"@sentry/tracing": "^7.
|
|
53
|
-
"@tanstack/react-query": "^4.
|
|
54
|
-
"@tanstack/react-virtual": "^3.0.0-beta.
|
|
50
|
+
"@sentry/integrations": "^7.23.0",
|
|
51
|
+
"@sentry/react": "^7.23.0",
|
|
52
|
+
"@sentry/tracing": "^7.23.0",
|
|
53
|
+
"@tanstack/react-query": "^4.19.1",
|
|
54
|
+
"@tanstack/react-virtual": "^3.0.0-beta.29",
|
|
55
55
|
"big.js": "^6.2.1",
|
|
56
56
|
"i18next": "22.0.4",
|
|
57
57
|
"i18next-browser-languagedetector": "^7.0.1",
|
|
@@ -59,11 +59,11 @@
|
|
|
59
59
|
"mitt": "^3.0.0",
|
|
60
60
|
"react": "^18.2.0",
|
|
61
61
|
"react-dom": "^18.2.0",
|
|
62
|
-
"react-hook-form": "^7.
|
|
62
|
+
"react-hook-form": "^7.40.0",
|
|
63
63
|
"react-i18next": "^12.0.0",
|
|
64
|
-
"react-router-dom": "^6.4.
|
|
64
|
+
"react-router-dom": "^6.4.4",
|
|
65
65
|
"react-timer-hook": "^3.0.5",
|
|
66
|
-
"zustand": "^4.1.
|
|
66
|
+
"zustand": "^4.1.5"
|
|
67
67
|
},
|
|
68
68
|
"peerDependencies": {
|
|
69
69
|
"@types/react": "^18.0.0",
|
|
@@ -6,15 +6,16 @@ let lifi;
|
|
|
6
6
|
const SDKContext = createContext(null);
|
|
7
7
|
export const useLiFi = () => useContext(SDKContext);
|
|
8
8
|
export const SDKProvider = ({ children, }) => {
|
|
9
|
-
const { sdkConfig, fee, integrator, routePriority, slippage } = useWidgetConfig();
|
|
9
|
+
const { sdkConfig, fee, integrator, referrer, routePriority, slippage } = useWidgetConfig();
|
|
10
10
|
const value = useMemo(() => {
|
|
11
|
-
const config = Object.assign(Object.assign({}, sdkConfig), { defaultRouteOptions: Object.assign({ fee, integrator: integrator !== null && integrator !== void 0 ? integrator : window.location.hostname,
|
|
11
|
+
const config = Object.assign(Object.assign({}, sdkConfig), { defaultRouteOptions: Object.assign({ fee, integrator: integrator !== null && integrator !== void 0 ? integrator : window.location.hostname, referrer,
|
|
12
|
+
routePriority,
|
|
12
13
|
slippage }, sdkConfig === null || sdkConfig === void 0 ? void 0 : sdkConfig.defaultRouteOptions) });
|
|
13
14
|
if (!lifi) {
|
|
14
15
|
lifi = new LIFI(Object.assign({ disableVersionCheck: true }, config));
|
|
15
16
|
}
|
|
16
17
|
lifi.setConfig(config);
|
|
17
18
|
return lifi;
|
|
18
|
-
}, [fee, integrator, routePriority, sdkConfig, slippage]);
|
|
19
|
+
}, [fee, integrator, referrer, routePriority, sdkConfig, slippage]);
|
|
19
20
|
return _jsx(SDKContext.Provider, Object.assign({ value: value }, { children: children }));
|
|
20
21
|
};
|
|
@@ -28,7 +28,7 @@ export const useSettingsStore = create()(persist((set) => (Object.assign(Object.
|
|
|
28
28
|
})), setValues: (values) => set((state) => {
|
|
29
29
|
const updatedState = Object.assign({}, state);
|
|
30
30
|
for (const key in values) {
|
|
31
|
-
if (Object.
|
|
31
|
+
if (Object.hasOwn(state, key)) {
|
|
32
32
|
updatedState[key] = values[key];
|
|
33
33
|
}
|
|
34
34
|
}
|
|
@@ -42,7 +42,7 @@ export const useSettingsStore = create()(persist((set) => (Object.assign(Object.
|
|
|
42
42
|
if (updatedState[`_enabled${toolType}`]) {
|
|
43
43
|
// Add a new tools
|
|
44
44
|
const enabledTools = tools
|
|
45
|
-
.filter((tool) => !Object.
|
|
45
|
+
.filter((tool) => !Object.hasOwn(updatedState[`_enabled${toolType}`], tool))
|
|
46
46
|
.reduce((values, tool) => {
|
|
47
47
|
values[tool] = true;
|
|
48
48
|
return values;
|