@lifi/widget 1.26.3 → 1.26.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/config/version.d.ts +1 -1
- package/cjs/config/version.js +1 -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/config/version.d.ts +1 -1
- package/config/version.js +1 -1
- package/package.json +3 -3
- 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/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.4";
|
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
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.4";
|
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.4';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lifi/widget",
|
|
3
|
-
"version": "1.26.
|
|
3
|
+
"version": "1.26.4",
|
|
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,7 +43,7 @@
|
|
|
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",
|
|
@@ -59,7 +59,7 @@
|
|
|
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
64
|
"react-router-dom": "^6.4.3",
|
|
65
65
|
"react-timer-hook": "^3.0.5",
|
|
@@ -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;
|