@lifi/widget 1.25.0 → 1.25.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.
- package/cjs/components/TokenList/useTokenSelect.js +6 -6
- 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/types/widget.d.ts +1 -0
- package/components/TokenList/useTokenSelect.js +6 -6
- package/config/version.d.ts +1 -1
- package/config/version.js +1 -1
- package/package.json +4 -4
- package/providers/SDKProvider/SDKProvider.js +4 -3
- package/tsconfig.cjs.tsbuildinfo +1 -1
- package/types/widget.d.ts +1 -0
|
@@ -12,6 +12,12 @@ const useTokenSelect = (formType, onClick) => {
|
|
|
12
12
|
onChange(tokenAddress);
|
|
13
13
|
onBlur();
|
|
14
14
|
const selectedChainId = chainId !== null && chainId !== void 0 ? chainId : getValues(providers_1.SwapFormKeyHelper.getChainKey(formType));
|
|
15
|
+
// Set chain again to trigger URL builder update
|
|
16
|
+
setValue(providers_1.SwapFormKeyHelper.getChainKey(formType), selectedChainId, {
|
|
17
|
+
shouldDirty: true,
|
|
18
|
+
shouldTouch: true,
|
|
19
|
+
});
|
|
20
|
+
setValue(providers_1.SwapFormKeyHelper.getAmountKey(formType), '');
|
|
15
21
|
const oppositeFormType = formType === 'from' ? 'to' : 'from';
|
|
16
22
|
const [selectedOppositeToken, selectedOppositeChainId] = getValues([
|
|
17
23
|
providers_1.SwapFormKeyHelper.getTokenKey(oppositeFormType),
|
|
@@ -24,12 +30,6 @@ const useTokenSelect = (formType, onClick) => {
|
|
|
24
30
|
shouldTouch: true,
|
|
25
31
|
});
|
|
26
32
|
}
|
|
27
|
-
// Set chain again to trigger URL builder update
|
|
28
|
-
setValue(providers_1.SwapFormKeyHelper.getChainKey(formType), selectedChainId, {
|
|
29
|
-
shouldDirty: true,
|
|
30
|
-
shouldTouch: true,
|
|
31
|
-
});
|
|
32
|
-
setValue(providers_1.SwapFormKeyHelper.getAmountKey(formType), '');
|
|
33
33
|
onClick === null || onClick === void 0 ? void 0 : onClick();
|
|
34
34
|
}, [formType, getValues, onBlur, onChange, onClick, setValue]);
|
|
35
35
|
};
|
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.25.
|
|
2
|
+
export declare const version = "1.25.1";
|
package/cjs/config/version.js
CHANGED
|
@@ -10,15 +10,16 @@ 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, integrator } = (0, WidgetProvider_1.useWidgetConfig)();
|
|
13
|
+
const { sdkConfig, fee, integrator, 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({ 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, routePriority,
|
|
16
|
+
slippage }, sdkConfig === null || sdkConfig === void 0 ? void 0 : sdkConfig.defaultRouteOptions) });
|
|
16
17
|
if (!lifi) {
|
|
17
18
|
lifi = new sdk_1.default(Object.assign({ disableVersionCheck: true }, config));
|
|
18
19
|
}
|
|
19
20
|
lifi.setConfig(config);
|
|
20
21
|
return lifi;
|
|
21
|
-
}, [integrator, sdkConfig]);
|
|
22
|
+
}, [fee, integrator, routePriority, sdkConfig, slippage]);
|
|
22
23
|
return (0, jsx_runtime_1.jsx)(SDKContext.Provider, Object.assign({ value: value }, { children: children }));
|
|
23
24
|
};
|
|
24
25
|
exports.SDKProvider = SDKProvider;
|
package/cjs/types/widget.d.ts
CHANGED
|
@@ -9,6 +9,12 @@ export const useTokenSelect = (formType, onClick) => {
|
|
|
9
9
|
onChange(tokenAddress);
|
|
10
10
|
onBlur();
|
|
11
11
|
const selectedChainId = chainId !== null && chainId !== void 0 ? chainId : getValues(SwapFormKeyHelper.getChainKey(formType));
|
|
12
|
+
// Set chain again to trigger URL builder update
|
|
13
|
+
setValue(SwapFormKeyHelper.getChainKey(formType), selectedChainId, {
|
|
14
|
+
shouldDirty: true,
|
|
15
|
+
shouldTouch: true,
|
|
16
|
+
});
|
|
17
|
+
setValue(SwapFormKeyHelper.getAmountKey(formType), '');
|
|
12
18
|
const oppositeFormType = formType === 'from' ? 'to' : 'from';
|
|
13
19
|
const [selectedOppositeToken, selectedOppositeChainId] = getValues([
|
|
14
20
|
SwapFormKeyHelper.getTokenKey(oppositeFormType),
|
|
@@ -21,12 +27,6 @@ export const useTokenSelect = (formType, onClick) => {
|
|
|
21
27
|
shouldTouch: true,
|
|
22
28
|
});
|
|
23
29
|
}
|
|
24
|
-
// Set chain again to trigger URL builder update
|
|
25
|
-
setValue(SwapFormKeyHelper.getChainKey(formType), selectedChainId, {
|
|
26
|
-
shouldDirty: true,
|
|
27
|
-
shouldTouch: true,
|
|
28
|
-
});
|
|
29
|
-
setValue(SwapFormKeyHelper.getAmountKey(formType), '');
|
|
30
30
|
onClick === null || onClick === void 0 ? void 0 : onClick();
|
|
31
31
|
}, [formType, getValues, onBlur, onChange, onClick, setValue]);
|
|
32
32
|
};
|
package/config/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export declare const name = "@lifi/widget";
|
|
2
|
-
export declare const version = "1.25.
|
|
2
|
+
export declare const version = "1.25.1";
|
package/config/version.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export const name = '@lifi/widget';
|
|
2
|
-
export const version = '1.25.
|
|
2
|
+
export const version = '1.25.1';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lifi/widget",
|
|
3
|
-
"version": "1.25.
|
|
3
|
+
"version": "1.25.1",
|
|
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",
|
|
@@ -47,9 +47,9 @@
|
|
|
47
47
|
"@mui/icons-material": "^5.10.14",
|
|
48
48
|
"@mui/lab": "^5.0.0-alpha.108",
|
|
49
49
|
"@mui/material": "^5.10.14",
|
|
50
|
-
"@sentry/integrations": "^7.
|
|
51
|
-
"@sentry/react": "^7.
|
|
52
|
-
"@sentry/tracing": "^7.
|
|
50
|
+
"@sentry/integrations": "^7.20.0",
|
|
51
|
+
"@sentry/react": "^7.20.0",
|
|
52
|
+
"@sentry/tracing": "^7.20.0",
|
|
53
53
|
"@tanstack/react-query": "^4.16.1",
|
|
54
54
|
"@tanstack/react-virtual": "^3.0.0-beta.23",
|
|
55
55
|
"big.js": "^6.2.1",
|
|
@@ -6,14 +6,15 @@ let lifi;
|
|
|
6
6
|
const SDKContext = createContext(null);
|
|
7
7
|
export const useLiFi = () => useContext(SDKContext);
|
|
8
8
|
export const SDKProvider = ({ children, }) => {
|
|
9
|
-
const { sdkConfig, integrator } = useWidgetConfig();
|
|
9
|
+
const { sdkConfig, fee, integrator, routePriority, slippage } = useWidgetConfig();
|
|
10
10
|
const value = useMemo(() => {
|
|
11
|
-
const config = Object.assign(Object.assign({}, sdkConfig), { defaultRouteOptions: Object.assign({ 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, routePriority,
|
|
12
|
+
slippage }, sdkConfig === null || sdkConfig === void 0 ? void 0 : sdkConfig.defaultRouteOptions) });
|
|
12
13
|
if (!lifi) {
|
|
13
14
|
lifi = new LIFI(Object.assign({ disableVersionCheck: true }, config));
|
|
14
15
|
}
|
|
15
16
|
lifi.setConfig(config);
|
|
16
17
|
return lifi;
|
|
17
|
-
}, [integrator, sdkConfig]);
|
|
18
|
+
}, [fee, integrator, routePriority, sdkConfig, slippage]);
|
|
18
19
|
return _jsx(SDKContext.Provider, Object.assign({ value: value }, { children: children }));
|
|
19
20
|
};
|